[Iceberg] Support nested column paths in keep/drop configuration#37516
[Iceberg] Support nested column paths in keep/drop configuration#37516PDGGK wants to merge 3 commits intoapache:masterfrom
Conversation
This change fixes the validation logic in IcebergScanConfig to support nested column paths using dot notation (e.g., "data.name"). Previously, the validation only checked top-level column names, causing nested paths like "colA.colB" to fail with "unknown field(s)" error. The fix uses Iceberg's Schema.findField() which natively resolves dot-notation paths for nested fields. Fixes apache#37486
Summary of ChangesHello @PDGGK, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Iceberg IO functionality by enabling users to specify nested column paths in the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
- Use TypeUtil.indexByName() to enumerate all field paths - Only select leaf fields to prevent parent struct from including dropped children - Add test for nested drop validation
|
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
|
The failing |
Summary
This PR enables support for nested column paths (dot notation) in both
keepanddropconfiguration for Iceberg IO column pruning.Problem:
Users cannot specify nested column paths like
keep: ["data.name"]ordrop: ["data.name"]- the validation fails with:Solution:
Schema.findField()which natively resolves dot-notation pathsTypeUtil.indexByName()to enumerate all field paths (including nested), then select only leaf fields to prevent parent structs from implicitly including dropped childrenChanges:
IcebergScanConfig.java:validate()method to usefindField()for nested path supportresolveSchema()drop logic to handle nested paths correctlyIcebergIOReadTest.java: Added test cases for nested column keep and dropFixes #37486
Test plan
testNestedColumnPruningValidation- verifies nested paths inkeepare acceptedtestNestedColumnDropValidation- verifies nested paths indropwork correctly🤖 Generated with Claude Code