Setup
1. Create a Kafka source
2. Create a materialized view
3. Query the results
4. Deliver results downstream (optional)
Key points
- The
WATERMARKdeclaration on the source is required forTUMBLE/HOPwindow 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
- Subscription push recipe — push results to subscribers instead of polling
- Processing overview — full SQL streaming patterns