Skip to content

fix: minimise overflow on timestamp conversion#737

Open
bestbeforetoday wants to merge 1 commit intosubstrait-io:mainfrom
bestbeforetoday:date-time-conversion
Open

fix: minimise overflow on timestamp conversion#737
bestbeforetoday wants to merge 1 commit intosubstrait-io:mainfrom
bestbeforetoday:date-time-conversion

Conversation

@bestbeforetoday
Copy link
Member

When converting a Calcite timestamp to Substrait, we target microsecond precision. However, this is achieved by calculating entirely in nanoseconds and then narrowing to microseconds, introducing the possibility of overflow when dealing with timestamps beyond the year 2262.

This change targets microseconds directly when converting Calcite timestamp literals.

@bestbeforetoday bestbeforetoday marked this pull request as ready for review March 9, 2026 14:53
When converting a Calcite timestamp to Substrait, we target microsecond
precision. However, this is achieved by calculating entirely in
nanoseconds and then narrowing to microseconds, introducing the
possibility of overflow when dealing with timestamps beyond the year 2262.

This change targets microseconds directly when converting Calcite
timestamp literals.

Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
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