liveBook · Manning

Chapter 3: Hands-on with Apache Iceberg

What you will learn in chapter 3 of Architecting an Apache Iceberg Lakehouse

Introduces a hands-on chapter that will build a laptop-based Iceberg lakehouse and use it to create tables, run queries, and visualize results.

After this chapter you will be able to

What it builds on

Section by section

Introduction

Introduces a hands-on chapter that will build a laptop-based Iceberg lakehouse and use it to create tables, run queries, and visualize results.

3.1 Our example

Introduces a simplified fashion-retail example and traces its sales data from PostgreSQL through Iceberg tables to BI dashboards.

Key terms: PostgreSQL, Apache Spark, Apache Iceberg tables, Dremio, virtual views, Apache Superset dashboards, Nessie, ingestion architectures

3.2 Setting up an Apache Iceberg environment

Introduces the services and their roles in a local, end-to-end Iceberg lakehouse example.

Key terms: PostgreSQL, MinIO, Apache Spark, Nessie, Dremio, Apache Superset

3.2.1 Prerequisite: Installing Docker

This subsection establishes Docker Desktop as the prerequisite for running the hands-on services in containers and checking that it is installed.

Key terms: Docker Desktop, containers, Nessie, Apache Spark, Dremio

3.2.2 Creating the Docker Compose file

Defines a local Docker Compose lakehouse and explains how its catalog, storage, source database, processing engine, query engine, and BI tool connect.

Key terms: docker-compose.yml, lakehouse-net, port mapping, Project Nessie, in-memory storage backend, REST API, MinIO, S3-compatible API, PostgreSQL, operational data source

3.2.3 Running the environment

This section starts and verifies the Docker Compose lakehouse, then explains how its containers work together to ingest data and serve dashboards.

Key terms: Docker Compose, docker-compose.yml, running containers, Python script, Spark job, Postgres, Nessie, MinIO, catalog, Dremio

3.2.4 Accessing services

This section gives the local addresses and credentials for checking that the five lakehouse services are accessible.

Key terms: MinIO, Dremio, Spark, Jupyter Notebook, PostgreSQL, Superset

3.3 Creating Iceberg tables in Spark

Introduces the retail-sales data flow from PostgreSQL into Iceberg and explains how MinIO and Nessie support storage and shared access.

Key terms: PostgreSQL, Apache Spark, Apache Iceberg tables, transactional sources, MinIO, object-storage backend, Nessie Iceberg catalog

3.3.1 Populating the PostgreSQL database

This section prepares mock sales data in PostgreSQL as the source for later ingestion into Iceberg.

Key terms: PostgreSQL, Postgres shell, fashion_sales_data, Iceberg tables

3.3.2 Starting Apache Spark

This section prepares Spark’s notebook and MinIO storage, then shows how to find a reliable network address for connecting them.

Key terms: MinIO, warehouse, Jupyter Notebook, PySpark, Docker network, IPv4 address, MinIO container, Docker DNS

3.3.3 Configuring Apache Spark for Iceberg

This section configures a PySpark session to use Nessie as the Iceberg catalog and MinIO as its storage backend, then starts the session.

Key terms: CATALOG_URI, WAREHOUSE, STORAGE_URI, Nessie, MinIO, SparkConf, spark.jars.packages, Iceberg SparkCatalog, S3FileIO, SparkSession.builder.config(conf=conf).getOrCreate()

3.3.4 Loading data from PostgreSQL into Iceberg

This section shows how to load PostgreSQL sales data into an Iceberg table, with data files in MinIO and table metadata registered in Nessie.

Key terms: namespace, Iceberg catalogs, Nessie, sales_data, Spark DataFrame, Iceberg table, MinIO

3.3.5 Verifying data storage in MinIO

Shows how to verify in MinIO that Spark stored the ingested Iceberg table and how to identify its data and metadata files.

Key terms: MinIO, warehouse bucket, sales/sales_data_UUID/, Parquet, JSON, Avro

3.4 Reading Iceberg tables with Dremio

Introduces querying existing Iceberg tables with Dremio and explains how Iceberg metadata can make analytics on the data lake faster without duplicating data.

Key terms: Dremio, Apache Iceberg tables, standard SQL, data lake, metadata pruning, partition information, file-level statistics

3.4.1 Starting Dremio

This subsection shows how to open the running Dremio UI and explains what Dremio can do with data sources and Iceberg tables.

Key terms: Docker Compose, Dremio UI, admin account, data sources, SQL, federated queries, Nessie, lakehouse catalogs, Iceberg tables

3.4.2 Connecting Dremio to the Nessie catalog

Shows how to add Nessie as a Dremio source so Dremio can find and query Iceberg tables, using MinIO for storage in the exercise.

Key terms: Add Source, Nessie, Iceberg catalog, Nessie endpoint URL, Storage settings, AWS root path, fs.s3a.path.style.access, fs.s3a.endpoint, dremio.s3.compat, MinIO

3.4.3 Querying Iceberg tables in Dremio

This section uses Dremio to query an Iceberg sales table, explains how file metadata can speed up queries, and shows how snapshots support time travel.

Key terms: Dremio SQL Editor, sales data, Iceberg table, MinIO, metadata-driven pruning, per-file statistics, sales_amount, metadata tables, snapshots, snapshot IDs

3.5 Creating a BI dashboard from your Iceberg tables

Introduces the steps for creating a BI dashboard from Iceberg data using Dremio and Apache Superset.

3.5.1 Starting Apache Superset

This section introduces Apache Superset and explains how to start, initialize, and log in before connecting it to Dremio.

Key terms: Apache Superset, initialize, metadata tables, roles, BI tool, interactive dashboards, SQL-based data sources

3.5.2 Connecting Superset to Dremio

This subsection shows how to connect Superset to Dremio and notes the protocol and encryption setting used by the local connection.

Key terms: Database Connections, Other, Dremio URI, Test Connection, Arrow Flight, UseEncryption=true

3.5.3 Creating a dataset from Iceberg tables

Shows how to create a Superset dataset from an Iceberg table so it can be used in charts and dashboards.

Key terms: Create Dataset, Dremio, nessie.sales.fashion_sales, Iceberg table

3.5.4 Building charts and dashboards

Shows how to turn an Iceberg-backed Superset dataset into charts and a dashboard, then explains what the exercise demonstrates about consuming Iceberg data.

Key terms: fashion_sales, Line Chart, Pie Chart, sales_date, category, SUM(sales_amount), Sales by Day, Sales by Category, Sales Analytics, Save & Publish

3.6 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 2: Apache Iceberg and the lakehouse Chapter 4: Preparing for your move to Apache Iceberg →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.