You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: pass ColumnMappingMode to physical_name (#1403)
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines:
https://github.com/delta-incubator/delta-kernel-rs/blob/main/CONTRIBUTING.md
2. Run `cargo t --all-features --all-targets` to get started testing,
and run `cargo fmt`.
3. Ensure you have added or run the appropriate tests for your PR.
4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]
Your PR title ...'.
5. Be sure to keep the PR description updated to reflect all changes.
-->
Fixes#1120
<!--
PR title formatting:
This project uses conventional commits:
https://www.conventionalcommits.org/
Each PR corresponds to a commit on the `main` branch, with the title of
the PR (typically) being
used for the commit message on main. In order to ensure proper
formatting in the CHANGELOG please
ensure your PR title adheres to the conventional commit specification.
Examples:
- new feature PR: "feat: new API for snapshot.update()"
- bugfix PR: "fix: correctly apply DV in read-table example"
-->
## What changes are proposed in this pull request?
This PR makes StructField::physical_name() aware of ColumnMappingMode by
adding it as a required parameter.
Previously, physical_name() would always return the physical name from
metadata if present, regardless of the column mapping mode. This was
incorrect behavior - when column mapping mode is
None, the logical name should be used even if physical name metadata
exists in the field.
The key changes are:
1. Updated StructField::physical_name() to take column_mapping_mode:
ColumnMappingMode parameter
2. When mode is None, always return the logical name
3. When mode is Id or Name, return the physical name from metadata (or
logical name as fallback)
4. Added column_mapping_mode field to StateInfo struct to avoid
threading it through many function calls
5. Updated all call sites throughout the codebase to pass the column
mapping mode
6. Refactored AddRemoveDedupVisitor to accept Arc<StateInfo> instead of
8 individual parameters, following feedback to avoid excessive parameter
passing
<!--
Uncomment this section if there are any changes affecting public APIs:
### This PR affects the following public APIs
If there are breaking changes, please ensure the `breaking-changes`
label gets added by CI, and describe why the changes are needed.
Note that _new_ public APIs are not considered breaking.
-->
---------
Co-authored-by: Nick Lanham <[email protected]>
Co-authored-by: Zach Schuermann <[email protected]>
0 commit comments