Twenty names in one meeting
Riya joins the data team of a food-delivery company for her internship. In the first stand-up she hears: “Kafka lag is fine, the Iceberg compaction ran, the Hive table is late because Airflow retried, and HBase is serving the restaurant lookups.” She has spent twelve modules on HDFS, YARN and MapReduce. Where do all these other names fit?
Sir, is every one of these names a part of Hadoop?
No. Hadoop itself is only three things you already know: HDFS, YARN and MapReduce (plus the shared Common libraries). The rest are separate projects that grew around it, most of them at the Apache Software Foundation. Each one fills a gap: SQL for analysts, fast row lookups, ingestion, scheduling, security.
And some of them are gone. Our old runbooks still mention Sqoop and Oozie, but nobody installs them on new clusters.
Right. Today we draw the map: what each project does, which ones are alive, which ones retired, and where each sits on top of HDFS and YARN. Then we run one of them, Spark SQL, on our own cluster and see the old MapReduce pattern inside its plan.
The Hadoop ecosystem
The Hadoop ecosystem is the set of open-source projects built to work with the core Hadoop components — the HDFS distributed file system, the YARN resource manager and the MapReduce processing framework. It includes storage and table layers (HBase, Ozone, Apache Iceberg/Delta Lake/Apache Hudi), a shared metastore for table definitions, processing engines (Tez, Spark, Flink), SQL engines (Hive, Impala, Trino, Spark SQL, Drill), coordination (ZooKeeper), ingestion (Kafka, NiFi), workflow scheduling, security and governance (Ranger, Knox, Atlas) and cluster management tools. These components read and write data in HDFS or compatible storage and usually run their work as YARN applications, so one cluster can serve batch, interactive SQL, streaming and low-latency lookups.
Hadoop is the ground floor: a place to keep huge files and a way to share machines. The ecosystem is everything built on that floor so that different people can use the data in their own way: SQL for analysts, fast lookups for apps, pipelines for engineers.
Words you'll meet in this lesson
From our lab (Spark 4.0.4 on our YARN cluster)
| Table | An EXTERNAL table canteen.orders over student_orders.csv in HDFS; no data copied, only a definition stored in a local metastore |
|---|---|
| Metastore | DESCRIBE shows Hive classes: Serde Library org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe |
| Query | GROUP BY item over 5 lakh orders in 11.1 s: thali first by revenue (₹24,23,360), chai first by orders (1,49,669) |
| Plan | partial_count → Exchange hashpartitioning → count: the map-side combine, shuffle and reduce of Modules 8–9 |
| Not run | Apache Hive itself: Hive 4.2 needs JDK 21 (our image has 17) and the Hive 4.1 download from archive.apache.org was too slow |
Architecture at a glance
The ecosystem in layers, bottom to top. Everything runs on HDFS (or cloud object storage) and most of it runs inside YARN containers. Grey boxes are retired or dormant projects you will still meet in older clusters and job descriptions.
The ecosystem at three levels
Beginner A railway station, not a train
- Think of HDFS as the tracks and YARN as the station master who decides which platform each train gets.
- MapReduce was the first train. Later came faster trains (Tez, Spark) on the same tracks.
- Hive and Trino are ticket counters that speak SQL; HBase is the enquiry window that answers one question instantly; ZooKeeper is the signal system everybody trusts.
- Some counters closed over the years (Sqoop, Oozie) and new ones opened (Airflow, Iceberg). The tracks stayed.
Intermediate One job per project
- Hive: SQL tables over files; the Hive Metastore became the shared catalogue every engine reads.
- HBase: random reads and writes by row key on top of HDFS, e.g. a delivery app looking up a restaurant by ID.
- ZooKeeper: who is the active NameNode (Lesson 7.1), which HBase server owns which rows, Kafka's older controller.
- Kafka: a durable log of events (orders, clicks) that pipelines read in order. NiFi: drag-and-drop data flows.
- Spark / Tez / Flink: engines that replaced MapReduce for most jobs; Flink for continuous streams.
- Ranger, Knox, Atlas: access policies, a secure gateway, and lineage/catalog (Lesson 12.5).
Advanced How they map onto the core
- Almost every engine is a YARN application: its own ApplicationMaster plus containers (Lesson 11.2). Our Spark SQL query ran exactly like that.
- Data lives in HDFS files; the metastore only stores schema + location, which is why one table can be read by Hive, Spark and Trino.
- Engines still follow map → shuffle → reduce; Spark's plan shows partial aggregation, an Exchange (shuffle) and final aggregation.
- HBase is the exception: long-running RegionServers keep data in memory and write HFiles to HDFS; it uses ZooKeeper, not YARN, for coordination.
Exam tip: For “Explain the Hadoop ecosystem”, draw three layers (storage HDFS, resource management YARN, processing engines) and place 6–8 projects with one line each: Hive (SQL), HBase (NoSQL, random access), ZooKeeper (coordination), Spark (in-memory processing), Kafka (ingestion), Ranger (security). Mention that Sqoop and Oozie are retired.
Who does what, and who is still alive
| Layer | Project | Used for | Example | Status (checked 22 Oct 2026) |
|---|---|---|---|---|
| SQL | Hive | SQL tables over HDFS files; metastore | Daily sales report | Active: 4.2.1 (Aug 2026); 1.x–3.x lines end of life |
| Engine | Spark | Batch, SQL, ML, streaming in memory | Feature tables for a model | Active: 4.2 (Jul 2026); 3.5 LTS to Nov 2027 |
| Engine | Tez | DAG engine under Hive | Hive queries without MapReduce | Active (not in the Attic) |
| NoSQL | HBase | Fast reads/writes by row key | Restaurant lookup by ID | Active (2.6.x in Amazon EMR 7.14 and Cloudera 7.3.2) |
| Coordination | ZooKeeper | Leader election, locks, config | Active/standby NameNode | Active (3.9.3 in EMR 7.14) |
| SQL | Trino, Impala, Drill | Fast interactive SQL | Analyst dashboards | Active |
| Tables | Iceberg, Delta, Hudi | Updates, deletes, snapshots on Parquet | GDPR-style deletes, time travel | Active (Iceberg 1.10 in EMR 7.14) |
| Ingestion | Sqoop | Copy RDBMS tables to HDFS | Nightly MySQL import | Retired Jun 2021 (Apache Attic) |
| Ingestion | Flume | Ship log events to HDFS | Web server logs | Dormant since 10 Oct 2024 |
| Workflow | Oozie | Schedule chains of Hadoop jobs | Hourly ETL | Retired Feb 2025 (still shipped in EMR 7.14) |
| Security | Sentry | Role-based SQL permissions | Hive grants | Retired Dec 2020 → Ranger |
| Scripting | Pig | Data-flow scripts compiled to MapReduce | Log cleaning | Not retired; still in EMR 7.14 (0.17.0) but rarely chosen for new work |
Replacements you will see in job descriptions
Sqoop → Spark JDBC / CDC
Spark reads databases over JDBC; change-data-capture tools stream row changes into Kafka.
ingestionFlume → Kafka
Applications publish events to Kafka; connectors or Spark write them to HDFS or object storage.
eventsOozie → Airflow
Workflows as Python DAGs with retries, sensors and a web UI.
schedulingMapReduce → Spark / Tez
Same map–shuffle–reduce idea, with memory and better plans (next lesson).
enginesAnimated example: one day of data at a food-delivery company
- 13:02: a customer orders biryani in Pune; the app writes an order event to Kafka.
- 13:07: a micro-batch job commits the last five minutes of events to an Iceberg table in HDFS.
- 13:07: meanwhile the app reads the restaurant's details from HBase by row key, in milliseconds.
- 01:00: a nightly Spark job on YARN builds the daily summary tables from the Iceberg data.
- 09:30: an analyst queries them with Trino; the metastore says which files to read.
- All day: ZooKeeper keeps track of which NameNode is active and which HBase server owns which rows. (Illustrative company.)
When a project name is new to you, ask three questions: where does its data live (HDFS, its own servers, memory), does it run on YARN, and is it still released. Those answers place it on the map in a minute.
SQL on Hadoop, on our own cluster
We added Spark 4.0.4 (downloaded from dlcdn.apache.org) to the Module 8 lab's namenode container and ran spark-sql on YARN with three 512 MB executors. The SQL file is in “Run it on your PC”.
Define a table over an existing HDFS file
Nothing was copied. The metastore stored the columns and the file location: under a second.CREATE TABLE canteen.orders (order_id BIGINT, student STRING, ts STRING, item STRING, amount INT) USING csv OPTIONS (path 'hdfs://namenode/user/hadoop/data/student_orders.csv');Time taken: 0.753 secondsLook at what the metastore knows
EXTERNAL means dropping the table leaves the file alone. The Hive class names show where the metastore idea came from.DESCRIBE TABLE EXTENDED canteen.orders;Type EXTERNAL Provider csv Location hdfs://namenode/user/hadoop/data/student_orders.csv Serde Library org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDeAsk a business question
The same numbers our Java jobs produced in Module 9, written as one SQL statement. Thali earns most with the fewest orders.SELECT item, count(*) AS orders, sum(amount) AS revenue FROM canteen.orders GROUP BY item ORDER BY revenue DESC;thali 30292 2423360 dosa 49927 2246715 chai 149669 2245035 vada pav 69754 1395080 … coffee 40364 807280 Time taken: 11.084 seconds, Fetched 8 row(s)A second question, no new code
Lunch (13–14 h) and breakfast (08 h) are the rush hours. With Java MapReduce this would be a new Mapper, Reducer and jar.SELECT substr(ts, 12, 2) AS hour, count(*) AS orders FROM canteen.orders GROUP BY 1 ORDER BY orders DESC LIMIT 3;14 62213 13 56026 08 55852 Time taken: 2.838 seconds, Fetched 3 row(s)See MapReduce inside the plan
Read from the bottom: scan only the item column, count per item inside each task (a combiner, Lesson 9.1), shuffle by hash of item (Lesson 9.2), add the partial counts (the reduce).EXPLAIN SELECT item, count(*) FROM canteen.orders GROUP BY item;+- HashAggregate(keys=[item#14], functions=[count(1)]) +- Exchange hashpartitioning(item#14, 200) +- HashAggregate(keys=[item#14], functions=[partial_count(1)]) +- FileScan csv spark_catalog.canteen.orders[item#14] … ReadSchema: struct<item:string>
Our lab did not run Apache Hive itself: Hive 4.2 needs JDK 21 while the Hadoop image has JDK 17, and the Hive 4.1 download was too slow. Spark SQL uses the same table-and-metastore model, so the steps carry over; on a real cluster you would type the same SQL into Hive's Beeline.
One SQL query through the stack
Six steps of our real spark-sql run: what the terminal showed, and which ecosystem layer did the work.
- spark-sql starts as a YARN application in the default queue.
- The CREATE TABLE takes under a second: it only writes a definition.
- DESCRIBE shows an external table pointing at the HDFS file, with Hive classes.
- EXPLAIN shows partial aggregation, a hash shuffle and the final aggregation.
- The query returns 8 rows in 11.1 s; thali earns the most.
- A second question about rush hours takes 2.8 s: executors are already running.
- The driver asks the ResourceManager for three executor containers, like any YARN application.
- CREATE TABLE touches only the metastore; HDFS is not read.
- DESCRIBE reads columns, location and format back from the metastore.
- The optimizer builds a plan with a combiner-like partial count, a hash shuffle and a final count.
- Executors read HDFS splits near the data, count locally and shuffle by item.
- The second query reuses the running executors, so it finishes in under 3 s.
The ecosystem at work
1. Retail: Hive and Trino for finance reports
A retail chain keeps years of bills as Parquet tables in HDFS; finance runs month-end SQL through Hive and quick checks through Trino on the same tables.
2. Telecom: HBase for subscriber profiles
A telecom operator stores each subscriber's latest plan and usage in HBase so the care app fetches one customer in milliseconds, while nightly jobs scan the same data.
3. Payments: Kafka into the lake
A payments company publishes every transaction to Kafka; fraud rules read the stream in seconds and a sink job lands it in Iceberg tables for audits.
4. Insurance: moving off retired tools
An insurer rewrites its Oozie workflows as Airflow DAGs and its Sqoop imports as Spark JDBC jobs, one pipeline at a time, keeping both running until outputs match.
5. Healthcare research: governance first
A hospital research group tags patient columns in Atlas so Ranger masks them for analysts, and every query is audited.
Simplified; organisations differ in tools and policies.
Sources (checked 22 Oct 2026): Apache Attic: retired projects · Apache Flume README (dormant notice) · Apache Hive downloads · endoflife.date: Apache Spark · Amazon EMR 7.x application versions · Cloudera Base 7.3.2 summary
Pick the right tool, then run a GROUP BY by hand
Part one is a tiny rule engine: describe a requirement and it suggests ecosystem projects. Part two does what our SQL engine did for GROUP BY item: partial counts per task (map + combine), a shuffle by key, and a final sum (reduce).
RULES = [ # (keyword in the requirement, suggestion)
("sql", "Hive / Spark SQL / Trino over metastore tables"),
("single row", "HBase (get by row key)"),
("events", "Kafka, then Spark or Flink"),
("update", "Iceberg / Delta / Hudi table format"),
("schedule", "Airflow (Oozie is retired)"),
("leader", "ZooKeeper"),
("access", "Ranger policies + Kerberos"),
]
def pick(req):
return [tool for key, tool in RULES if key in req.lower()] or ["plain HDFS files + Spark"]
for r in ["Analysts need SQL on 3 years of bills",
"App must fetch a single row per customer in 10 ms",
"Clickstream events every second, update totals"]:
print(f"{r[:44]:44} -> {pick(r)}")
# GROUP BY item, the way the plan executed it
tasks = [["chai", "dosa", "chai"], ["thali", "chai"], ["dosa", "chai", "thali"]]
partial = []
for t in tasks: # HashAggregate partial_count, per task
counts = {}
for item in t:
counts[item] = counts.get(item, 0) + 1
partial.append(counts)
print("partial counts:", partial)
final = {}
for counts in partial: # Exchange (shuffle by item) + final count
for item, n in counts.items():
final[item] = final.get(item, 0) + n
print("final :", dict(sorted(final.items())))return [tool for key, tool in RULES if key in req.lower()] or ["plain HDFS files + Spark"]A requirement can match several rules: real platforms combine tools.for t in tasks: # HashAggregate partial_count, per taskThis loop is the combiner (Lesson 9.1): each task counts its own rows first.for counts in partial: # Exchange (shuffle by item) + final countOnly small partial counts cross the network, then the reducer adds them.
Run it on your PC: SQL on Hadoop with Spark
Uses the Module 8 lab. Download Spark 4.0.4 (spark-4.0.4-bin-hadoop3.tgz from dlcdn.apache.org), copy it into the namenode container and unpack it. Spark needs to know where Hadoop's configuration is so it can find HDFS and YARN. Three executors of 512 MB fit our small cluster.
SQL over an HDFS file, on YARN
-- sql_on_hadoop.sql: SQL over files in HDFS, with a Hive-style metastore (Spark SQL, run on YARN)
CREATE DATABASE IF NOT EXISTS canteen;
DROP TABLE IF EXISTS canteen.orders;
CREATE TABLE canteen.orders (order_id BIGINT, student STRING, ts STRING, item STRING, amount INT)
USING csv OPTIONS (path 'hdfs://namenode/user/hadoop/data/student_orders.csv');
DESCRIBE TABLE EXTENDED canteen.orders;
SELECT item, count(*) AS orders, sum(amount) AS revenue FROM canteen.orders GROUP BY item ORDER BY revenue DESC;
SELECT substr(ts, 12, 2) AS hour, count(*) AS orders FROM canteen.orders GROUP BY 1 ORDER BY orders DESC LIMIT 3;
EXPLAIN SELECT item, count(*) FROM canteen.orders GROUP BY item;
-- In the namenode container (after unpacking Spark into /tmp/opt):
-- export SPARK_HOME=/tmp/opt/spark-4.0.4-bin-hadoop3
-- export HADOOP_CONF_DIR=/opt/hadoop/etc/hadoop
-- $SPARK_HOME/bin/spark-sql --master yarn --num-executors 3 --executor-memory 512m \
-- --executor-cores 1 --driver-memory 512m -f sql_on_hadoop.sqlReal output with Spark's INFO/WARN logging filtered out. The first query takes longer (11.1 s) because executors and the plan warm up; later ones reuse them. spark-sql creates metastore_db (a local Derby metastore) and spark-warehouse in the folder you run it from.
How a metastore answers “where is this table?”
An engine never scans HDFS looking for a table. It asks the metastore for the location and format, then plans the read.
Worked examples: real problems, solved and traced in memory
Four “which tool?” decisions from different industries, each reasoned from the requirement.
Analysts want SQL on five years of sales
Problem statement
A retail chain has 5 years of daily sales as CSV files in HDFS. Analysts know SQL, not Java. What do you add, and do you need to copy the data?
CSV in HDFS · SQL users
Define an external table over 900 GB; copy needed: False Engine: Hive or Spark SQL for batch, Trino for quick questions
Approach
- SQL over files = a metastore table + a SQL engine.
- An EXTERNAL table points at the files: nothing is copied.
- Later, convert to Parquet for speed (Lesson 10.2).
Solution: run it live
What happens in memory, step by step
Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.
Customer care needs one subscriber in 10 ms
Problem statement
A care agent types a mobile number and must see the plan and last recharge within 10 ms. The data is 40 crore rows. Is Hive the right choice?
40 crore rows · 1 row per request · 10 ms
full scan on one disk: 8 minutes; HBase get by key: a few milliseconds
Approach
- A SQL engine scans files; even a fast one takes seconds.
- A key-value store reads one row by key directly.
- Keep both: HBase for lookups, Parquet tables for analytics.
Solution: run it live
What happens in memory, step by step
Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.
Replacing Oozie after its retirement
Problem statement
A logistics firm runs 120 Oozie workflows. Oozie was retired to the Apache Attic in February 2025. Plan the move and estimate effort at 1.5 days per workflow with 2 engineers.
120 workflows · 1.5 days each · 2 engineers
90 working days, about 4.3 months
Approach
- Target: Airflow DAGs calling the same Spark/Hive jobs.
- Migrate in waves, run old and new side by side, compare outputs.
- Estimate calendar time.
Solution: run it live
What happens in memory, step by step
Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.
Deleting one customer's data on request
Problem statement
A fintech must delete a customer's records on request from a 2 TB transactions table stored as Parquet in HDFS (5,000 files). Plain Parquet files cannot be edited in place. Compare rewriting everything with a table format.
2 TB · 5,000 files · rows of 1 customer spread over ~40 files
rewrite everything: 2048 GB; table format rewrites ~16.4 GB in 40 files
Approach
- Plain files: rewrite every file that contains the customer, and know which ones they are.
- Iceberg/Delta/Hudi: DELETE … WHERE customer = …, rewriting only affected files and committing a snapshot.
- Compare bytes rewritten.
Solution: run it live
What happens in memory, step by step
Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.
Check yourself
Quick revision
Lesson 13.1 in one screen
- Hadoop = HDFS + YARN + MapReduce (+ Common). The ecosystem is built around it.
- Layers: storage (HDFS, Ozone, object stores) → tables (Iceberg/Delta/Hudi, metastore, HBase, Kudu) → YARN → engines (MapReduce, Tez, Spark, Flink) and SQL (Hive, Spark SQL, Trino, Impala, Drill).
- Around them: ingestion (Kafka, NiFi), workflow (Airflow), coordination (ZooKeeper), security (Ranger, Knox, Atlas).
- Retired: Sqoop (Jun 2021), Sentry (Dec 2020), Oozie (Feb 2025); Flume dormant since Oct 2024 (checked 22 Oct 2026).
- Metastore = table definitions; engines share it. EXTERNAL tables just point at files.
- Lab: Spark SQL on YARN, GROUP BY over 5 lakh orders in 11.1 s; plan = partial aggregate → shuffle → final aggregate.
Interview and viva questions
What are the main components of the Hadoop ecosystem?
The core is HDFS (storage), YARN (resource management) and MapReduce (processing). Around it: Hive and other SQL engines (Spark SQL, Trino, Impala), HBase for low-latency key access, ZooKeeper for coordination, Spark, Tez and Flink as processing engines, Kafka and NiFi for ingestion, Airflow for scheduling, Ranger, Knox and Atlas for security and governance, and table formats such as Apache Iceberg.
What is the difference between Hive and HBase?
Hive is a SQL engine over files: good for scanning and aggregating large tables, with query times of seconds to minutes. HBase is a NoSQL store for reading and writing individual rows by key in milliseconds. Many systems use both: HBase to serve applications, Hive or Spark for analytics.
Is Sqoop still used?
Apache Sqoop was retired to the Apache Attic in June 2021, and Amazon EMR stopped including it from release 7.4.0. Older clusters may still run it, but new pipelines usually use Spark JDBC reads or change-data-capture into Kafka.
Why does Hadoop need ZooKeeper?
Distributed services must agree on facts such as which NameNode is active or which HBase server owns which rows, even when machines fail. ZooKeeper provides a small, replicated, strongly consistent store with watches and ephemeral nodes that these services use for leader election, locks and configuration.
What is the Hive metastore?
A service and database holding table and partition definitions: column names and types, storage format, and file locations. Hive, Spark, Trino, Impala and others share it, so a table defined once can be queried by many engines.
Practice problems
Ecosystem exercises: place projects, read our real results, and choose tools.
Average order value per item
From our real GROUP BY, compute revenue per order for thali, dosa and chai.
thali 30292 2423360 · dosa 49927 2246715 · chai 149669 2245035
thali 80.0 dosa 45.0 chai 15.0
Show solution and explanation
for item, n, rev in [("thali", 30292, 2423360), ("dosa", 49927, 2246715), ("chai", 149669, 2245035)]:
print(item, rev / n)How it works: 80, 45 and 15: the menu prices, so the SQL result agrees with the data.
Share of the lunch rush
What share of all 5 lakh orders came in the 13 and 14 o'clock hours?
13 → 56,026 · 14 → 62,213
23.6%
Show solution and explanation
print(f"{(56026 + 62213) / 500000:.1%}")How it works: 23.6% of orders in two of the thirteen opening hours.
Retired or not
Count how many of these are retired or dormant: Sqoop, Hive, Oozie, Flume, HBase, Sentry.
status table
4
Show solution and explanation
gone = {"Sqoop", "Oozie", "Flume", "Sentry"}
print(len(gone & {"Sqoop", "Hive", "Oozie", "Flume", "HBase", "Sentry"}))How it works: 4 of 6. Hive and HBase are active.
Layer sorter
Assign each project to its layer.
8 projects
HDFS storage Iceberg tables YARN resources Spark engine Trino SQL Kafka ingestion ZooKeeper coordination Ranger security
Show solution and explanation
layer = {"HDFS": "storage", "Iceberg": "tables", "YARN": "resources", "Spark": "engine",
"Trino": "SQL", "Kafka": "ingestion", "ZooKeeper": "coordination", "Ranger": "security"}
for p, l in layer.items():
print(f"{p:10} {l}")How it works: The same layers as the architecture diagram.
Combiner savings
5 lakh rows, 8 items, 3 tasks. How many records cross the shuffle with and without partial aggregation?
500,000 rows · 8 keys · 3 tasks
without: 500000 with partial aggregation: 24
Show solution and explanation
rows, keys, tasks = 500_000, 8, 3
print("without:", rows, "with partial aggregation:", keys * tasks)How it works: 500,000 vs at most 24: why the plan aggregates before the Exchange.
Which engine?
Match: nightly 2 TB batch, ad-hoc analyst SQL in seconds, per-second event stream.
3 workloads
nightly 2 TB batch -> Spark (or Hive on Tez) ad-hoc SQL in seconds -> Trino / Impala per-second event stream -> Flink or Spark Structured Streaming via Kafka
Show solution and explanation
m = {"nightly 2 TB batch": "Spark (or Hive on Tez)", "ad-hoc SQL in seconds": "Trino / Impala",
"per-second event stream": "Flink or Spark Structured Streaming via Kafka"}
for k, v in m.items():
print(f"{k:24} -> {v}")How it works: One cluster often runs all three on YARN or alongside it.
Cost of a retired tool
A retired tool gets no security fixes. If an incident costs ₹50 lakh with a 5% yearly chance, and migration costs ₹12 lakh once, how many years until migration pays off?
₹50 lakh × 5% vs ₹12 lakh
4.8 years
Show solution and explanation
risk_per_year = 50 * 0.05
print(f"{12 / risk_per_year:.1f} years")How it works: About 4.8 years on risk alone (illustrative); add support and hiring costs and it pays off sooner.
Mini metastore
Build a dict-based metastore with create, describe and drop; EXTERNAL drop keeps files, MANAGED drop deletes them.
2 tables
tables: {} files left: {'/data/orders.csv'}Show solution and explanation
files = {"/data/orders.csv", "/warehouse/menu"}
ms = {"orders": ("EXTERNAL", "/data/orders.csv"), "menu": ("MANAGED", "/warehouse/menu")}
def drop(t):
kind, loc = ms.pop(t)
if kind == "MANAGED":
files.discard(loc)
drop("orders"); drop("menu")
print("tables:", ms, "files left:", files)How it works: Only the external table's file survives, the same rule Hive and Spark follow.
Real-world scenario questions (asked in company interviews)
Ecosystem questions test whether you know what each tool is for, and what is current.
“Draw the Hadoop ecosystem”
A whiteboard question in most big-data interviews.
The interviewer is checking: layers and one purpose per tool.
Show a strong answer
- Bottom: HDFS (or object storage); middle: YARN; top: engines (MapReduce, Tez, Spark) and SQL (Hive, Trino).
- Side services: HBase for key lookups, ZooKeeper for coordination, Kafka for ingestion, Airflow for scheduling, Ranger for security.
- Mention what changed: Sqoop and Oozie retired; Iceberg-style table formats are now common.
“Hive or HBase for our customer 360 view?”
The app needs one customer instantly; analysts need segments over all customers.
The interviewer is checking: access patterns.
Show a strong answer
- Point reads by key with low latency → HBase (row key design, avoid hot spots).
- Scans and aggregations → Parquet/Iceberg tables queried with Hive, Spark or Trino.
- Feed both from the same pipeline; don't force one store to do both jobs.
Your cluster still runs Sqoop and Oozie
Both are retired. The manager asks what to do and how risky it is.
The interviewer is checking: awareness and a safe plan.
Show a strong answer
- Retired means no releases or security fixes; vendors may still ship them for a while, but plan to leave.
- Sqoop → Spark JDBC or CDC into Kafka; Oozie → Airflow DAGs calling the same jobs.
- Migrate in waves with side-by-side runs and output comparison; retire the old ones last.
“Does Hive still use MapReduce?”
A follow-up after you mention Hive.
The interviewer is checking: engines vs SQL layer.
Show a strong answer
- Hive is a SQL layer; the execution engine is pluggable. Hive 4 encourages Tez; MapReduce was the original engine.
- Whatever the engine, a GROUP BY becomes partial aggregation, a shuffle by key and a final aggregation.
- Spark SQL showed exactly this in our EXPLAIN output.