Skip to content

Promote column bounds to the current schema in the scan reader, alongside partition tuples #3501

Open

Description

@anoopj

Is your feature request related to a problem or challenge?

Follow-up to #3483 (comment: #3483 (comment)).

After a partition source column is promoted (e.g. int -> long), values written under the older, narrower schema must be widened to the current type before they compare against predicates and delete-file partitions. #3483 does this in two different places:

  • Partition tuples are widened once per entry in the scan reader
  • Column bounds (lower/upper) are still widened lazily inside InclusiveMetricsEvaluator, at comparison time.

Two widening paths for the same underlying schema-evolution concern is harder to reason about and easier to get subtly wrong, as @Fokko and @mbutrovich noted on the PR. Partition tuples had to move to the reader because comparison-time promotion did not fix equality-delete / deletion-vector matching; bounds have no such forcing function (the metrics evaluator promotes them correctly on demand), so they were left in place to contain scope of #3483.

Describe the solution you'd like

Project column bounds to the current schema in the same per-entry loop that already normalizes partition tuples, so there is a single promotion point and the evaluators can drop their on-the-fly promotion

Scope: read/scan path only; no format or on-disk changes. Existing coverage in #3483 (partition widening + delete matching) should continue to pass unchanged; add bounds-pruning cases where a promoted column's bounds decide a file.

Willingness to contribute

I can contribute to this feature independently

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions