Skip to content
Tutorials Center
My learning

Topics

Apache Hive Tutorial

Learn Apache Hive step by step: 36 lessons in 9 chapters with examples, quizzes, diagrams and projects.

Start learning →

of lessons completed

Getting Started

  1. 1 What Is Apache Hive? Learn what Apache Hive is, why it was created, how it turns SQL-like HiveQL into distributed jobs, and how it differs from a traditional relational database.
  2. 2 Installing Hive and Run Modes See what Apache Hive needs (Java, Hadoop, a metastore database), how to install it, which configuration files matter, and the difference between local, embedded and remote modes.
  3. 3 Hive CLI and Beeline Learn how to connect to Hive with Beeline and HiveServer2, run queries and script files, set session variables, and why the old Hive CLI was replaced.
  4. 4 Your First Hive Session Walk through a complete first Hive session: create a database and table, load a small file, run SELECT queries, inspect the table with DESCRIBE, and clean up.

Architecture and Metastore

  1. 5 Hive Architecture Understand Hive architecture: clients, HiveServer2, the driver, compiler, optimizer, metastore, execution engine and storage, and what each component is responsible for.
  2. 6 The Life of a Hive Query Follow one HiveQL query from text to results: parsing, semantic analysis, logical and physical planning, optimization, execution and fetching, and how to read EXPLAIN output.
  3. 7 The Hive Metastore Learn what the Hive metastore stores, how its relational schema is organized, the embedded, local and remote deployments, and why Spark and Trino share it.
  4. 8 Execution Engines: MapReduce, Tez and Spark Compare the engines Hive can use to run queries: MapReduce, Apache Tez, Hive on Spark and LLAP. Learn how map and reduce stages work and how to choose and set the engine.

HiveQL Basics

  1. 9 Databases and DDL in Hive Learn Hive data definition language: create, alter, describe and drop databases and tables, set locations and properties, copy structures with LIKE and CTAS, and add columns safely.
  2. 10 Hive Data Types Learn all Hive data types: numeric, string, date and time, boolean, plus ARRAY, MAP, STRUCT and UNIONTYPE. Understand implicit and explicit casting and how NULL appears on bad data.
  3. 11 Loading and Inserting Data Learn every way to get data into and out of Hive tables: LOAD DATA, INSERT VALUES, INSERT SELECT, INSERT OVERWRITE, multi-insert, CTAS, and exporting results to directories.
  4. 12 SELECT, Filter and Sort in Hive Master HiveQL queries: SELECT lists, WHERE filters, DISTINCT, LIKE and RLIKE, BETWEEN, IN, CASE, ORDER BY versus SORT BY, DISTRIBUTE BY, CLUSTER BY and LIMIT.
  5. 13 Built-in Functions in Hive A tour of Hive's built-in functions: string, math, date and time, conditional, collection functions, explode with LATERAL VIEW, and how to discover functions with SHOW FUNCTIONS.
  6. 14 GROUP BY and Aggregation in Hive Summarize big data in Hive with GROUP BY, HAVING, COUNT DISTINCT, GROUPING SETS, ROLLUP, CUBE and window functions, and learn how map-side aggregation and skew affect speed.

Tables, Partitions and Buckets

  1. 15 Managed and External Tables Understand Hive managed and external tables: who owns the data, what DROP TABLE does, LOCATION, converting between types, ACID managed tables, and best practices for raw data.
  2. 16 Partitioned Tables in Hive Learn Hive partitioning: how partition folders work, creating and loading static partitions, partition pruning, SHOW and DROP PARTITION, MSCK REPAIR TABLE and how to choose partition keys.
  3. 17 Dynamic Partitioning Load many Hive partitions in one statement with dynamic partitioning: required settings, strict versus nonstrict mode, column order rules, limits, small files and overwrite behavior.
  4. 18 Bucketed Tables and Sampling Learn Hive bucketing: CLUSTERED BY and INTO n BUCKETS, how rows are assigned by hash, bucket map joins, sorted buckets, TABLESAMPLE for data sampling, and partitioning versus bucketing.

Joins and Optimization

  1. 19 Join Types in HiveQL Learn every HiveQL join: inner, left, right and full outer, LEFT SEMI, cross and multi-table joins, plus the rules that make Hive joins correct and fast.
  2. 20 Map Joins and Shuffle Joins See how Hive executes a join as a shuffle (reduce-side) join or a broadcast map join, which settings trigger each one, and how to use hints and automatic conversion.
  3. 21 Skew and Sort-Merge Bucket Joins Fix slow Hive joins caused by skewed keys, and use bucket map joins and sort-merge bucket joins to join huge tables without a full shuffle.
  4. 22 EXPLAIN and the Cost-Based Optimizer Read Hive query plans with EXPLAIN, collect table and column statistics with ANALYZE TABLE, and understand how the Calcite cost-based optimizer chooses join orders.

File Formats and Compression

  1. 23 Text, SequenceFile, RCFile and Avro Compare Hive's row-oriented and early columnar formats: TEXTFILE with delimiters, SequenceFile, RCFile, Avro and JSON, and learn when each one is still the right choice.
  2. 24 ORC and Parquet in Hive Learn how ORC and Parquet store data, how stripes, row indexes and bloom filters let Hive skip data, and how to create, convert and compact ORC tables.
  3. 25 Compression Codecs and SerDes Choose compression codecs for Hive output and intermediate data, understand splittability, and learn what a SerDe does with LazySimpleSerDe, OpenCSV, JSON and Regex.

UDFs and Transactions

  1. 26 Built-in Functions and UDF Basics Tour Hive's built-in functions for strings, dates, conditionals, JSON and collections, including explode and LATERAL VIEW, and learn the three kinds of user-defined functions.
  2. 27 Writing Java UDFs, UDAFs and UDTFs Build and register Hive user-defined functions in Java: a GenericUDF, the UDAF aggregation lifecycle, a UDTF, packaging a JAR, CREATE FUNCTION and testing without a cluster.
  3. 28 ACID Transactions in Hive Understand how Hive supports INSERT, UPDATE and DELETE with ACID guarantees: transactional tables, base and delta files, snapshot isolation, required settings and limits.
  4. 29 MERGE, UPDATE, DELETE and Compaction Write row-level changes in Hive with UPDATE, DELETE and MERGE INTO, then keep ACID tables fast with minor and major compaction, SHOW COMPACTIONS and the cleaner.

Tuning and Integration

  1. 30 Execution Engines โ€“ MapReduce, Tez, LLAP and Vectorization See how Hive runs queries on MapReduce, Tez and LLAP, why Tez DAGs avoid disk writes between stages, and how vectorized execution speeds up scans and aggregates.
  2. 31 A Hive Performance Tuning Checklist A practical Hive tuning checklist: partition pruning, file formats, small files, statistics, join strategy, reducer count, memory settings, dynamic partitions and common anti-patterns.
  3. 32 Hive with Spark, HBase, Kafka, HDFS and Beeline Connect Hive to the rest of the data platform: the shared metastore with Spark and Trino, external tables on HDFS and S3, HBase and Kafka storage handlers, JDBC, Beeline and Python clients.
  4. 33 Security and HiveServer2 Secure a Hive deployment: HiveServer2 authentication with Kerberos and LDAP, SQL-standard authorization and Ranger policies, column masking, views for row and column limits, and encryption.

Projects and Practice

  1. 34 Project: Web Log Analytics Build a web log analytics pipeline in Hive: external table over raw logs, partitioned ORC fact table, daily reports, error analysis and sessionization with window functions.
  2. 35 Project: Sales Data Warehouse Design a star-schema sales warehouse in Hive: dimension and fact tables, partitioned ORC loading, rollup reports, a type 2 slowly changing dimension and optimization checks.
  3. 36 Hive Practice Exercises and Interview Questions Practice Hive-style queries (top-N, deduplication, anti-joins, running totals) in your browser, then review 30 concise answers to the Hive questions interviewers ask most often.