API: Avoid invalid identity projection of transform predicates - #18160
Open
sankalpsthakur wants to merge 1 commit into
Open
sankalpsthakur wants to merge 1 commit into
sankalpsthakur wants to merge 1 commit into
Conversation
Identity.projectStrict copied transform predicate literals onto the identity partition field. Filters like hours(ts) = 490674 then failed with ValidationException during scan planning. Use the existing BoundTransform projection helper and skip non-reference terms so inclusive projection falls back to alwaysTrue. Closes apache#15502 Generated-by: Cursor Grok 4.6 Co-authored-by: Sankalp Thakur <sankalpsthakur@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #15502
Identity partition projection copied literals from transform predicates (for example
hours(ts) = 490674) onto the identity partition field. Binding that predicate to a timestamp partition type throwsValidationExceptionduring scan planning, so queries fail instead of scanning the matching files.This follows the existing
BoundTransformhandling inBucket,Truncate, andTimeTransform: project only when the bound transform is identity, otherwise return null so inclusive projection falls back toalwaysTrueand strict projection toalwaysFalse. Non-reference terms such asBoundExtractare also skipped.This revives the approach from #16074 / #17261 (approved, then stale-closed), using
ProjectionUtil.projectTransformPredicate.I have an ICLA on file with the Apache Software Foundation.
AI Disclosure