Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions 2026-10-questdb-parquet-three-readers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'`
Expand All @@ -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
```

Expand Down
6 changes: 3 additions & 3 deletions 2026-10-questdb-parquet-three-readers/walkthrough.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 "
Expand Down
Loading