Description
We've found that the session_end function seems to be returning the same values as session_start. Furthermore, it seems that they may have the same implementation, though I'm not fully familiar with the code:
An example with Beam SQL:
0: BeamSQL> SELECT
SESSION_START(scores_stream.event_time, INTERVAL '1' SECOND),
SESSION_END(scores_stream.event_time, INTERVAL '1' SECOND),
scores_stream.team,
SUM(scores_stream.score),
COUNT
FROM
scores_stream
GROUP BY scores_stream.team,
SESSION(scores_stream.event_time, INTERVAL '1' SECOND) LIMIT 3;SELECT
. . . . . > SESSION_START(scores_stream.event_time, INTERVAL '1' SECOND),
. . . . . > SESSION_END(scores_stream.event_time, INTERVAL '1' SECOND),
. . . . . > scores_stream.team,
. . . . . > SUM(scores_stream.score),
. . . . . > COUNT
. . . . . > FROM
. . . . . > scores_stream
. . . . . > GROUP BY scores_stream.team,
. . . . . >
T 3; SESSION(scores_stream.event_time, INTERVAL '1' SECOND) LIMI
-----------------------------------------------
EXPR$0 | EXPR$1 | team | EXPR$3 | EXPR$4 |
-----------------------------------------------
2019-11-04 04:11:38 | 2019-11-04 04:11:38 | blue | 420 | 7 |
2019-11-04 04:11:38 | 2019-11-04 04:11:38 | red | 960 | 18 |
2019-11-04 04:11:42 | 2019-11-04 04:11:42 | blue | 452 | 11 |
-----------------------------------------------
3 rows selected (9.197 seconds)
0: BeamSQL>
Attachments
Issue Links
- duplicates
-
CALCITE-2645 SESSION_END() is transformed to RexInputRef, which is always equal to SESSION_START()
- Open