feat(native): Pass partition-enforced field IDs to the Velox split (#28667) #28667
<!-- 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
@sourcery-ai review on the pull request.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.@sourcery-ai anywhere in the pullrequest 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.@sourcery-ai summary anywhere inthe 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.
@sourcery-ai guide on the pullrequest to (re-)generate the reviewer's guide at any time.
@sourcery-ai resolve on thepull request to resolve all Sourcery comments. Useful if you've already
addressed all the comments and don't want to see them anymore.
@sourcery-ai dismiss on the pullrequest 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:
summary, the reviewer's guide, and others.
Getting Help
</details>
<!-- Generated by sourcery-ai[bot]: end review_guide -->
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.
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.
aditi-pandit
apurva-meta
Summary:
Adds
partitionEnforcedFieldIdsto the Iceberg split protocol and copies it intoHiveIcebergSplit, so the coordinator can tell the native reader which filterseach 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 acoordinator that does not send it decode with an empty list and every filter
is evaluated.
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:
Enhancements:
Tests: