← Back to Pull requests

feat(native): Pass partition-enforced field IDs to the Velox split (#28667) #28667

Closed
apurva-meta closed this pull request without merging on Oct 27, 2026 18:04 UTC
View on GitHub
apurva-meta apurva-meta commented on Oct 15, 2026 21:21 UTC
Author

Summary:

Adds partitionEnforcedFieldIds to the Iceberg split protocol and copies it into
HiveIcebergSplit, so the coordinator can tell the native reader which filters
each file's partition values already satisfy. The previous diff in this stack
makes the reader skip those filters.

The field is read only when present, like firstRowId, so splits from a
coordinator that does not send it decode with an empty list and every filter
is evaluated.

== NO RELEASE NOTE ==

Differential Revision: D125043600

Summary by Sourcery

Pass partition-enforced field IDs through Iceberg split handling so native readers can avoid re-evaluating filters already satisfied by partition values.

New Features:

  • Propagate partition-enforced field IDs from Iceberg split protocol messages to Velox Iceberg splits.
  • Enhancements:

  • Maintain backward-compatible decoding by treating the optional field as empty when it is absent.
  • Tests:

  • Add coverage for partition-enforced field ID propagation and optional protocol field round trips.
  • Diff: 125 lines (+106 / -19) across 6 files Reviewer: aditi-pandit Review duration: 17082m
    All Vouch review confidence checks passed
    Residual risk 0.06 = Change Risk (0.39) × (1 − Review Confidence (0.85)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 125 lines diff across 6 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.76 · 2 substantive comment(s)
    0.76
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    85%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.289
    Real PR Conversation Timeline
    5 items
    sourcery-ai[bot] sourcery-ai[bot] commented on Oct 15, 2026 21:22 UTC
    Bot

    <!-- Generated by sourcery-ai[bot]: start review_guide -->

    Reviewer's Guide

    This change adds backward-compatible Iceberg split metadata identifying partition-enforced fields, preserves it through JSON protocol encoding and decoding, and transfers it to the Velox split so native readers can skip filters already guaranteed by partition values; absent metadata defaults to an empty collection.

    Sequence diagram for partition-enforced Iceberg split propagation

    sequenceDiagram
        participant Coordinator
        participant Protocol as IcebergSplitProtocol
        participant Connector as IcebergPrestoToVeloxConnector
        participant Split as HiveIcebergSplit
        participant Reader as NativeReader
    
        Coordinator->>Protocol: serialize IcebergSplit.partitionEnforcedFieldIds
        Protocol-->>Connector: deserialize optional partitionEnforcedFieldIds
        Connector->>Split: construct HiveIcebergSplit
        Connector->>Split: insert partitionEnforcedFieldIds
        Split-->>Reader: provide enforced field IDs
        Reader->>Reader: skip filters for enforced fields
    

    File-Level Changes

    | Change | Details | Files |
    | ------ | ------- | ----- |
    | Extends the Iceberg split protocol with an optional list of partition-enforced field IDs and propagates it into the native Velox split. | <ul><li>Adds a default-initialized field to generated and primary Iceberg split structures.</li><li>Serializes the field as partitionEnforcedFieldIds and conditionally deserializes it for backward compatibility.</li><li>Copies the protocol list into the Velox split's unordered set during split conversion.</li><li>Adds coverage for propagation, legacy payload decoding, and serialization round trips.</li></ul> | presto-native-execution/presto_cpp/presto_protocol/connector/iceberg/presto_protocol_iceberg.h<br/>presto-native-execution/presto_cpp/presto_protocol/connector/iceberg/presto_protocol_iceberg.cpp<br/>presto-native-execution/presto_cpp/presto_protocol/connector/iceberg/special/IcebergSplit.hpp.inc<br/>presto-native-execution/presto_cpp/presto_protocol/connector/iceberg/special/IcebergSplit.cpp.inc<br/>presto-native-execution/presto_cpp/main/connectors/IcebergPrestoToVeloxConnector.cpp<br/>presto-native-execution/presto_cpp/main/types/tests/PrestoToVeloxConnectorTest.cpp |

    ---

    <details>
    <summary>Tips and commands</summary>

    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

  • [Contact our support team](mailto:support@sourcery.ai) for questions or feedback.

  • Visit our documentation for detailed guides and information.

  • Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
  • </details>

    <!-- Generated by sourcery-ai[bot]: end review_guide -->

    sourcery-ai[bot] sourcery-ai[bot] commented on Oct 15, 2026 21:25 UTC
    Reviewer

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

    ***

    <details>
    <summary>Sourcery is free for open source - if you like our reviews please consider sharing them ✨</summary>

  • X

  • Mastodon

  • LinkedIn

  • Facebook
  • </details>

    steveburnett steveburnett commented on Oct 16, 2026 13:49 UTC
    Contributor

    Please edit the PR title to follow semantic commit style to pass the failing and required CI check. See the failure in the test for advice.

    aditi-pandit aditi-pandit commented on Oct 16, 2026 17:44 UTC
    Reviewer

    Thanks @apurva-meta for this code.

    Do you have an e2e native test you can submit for this change ? Would really help to understand the use-case for this fix.

    Reviewers
    Assignees
    apurva-meta apurva-meta
    Labels
    risk: low confidence: 85.4% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.2% (MEDIUM) · Higher = larger blast radius
    39.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 85.4% · Lower = rushed or shallow review
    85.4%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 5.7% · Safe to merge
    5.7%