Skip to content

API: Avoid invalid identity projection of transform predicates - #18160

Open
sankalpsthakur wants to merge 1 commit into
apache:mainfrom
sankalpsthakur:cursor/identity-projection-transform-15502-721f
Open

sankalpsthakur wants to merge 1 commit into
apache:mainfrom
sankalpsthakur:cursor/identity-projection-transform-15502-721f

Conversation

@sankalpsthakur

Copy link
Copy Markdown

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 throws ValidationException during scan planning, so queries fail instead of scanning the matching files.

This follows the existing BoundTransform handling in Bucket, Truncate, and TimeTransform: project only when the bound transform is identity, otherwise return null so inclusive projection falls back to alwaysTrue and strict projection to alwaysFalse. Non-reference terms such as BoundExtract are 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

  • Model: Cursor Grok 4.6
  • Platform/Tool: Cursor
  • Human Oversight: fully reviewed
  • Prompt Summary: Find one high-priority Apache Iceberg issue, implement a small fix on the sankalpsthakur/iceberg fork, and open a PR to apache/iceberg.

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>
@github-actions github-actions Bot added the API label Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ValidationException when filtering identity-partitioned timestamp field using other transforms

2 participants