Skip to main content
What this does: Creates a complete pipeline from a Kafka topic through a materialized view to low-latency query serving. When to use this: You have event data in Kafka and need agents or applications to query continuously computed aggregates at low latency.

Setup

1. Create a Kafka source

2. Create a materialized view

3. Query the results

4. Deliver results downstream (optional)

Key points

  • The WATERMARK declaration on the source is required for TUMBLE/HOP window aggregations to emit results
  • Without EMIT ON WINDOW CLOSE, the MV emits results incrementally as data arrives (default behavior)
  • scan.startup.mode = 'earliest' replays all historical Kafka data on first run; use 'latest' to start from now
  • The materialized view is incrementally updated — only changed rows are recomputed when new Kafka messages arrive

Next steps