Session windowing on streaming mode don't emit on window close · Issue #20834 · risingwavelabs/risingwave · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using session window with emit on window mode is having keeping session open without closing them.
Source: Kafka
Materialized view emit on window mode.
Error message/log
To Reproduce
Table definition:
CREATE table events (
*,
WATERMARK FOR "requestedAt" AS "requestedAt" - INTERVAL '5 SECONDS'
)
APPEND ONLY
INCLUDE timestamp as kafka_timestamp
WITH (
connector='kafka',
topic='whatever.topic.name'
);
Materialized view:
CREATE MATERIALIZED VIEW session_window_mv
AS SELECT
"customerId",
"requestedAt",
first_value("requestedAt") OVER (
PARTITION BY "customerId" ORDER BY "requestedAt" ASC
SESSION WITH GAP INTERVAL '5 SECONDS'
) AS first_event_time,
last_value("requestedAt") OVER (
PARTITION BY "customerId" ORDER BY "requestedAt" ASC
SESSION WITH GAP INTERVAL '5 SECONDS'
) AS last_event_time
FROM events
EMIT ON WINDOW CLOSE;
MV results (filtering on customer for specificity):
SELECT * FROM pricing_data_session_mv WHERE "customerId" = 'ABCD' ORDER BY last_event_time DESC;
customerId | requestedAt | first_event_time | last_event_time
---------------------+-------------------------------+-------------------------------+-------------------------------
ABCD | 2025-03-11 06:57:32.152+00:00 | 2025-03-11 06:57:32.152+00:00 | 2025-03-11 06:57:32.152+00:00
ABCD | 2025-03-11 03:17:03.384+00:00 | 2025-03-11 03:17:03.384+00:00 | 2025-03-11 03:17:05.430+00:00
Expected behavior
SELECT
"customerId",
"requestedAt",
first_value("requestedAt") OVER (
PARTITION BY "customerId" ORDER BY "requestedAt"
SESSION WITH GAP INTERVAL '5 SECONDS'
) AS first_event_time,
last_value("requestedAt") OVER (
PARTITION BY "customerId" ORDER BY "requestedAt"
SESSION WITH GAP INTERVAL '5 SECONDS'
) AS last_event_time
FROM events
WHERE "customerId" = 'ABCD'
ORDER BY last_event_time DESC;
customerId | requestedAt | first_event_time | last_event_time
---------------------+-------------------------------+-------------------------------+-------------------------------
ABCD | 2025-03-11 07:06:24.452+00:00 | 2025-03-11 07:06:24.452+00:00 | 2025-03-11 07:06:24.452+00:00
ABCD | 2025-03-11 06:58:27.694+00:00 | 2025-03-11 06:58:27.694+00:00 | 2025-03-11 06:58:27.694+00:00
ABCD | 2025-03-11 06:57:32.152+00:00 | 2025-03-11 06:57:32.152+00:00 | 2025-03-11 06:57:32.152+00:00
ABCD | 2025-03-11 03:17:03.384+00:00 | 2025-03-11 03:17:03.384+00:00 | 2025-03-11 03:17:05.430+00:00
How did you deploy RisingWave?
helm on eks
The version of RisingWave
version
--------------------------------------------------------------------------------
PostgreSQL 13.14.0-RisingWave-2.2.1 (3bbe7ed3142c758e6c07dffddebd8f7a3bd3318d)
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
Using session window with emit on window mode is having keeping session open without closing them.
Source: Kafka
Materialized view emit on window mode.
Error message/log
To Reproduce
Table definition:
Materialized view:
Table (filtering on customer for specificity:
MV results (filtering on customer for specificity):
Expected behavior
How did you deploy RisingWave?
helm on eks
The version of RisingWave
Additional context
No response
The text was updated successfully, but these errors were encountered: