- Redpanda provides Kafka-compatible ingestion.
- A local producer emits order lifecycle events.
- ClickHouse stores managed sources, deployment tables, and stable views.
- Ten SQL models exercise transforms, filters, aggregates, and one reference-style join.
This example enables
[settings] virtual_environments = true because it demonstrates backfill,
staged audit, and publish. For the default direct workflow, follow the
quickstart.Prerequisites
- Python 3.12 or newer
- Git
uv- Docker with Compose
curl
Get the project
From a StreamBuild source checkout:examples/orders_demo/:
Start the stack
tick: sent before
continuing. The producer writes to source.order_events.live. Local endpoints are:
The checked-in project target connects as
clickhouse / clickhouse and uses the orders_demo
database.
Inspect the graph
orders and order_cancellations independently consume the managed source. Non-aggregate models
preserve the four _replay_* lineage columns; aggregate models place replay predicates on their
inputs instead of projecting post-aggregate lineage.
orders feeds order_status_changes, order_items, region_lookup, and enriched_orders.
order_status_changes feeds avg_fulfillment_time; order_items feeds daily_revenue and
hourly_order_volume; and region_lookup is a side reference for enriched_orders.
order_cancellations feeds daily_cancellation_rates.
Run SQL tests
Plan and backfill
Preview the initial deployment:y. The result prints the generated deployment ID
and the exact audit and publish follow-up commands.
Audit the deployment
not_ready; publish does not enforce that advisory
result automatically.
Publish
tbl__* views now point to the selected deployment tables. Query one through ClickHouse:
Clean up
-v flag removes Redpanda, ClickHouse, and log volumes for a clean next run.
