Skip to content

[CALCITE-7691] The behavior of SESSION table functions is unspecified… - #5206

Open
Dwrite wants to merge 1 commit into
apache:mainfrom
Dwrite:CALCITE-7691
Open

[CALCITE-7691] The behavior of SESSION table functions is unspecified…#5206
Dwrite wants to merge 1 commit into
apache:mainfrom
Dwrite:CALCITE-7691

Conversation

@Dwrite

@Dwrite Dwrite commented Aug 22, 2026

Copy link
Copy Markdown

The behavior of SESSION table functions is unspecified for NULL timestamps

Jira Link
CALCITE-7691

Changes Proposed

The behavior of the SESSION table function was undefined when the timestamp
column contained NULL values: SessionizationEnumerator.initialize() called
requireNonNull on the watermark column, so any row with a NULL timestamp
caused a NullPointerException at runtime instead of a well-defined result.

This is a one-line change that makes rows with a NULL timestamp be silently
dropped from the session computation, rather than throwing. This matches the
behavior of most SQL aggregate functions, which ignore NULL inputs, and
avoids changing the (currently NOT NULL) return type of the window_start
and window_end columns.

A test case has been added to stream.iq covering a SESSION query whose
input contains a mix of NULL and non-NULL timestamps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant