Skip to content

[vortex] Do not push nanosecond timestamp literals that overflow int64 - #9810

Open
jackylee-ch wants to merge 1 commit into
apache:masterfrom
jackylee-ch:vortex-ts-nanos-overflow
Open

jackylee-ch wants to merge 1 commit into
apache:masterfrom
jackylee-ch:vortex-ts-nanos-overflow

Conversation

@jackylee-ch

Copy link
Copy Markdown
Contributor

Purpose

For TIMESTAMP(7..9), toTimestampLiteral computes ts.getMillisecond() * 1_000_000 + ts.getNanoOfMillisecond(). A TIMESTAMP reaches year 9999, so a literal outside roughly [1677-09-21, 2262-04-11] overflows int64: 9999-12-31 00:00:00, a common open upper bound, becomes -4852202631933722624 ns — year 1816.

A wrapped bound turns >/>= into a superset the post-scan filter repairs, so only <, <= and = silently lose rows — hence unnoticed.

#9675 added the grain checks just above; this extends the same refuse-to-push contract to representability, returning null so the caller drops the leaf.

Tests

VortexPredicateConverterTest#testTimestampNanosOverflowingLiteralNotPushed. Reverting the fix:

expected: <null> but was: <dev.vortex.api.Expression@69c93ca4>

Written with Claude Code; verification is mine.

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