Skip to content

fix: Iceberg parquet dereference pushdown for nested types - #28512

Merged
aditi-pandit merged 2 commits into
prestodb:masterfrom
aaneja:icebergDerefTWTZ
Sep 19, 2026
Merged

aditi-pandit merged 2 commits into
prestodb:masterfrom
aaneja:icebergDerefTWTZ

Conversation

@aaneja

@aaneja aaneja commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

was broken for TIMESTAMP_WITH_TIME_ZONE, TIME and UUID since we relied on toHiveType to read them. Hive does not support these data types, so parsing them was broken

Description

Fixes #28510

Motivation and Context

Impact

Test Plan

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.
  • If adding new dependencies, verified they have an OpenSSF Scorecard score of 5.0 or higher (or obtained explicit TSC approval for lower scores).
== RELEASE NOTES ==

Iceberg Connector Changes
* Fix Iceberg Parquet nested dereference pushdown for types that are unsupported or lossy in Hive

Summary by Sourcery

Fix Iceberg Parquet nested dereference pushdown for types that cannot be reliably represented by Hive.

Bug Fixes:

  • Fix Iceberg Parquet nested dereference pushdown for nested fields with TIMESTAMP WITH TIME ZONE, TIME, and UUID types.

Enhancements:

  • Resolve pushed-down nested field types directly from the Iceberg column's Presto row type, preserving types that Hive cannot represent or round-trip.

Tests:

  • Add coverage for nested dereference pushdown, predicate domains, and value reads involving types unsupported or lossy in Hive.

was broken for TIMESTAMP_WITH_TIME_ZONE, TIME and UUID
since we relied on toHiveType to read them. Hive does not support
these data types, so parsing them was broken
@prestodb-ci prestodb-ci added the from:IBM PR from IBM label Sep 18, 2026
@sourcery-ai

sourcery-ai Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Fix Iceberg Parquet nested dereference pushdown by resolving subfield types directly from Presto row types, preserving TIMESTAMP WITH TIME ZONE, TIME, and UUID instead of relying on lossy or unsupported Hive representations. Regression tests verify pushdown plans, exact synthesized types, and returned values.

Sequence diagram for Iceberg nested dereference type resolution

sequenceDiagram
    participant Optimizer as IcebergParquetDereferencePushDown
    participant Handle as IcebergColumnHandle
    participant RowType as PrestoRowType
    participant Synthesized as SynthesizedColumnHandle

    Optimizer->>Handle: getType()
    Handle-->>Optimizer: base RowType
    Optimizer->>RowType: getFields()
    RowType-->>Optimizer: matching nested field type
    Optimizer->>Synthesized: getSynthesizedIcebergColumnHandle(subfieldColumnName, pushdownColumnType, subfield)
    Synthesized-->>Optimizer: nested column handle preserving TIMESTAMP_WITH_TIME_ZONE, TIME, or UUID
Loading

File-Level Changes

Change Details Files
Resolve pushed-down nested field types directly from the Iceberg column's Presto RowType instead of converting through Hive types.
  • Traverse named row fields for each nested dereference path.
  • Reject unsupported path elements and invalid or missing nested fields with validation errors.
  • Remove Hive type conversion and the optimizer's TypeManager dependency.
  • Update both logical and physical optimizer construction to use the simplified constructor.
presto-iceberg/src/main/java/com/facebook/presto/iceberg/optimizer/IcebergParquetDereferencePushDown.java
presto-iceberg/src/main/java/com/facebook/presto/iceberg/optimizer/IcebergPlanOptimizerProvider.java
Add planner and value-level regression coverage for nested Parquet dereference pushdown involving types Hive cannot represent or round-trip.
  • Create a Parquet Iceberg table with nested TIMESTAMP WITH TIME ZONE, TIME, and UUID fields.
  • Verify dereference pushdown, synthesized subfield types, and round-tripped query values.
  • Add a plan matcher helper that inspects pushed-down Iceberg column types.
presto-iceberg/src/test/java/com/facebook/presto/iceberg/TestIcebergLogicalPlanner.java

Assessment against linked issues

Issue Objective Addressed Explanation
#28510 Fix Iceberg Parquet dereference pushdown so nested fields of rows containing TIMESTAMP WITH TIME ZONE do not fail with an unsupported Hive type error.
#28510 Resolve pushed-down nested field types directly from the Presto/Iceberg row type, preserving types that Hive cannot represent or round-trip, including TIMESTAMP WITH TIME ZONE, TIME, and UUID.
#28510 Add regression coverage verifying dereference pushdown, correct pushed-down types, and successful value reads for these non-Hive-compatible nested types.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@aaneja aaneja changed the title fix(iceberg): Iceberg parquet dereference pushdown for nested types fix: Iceberg parquet dereference pushdown for nested types Sep 18, 2026
@aaneja
aaneja marked this pull request as ready for review September 18, 2026 14:28
@aaneja
aaneja requested a review from amitkdutta September 18, 2026 14:28
@prestodb-ci
prestodb-ci requested review from a team and bibith4 and removed request for a team September 18, 2026 14:28
@aaneja
aaneja requested a review from aditi-pandit September 18, 2026 14:28

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@steveburnett

Copy link
Copy Markdown
Contributor

Thanks for the release note! Looks great.

@aditi-pandit aditi-pandit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aaneja. Looks good minus the comment on the tests.

…ZONE subfields

Add `WHERE x.b = TIMESTAMP ... UTC` and `WHERE x.c = TIME ...` variants to
testParquetDereferencePushDownWithTypesNotRepresentableInHive. Both assert the
filter lands on the synthesized subfield column as a single value domain.

The expected domain is keyed by the synthesized column handle, so TupleDomain
equality also pins the handle's Presto type. That makes the TIME case a
regression guard for the Hive round trip, which silently produced a BIGINT
handle instead of throwing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@aaneja
aaneja requested a review from aditi-pandit September 19, 2026 06:01

@aditi-pandit aditi-pandit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aaneja

@aditi-pandit
aditi-pandit merged commit 2dda933 into prestodb:master Sep 19, 2026
88 of 90 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

from:IBM PR from IBM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Iceberg dereference pushdown broken for TIMESTAMP WITH TIME ZONE

4 participants