How sun-9545sunoj/streaming-lakehouse-with-cdc-iceberg works
This repository demonstrates a Kafka-to-Iceberg CDC lakehouse and evaluates its behavior through three experiments. The main runtime flow generates keyed order events, streams them through Spark into an Iceberg table on HDFS, and exposes that table to ClickHouse for queries. Separate experiment branches measure file-planning and compaction, compare copy-on-write with merge-on-read, and test recovery after driver failures. Maintenance and verification support table operations and correctness checks. Edges reflect the sampled source and README; experiment internals not sampled are represented only at their documented harness level.
Main entry points: ingest_kafka.py Kafka ingestion · spark_session.py Spark session builder · query_clickhouse.py ClickHouse query · verify.py Correctness verifier
Components 19
CDC generation
- File CDC producer
src/producer.py - Bulk generator
src/generate_bulk.py - Kafka CDC producer
src/producer_kafka.py - Kafka topic
Ingestion and storage
- File ingestion
src/ingest.py - Kafka ingestion
src/ingest_kafka.py - Small-file ingestion
src/ingest_p2.py - Spark session builder
src/spark_session.py - HDFS storage
- Iceberg table
Table operations
- Iceberg maintenance
src/maintain.py - Trial reset
src/reset_e3.py - Correctness verifier
src/verify.py
Evaluation and query
- Planning experiment
bench/e1_planning.py - COW/MOR experiment
bench/e2_cow_mor.py - Failure experiment
bench/e3_chaos.sh - ClickHouse query
src/query_clickhouse.py - ClickHouse
Other components
- Operator
Connections 22
- Operator → Kafka CDC producer: starts
README.md - Kafka CDC producer → Kafka topic: publishes events
src/producer_kafka.py - Kafka topic → Kafka ingestion: streams events
src/ingest_kafka.py - Kafka ingestion → Spark session builder: builds session
src/ingest_kafka.py - Kafka ingestion → Iceberg table: merges batches
src/ingest_kafka.py - File ingestion → HDFS storage: reads CDC files
src/ingest.py - File ingestion → Iceberg table: merges batches
src/ingest.py - Small-file ingestion → Iceberg table: merges batches
src/ingest_p2.py - Kafka ingestion → HDFS storage: checkpoints stream
src/ingest_kafka.py - Iceberg maintenance → Spark session builder: builds session
src/maintain.py - Iceberg maintenance → Iceberg table: runs procedures
src/maintain.py - Correctness verifier → Spark session builder: builds session
src/verify.py - Correctness verifier → Iceberg table: checks table
src/verify.py - Trial reset → Spark session builder: builds session
src/reset_e3.py - Trial reset → Iceberg table: drops table
src/reset_e3.py - Operator → Planning experiment: runs
README.md - Operator → COW/MOR experiment: runs
README.md - Operator → Failure experiment: runs
README.md - Failure experiment → Correctness verifier: uses verifier
README.md - Operator → ClickHouse query: runs
README.md - ClickHouse query → ClickHouse: queries table
src/query_clickhouse.py - ClickHouse query → HDFS storage: reads Iceberg
src/query_clickhouse.py