From 46b080abdd236fe217f6a69c38078f762748d1b4 Mon Sep 17 00:00:00 2001 From: javier Date: Thu, 29 Oct 2026 17:37:05 +0100 Subject: [PATCH] Run the container with --rm and a relative mount, and describe COPY as table or query export --- 2026-10-questdb-parquet-three-readers/README.md | 14 ++++++++------ .../walkthrough.py | 6 +++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/2026-10-questdb-parquet-three-readers/README.md b/2026-10-questdb-parquet-three-readers/README.md index 4470477..94ccbf7 100644 --- a/2026-10-questdb-parquet-three-readers/README.md +++ b/2026-10-questdb-parquet-three-readers/README.md @@ -28,8 +28,8 @@ subscription, and no Java toolchain: QuestDB runs in Docker. ## Quick start ```bash -docker run -d --name qdb-parquet-readers -p 9000:9000 \ - -v "$PWD/qdb_root:/var/lib/questdb" questdb/questdb:10.1.0 +docker run --rm -d --name qdb-parquet-readers -p 9000:9000 \ + -v ./qdb_root:/var/lib/questdb questdb/questdb:10.1.0 python3 -m venv .venv source .venv/bin/activate @@ -90,9 +90,11 @@ These files belong to a live table. QuestDB rewrites them when late rows arrive, and it can replace one with a compacted copy in a new versioned directory, such as `2026-10-21.10` replacing `2026-10-21.4`. The old directory lingers until QuestDB purges it, so a glob over `2026-10-21.*` can briefly match -both. That's fine for exploring, but build pipelines on the `COPY` export in -`qdb_root/export/trades_export/`, or on QuestDB Enterprise cold storage, which -writes a stable, Hive-partitioned layout to object storage. +both. + +To get Parquet out of `qdb_root`, or Parquet for the result of a query rather +than a whole table, use `COPY`, which takes a table name or a query. The +walkthrough's export is in `qdb_root/export/trades_export/`. After a `--reset`, the dropped table's `trades~N` folder can also linger next to the new one. `SELECT directoryName FROM tables() WHERE table_name = 'trades'` @@ -101,7 +103,7 @@ names the current one. ## Clean up ```bash -docker rm -f qdb-parquet-readers +docker stop qdb-parquet-readers rm -rf qdb_root ``` diff --git a/2026-10-questdb-parquet-three-readers/walkthrough.py b/2026-10-questdb-parquet-three-readers/walkthrough.py index 90d0eee..8640d90 100644 --- a/2026-10-questdb-parquet-three-readers/walkthrough.py +++ b/2026-10-questdb-parquet-three-readers/walkthrough.py @@ -4,8 +4,8 @@ Every step prints what it did, and every check compares a reader against the DataFrame the script sent, so a mismatch stops the run. - docker run -d --name qdb-parquet-readers -p 9000:9000 \ - -v "$PWD/qdb_root:/var/lib/questdb" questdb/questdb:10.1.0 + docker run --rm -d --name qdb-parquet-readers -p 9000:9000 \ + -v ./qdb_root:/var/lib/questdb questdb/questdb:10.1.0 python walkthrough.py """ import argparse @@ -303,7 +303,7 @@ def daily_from_sql(): check("the replayed trade did not add a row", scalar(db, "SELECT count() FROM trades") == trades.height + 1) - step("8. A stable copy for tools outside QuestDB") + step("8. Export the table as Parquet with COPY") export_id = scalar(db, "COPY trades TO 'trades_export' WITH FORMAT PARQUET") export_dir = os.path.join(args.root, "export", "trades_export") wait_for(db, f"SELECT count() FROM sys.copy_export_log "