100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Programming

Hive Basics

An introduction to Apache Hive's SQL-on-Hadoop model, covering its architecture, the Metastore, table design, and query execution.

Ecosystem ToolsBeginner9 min readJul 10, 2026
Analogies

What Is Hive?

Apache Hive is a data warehouse layer built on top of Hadoop that lets analysts query data stored in HDFS using HiveQL, a SQL-like language, instead of writing raw MapReduce code. Hive translates each query into a directed acyclic graph of MapReduce, Tez, or Spark jobs depending on the configured execution engine, and it follows a schema-on-read model: the underlying files aren't validated or transformed at load time, structure is imposed only when a query reads them, which makes ingestion fast but shifts data-quality bugs to query time.

🏏

Cricket analogy: Like a commentator translating raw ball-by-ball data into a readable scorecard on demand, rather than the broadcaster reformatting the footage as it's recorded, Hive imposes structure only when a query like a Virat Kohli strike-rate breakdown actually runs.

Hive Architecture and the Metastore

Hive's architecture centers on the Driver, which parses and plans a query, the Compiler and Optimizer, which turn that plan into an execution DAG, and the Metastore, a separate service backed by a relational database like MySQL or PostgreSQL that stores table schemas, partition locations, and column statistics rather than any actual data. Because the Metastore is decoupled from the query engine, multiple tools, Hive itself, Spark SQL, Presto, and Impala, can all share the same catalog of table definitions and read the same underlying HDFS or S3 files consistently.

🏏

Cricket analogy: The Metastore is like the official scorecard archive an entire cricket board maintains centrally, so both the TV broadcaster and the stadium's giant screen pull the same match records rather than each keeping a private, possibly inconsistent copy.

The Metastore stores only metadata -- table schemas, partition locations, column statistics -- never the actual rows. Losing HDFS data is catastrophic, but losing the Metastore is nearly as bad: Hive would no longer know which files belong to which table, so it should be backed up like any production database.

Tables, Partitions, and Buckets

Hive tables come in two flavors: managed (internal) tables, where Hive owns the underlying data files and DROP TABLE deletes them, and external tables, where Hive only stores metadata pointing at files that live independently, so dropping the table leaves the data untouched, the safer default when other tools also read those files. Large tables should be partitioned, typically by a low-cardinality column like a date, so a query with a WHERE clause on that column only scans the relevant subdirectories, and can additionally be bucketed by hashing a high-cardinality column like user_id into a fixed number of files to speed up joins and sampling.

🏏

Cricket analogy: Partitioning a huge ball-by-ball dataset by match_date is like a stadium archive filing scorecards into separate boxes per series, so a request for just the 2023 World Cup only pulls those boxes instead of the entire archive.

sql
CREATE EXTERNAL TABLE web_logs (
  user_id     STRING,
  event_type  STRING,
  event_ts    TIMESTAMP
)
PARTITIONED BY (log_date STRING)
CLUSTERED BY (user_id) INTO 32 BUCKETS
STORED AS ORC
LOCATION 's3://analytics-bucket/web_logs/';

ALTER TABLE web_logs ADD PARTITION (log_date='2026-07-09')
  LOCATION 's3://analytics-bucket/web_logs/log_date=2026-07-09/';

SELECT event_type, COUNT(*)
FROM web_logs
WHERE log_date = '2026-07-09'
GROUP BY event_type;

Query Execution Engines

Hive's default execution engine historically was MapReduce, but production clusters now overwhelmingly configure hive.execution.engine to tez or spark, since Tez collapses a query's MapReduce stages into a single DAG that avoids writing intermediate results back to HDFS between every stage, cutting latency substantially for multi-join queries. Storing tables in a columnar format like ORC or Parquet compounds this benefit, because Hive's vectorized query execution reads and processes data in batches of a few thousand rows per column at once rather than row by row, and predicate pushdown lets it skip entire ORC stripes that a WHERE clause's min/max statistics prove can't match.

🏏

Cricket analogy: Switching from MapReduce to Tez is like a broadcast team building one continuous highlights reel instead of exporting the footage to disk after every over and re-importing it for the next segment, dramatically cutting turnaround time for a Kohli innings recap.

Over-partitioning is a common beginner mistake: partitioning by a high-cardinality column like user_id (instead of bucketing by it) can produce millions of tiny HDFS partitions, overwhelming the Metastore and NameNode with small-file metadata and making planning slower than a full scan would have been.

  • Hive layers a SQL-like language, HiveQL, over Hadoop, translating queries into MapReduce, Tez, or Spark execution DAGs.
  • Hive follows schema-on-read: files aren't validated at load time, structure is applied only when a query reads them.
  • The Metastore is a separate database-backed service storing table and partition metadata, shared by Hive, Spark SQL, Presto, and other engines.
  • External tables leave underlying files untouched on DROP TABLE; managed tables delete the data along with the metadata.
  • Partitioning by a low-cardinality column like date enables partition pruning; bucketing by a high-cardinality column speeds up joins and sampling.
  • Tez and columnar formats like ORC, combined with vectorized execution and predicate pushdown, dramatically outperform classic MapReduce-based Hive.

Practice what you learned

Was this page helpful?

Topics covered

#Programming#HadoopStudyNotes#HiveBasics#Hive#Architecture#Metastore#Tables#StudyNotes#SkillVeris#ExamPrep

Frequently Asked Questions

21 categories · pick one to explore

Where can I get free study notes for programming and tech subjects?
SkillVeris offers completely free study notes covering programming and tech subjects, with no signup fees or paywalls. The notes are structured by course and topic, written for quick understanding, and enriched with the Learn Through Hobbies analogy method, so you can revise concepts through cricket, music, gaming, cooking and more.
Are SkillVeris study notes good for exam revision?
Yes, the study notes are designed for efficient revision: each topic answers its heading immediately, keeps explanations concise, and links to related glossary terms and cheat sheets. Students preparing for university exams or certification tests use them as quick revision notes because they distil concepts without the padding of full textbooks.
What subjects do the free study notes cover?
The study notes span the platform's main domains, including AI and machine learning, Python and programming, web development, DevOps, cloud, security and databases. Coverage mirrors the 37 live courses, so notes exist for the topics you are actually studying, and new note sets are added as courses launch.
How are SkillVeris study notes different from regular textbooks?
The notes are answer-first, concise and free, whereas textbooks are long and often expensive. Each section explains one concept directly, then reinforces it through selectable hobby analogies like cricket or cooking. Notes also cross-link to the glossary, blog and cheat sheets, letting you jump to related material instantly instead of flipping pages.
Can I use the developer study material without creating an account?
The study notes are free to access, and SkillVeris does not charge anything for its developer study material at any point. Browsing notes is straightforward from the Study Notes section, and if you want progress tracking, certificates and AI Mentor conversations tied to your learning, a free account unlocks those extras.
Do the study notes explain concepts with analogies?
Yes, this is a signature SkillVeris feature. Study notes use the Learn Through Hobbies method, explaining technical concepts through analogies from twelve domains including cricket, music, gaming, photography, travel, movies, fitness, chess, cooking, finance, business and sports. You can switch the analogy domain instantly to whichever hobby makes the concept click.
Are the revision notes suitable for last-minute exam preparation?
Yes, revision notes on SkillVeris work well for last-minute preparation because every section states the answer in its first sentences, so skimming is genuinely effective. Pair them with the relevant cheat sheet for formulas and syntax, and use the glossary for any unfamiliar term you meet while cramming.
Is there free study material for AI and machine learning?
Yes, SkillVeris provides free study notes across its AI and ML catalogue, covering Python for AI, deep learning frameworks like PyTorch and TensorFlow, Hugging Face Transformers, Large Language Models, RAG, AI agents and MLOps. All of it is free, making it a strong resource for Indian students and global learners alike.
Can beginners understand the study notes, or are they for experts?
Beginners can absolutely use them. The notes are written in plain language, define terms as they appear, and lean on hobby analogies to make abstract ideas concrete. Difficulty scales with the underlying course level, so beginner-course notes stay gentle while advanced-course notes go deeper, and the glossary supports you throughout.
How do study notes connect with SkillVeris courses?
Study notes are organised by course and topic, so they map directly to the structured courses and their 24–40-lesson curriculum. Many learners study a lesson first, then use the matching notes for revision before module assessments and the final exam, where 80 percent is required to pass and earn the certificate.
Are there study notes for Python specifically?
Yes, Python is well covered through notes tied to the Python-focused courses, including Python for AI and ML. Topics span fundamentals through applied machine learning usage. You can reinforce the notes with Python practice in Code Lab, which runs code in your browser with no installation required.
Do the study notes include code examples?
Yes, study notes include code examples wherever a concept is best shown in code, alongside explanations, key points and analogies. Reading a snippet in the notes and then reproducing it yourself in Code Lab is an effective loop, since Code Lab lets you run code in the browser across six languages.
How often is new study material added to SkillVeris?
Study material grows alongside the course catalogue. Whenever new courses join the platform's 37 live courses, matching study notes, glossary entries and cheat sheets are added so the resources stay in sync. Existing notes are also refined over time, so it is worth revisiting topics you studied earlier.
Can I use SkillVeris notes to prepare for technical interviews?
Yes, the notes make excellent interview revision because they compress each concept into direct, answer-first explanations, which mirrors how you should answer interview questions. Combine them with the SkillVeris interview questions feature, which includes readiness scoring, to test whether your revision has actually made you interview-ready.
Are the study notes mobile-friendly for studying on the go?
Yes, the study notes are built to load fast and read comfortably on mobile devices, so you can revise during a commute or between classes. Sections are short and answer-first, which suits small screens, and analogy switching works on mobile too, letting you study anywhere without carrying books.
What is the difference between study notes and cheat sheets?
Study notes explain concepts in depth with context, examples and analogies, making them ideal for learning and revision. Cheat sheets are compact quick-reference summaries of syntax, commands and key facts, ideal once you already understand a topic. Most learners study the notes first, then keep the cheat sheet handy while coding.
Do study notes help if I am stuck on a course lesson?
Yes, reading the matching study notes often clarifies a lesson because the same concept is explained from a different angle, frequently with a different analogy. If you are still stuck, ask the AI Mentor, which answers 24/7 at Quick, Detailed or Deep-dive depth until the idea genuinely makes sense.
Is there free study material for DevOps and cloud topics?
Yes, SkillVeris carries free study notes for DevOps and cloud topics as part of its coverage across 37 live courses. The material suits learners following the DevOps Engineer or Cloud Engineer paths, and it links to related glossary terms and cheat sheets so you can revise the whole toolchain in one place.
Can school or college students in India use these notes for projects?
Yes, students across India and worldwide use SkillVeris notes for coursework, projects and exam preparation, and everything is free, which matters for student budgets. The notes explain concepts clearly enough to cite in project reports, and Code Lab lets you prototype the project code directly in your browser.
How should I combine study notes with other SkillVeris resources?
A proven loop: learn from a course lesson, revise with the matching study notes, look up unfamiliar terms in the glossary, keep the cheat sheet open while practising in Code Lab, and quiz yourself with interview questions. The AI Mentor fills any remaining gaps 24/7, at whatever depth you need.

What Learners Say

Real journeys from the SkillVeris community — swipe for more.

SkillVeris taught me Python through Cricket. Now I’m building real projects and feeling confident!
Arjun S. · B.Tech Student
The best platform for hobby-based learning. Concepts finally stick.
Priya R. · Data Analyst
I went from zero coding to a portfolio of projects — all by learning through my love for gaming. Landed my first internship!
Kabir M. · CS Undergraduate
Trending Topics50 popular tags — tap to explore
Trending CoursesAll 37 free courses — tap to browse