Skip to content

Fix filters on TIMESTAMP_TO_MILLIS over TIME_FLOOR.#17871

Merged
gianm merged 3 commits intoapache:masterfrom
gianm:fix-floor-time-millis
Apr 28, 2025
Merged

Fix filters on TIMESTAMP_TO_MILLIS over TIME_FLOOR.#17871
gianm merged 3 commits intoapache:masterfrom
gianm:fix-floor-time-millis

Conversation

@gianm
Copy link
Contributor

@gianm gianm commented Apr 3, 2025

It is possible for toQueryGranularity to return nonnull for BIGINT rhs, in the case where the time floor expression is wrapped in TIMESTAMP_TO_MILLIS. Prior to this patch, that would throw an (incorrect) error about expecting a literal.

This patch fixes the defensive error to have the correct message (in Calcites) and also fixes the filter translation code to not hit that defensive check (in Expressions).

It is possible for toQueryGranularity to return nonnull for BIGINT rhs,
in the case where the time floor expression is wrapped in
TIMESTAMP_TO_MILLIS. Prior to this patch, that would throw an (incorrect)
error about expecting a literal.

This patch fixes the defensive error to have the correct message
(in Calcites) and also fixes the filter translation code to not hit that
defensive check (in Expressions).
@gianm gianm merged commit 2c46787 into apache:master Apr 28, 2025
76 checks passed
@capistrant capistrant added this to the 34.0.0 milestone Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants