Create windowed aggregations in ksqlDB with TUMBLING, HOPPING, and SESSION windows

domain: docs.confluent.io · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Start from an existing ksqlDB stream.
  2. For a tumbling window: CREATE TABLE result AS SELECT key, COUNT(*) FROM stream WINDOW TUMBLING (SIZE 1 HOUR) GROUP BY key EMIT CHANGES.
  3. For a hopping window: use WINDOW HOPPING (SIZE 1 HOUR, ADVANCE BY 10 MINUTES) to create overlapping windows.
  4. For a session window: use WINDOW SESSION (30 MINUTES) to group records with gaps smaller than 30 minutes into the same session.
  5. Query the resulting windowed table with a pull query specifying the key and optionally the window bounds using WINDOWSTART and WINDOWEND.
  6. Set retention with RETENTION clause or adjust the backing topic's retention to control how long historical windows are queryable.

Known gotchas

Related routes

Write Flink SQL tumbling, hopping, and session window aggregations
nightlies.apache.org/flink · 6 steps · unrated
Implement Kafka Streams windowed aggregations with grace period configuration
kafka.apache.org · 6 steps · unrated
Configure Cube pre-aggregation partitioning with updateWindow for incremental time-range refreshes
cube.dev · 5 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans