Skip to content

Fix filters on TIMESTAMP_TO_MILLIS over TIME_FLOOR. #17871

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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).
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.

1 participant