Repository navigation
[Data][Delta DSv2 features][3/5] Read column-mapped Delta tables (id mode) on DataSource V2 - #68506
Draft
abhishekverma-ray wants to merge 1 commit into
Conversation
abhishekverma-ray
force-pushed
the
abhishek/delta-features-2-column-mapping-name
branch
from
November 25, 2026 02:54
8848581 to
ee5cc6f
Compare
abhishekverma-ray
force-pushed
the
abhishek/delta-features-3-column-mapping-id
branch
from
November 25, 2026 02:54
4654e81 to
e88a583
Compare
In the id mode of Delta column mapping, a data file's columns are matched to the table's columns by their Parquet field ids, not their names: after a rename, a file can use names that differ from the log's physical names. DeltaColumnMapping now names columns per data file. In the id mode it reads the file's own schema (which the scan opens anyway), matches each table column, nested fields included, to the file column whose PARQUET:field_id equals the log's delta.columnMapping.id, and scans and renames by those names. A column the file doesn't have keeps its physical name, which the file doesn't use either, so the scan fills it with nulls. The name mode is unchanged. The log keys statistics by physical name in both modes, so log-statistics skipping is unchanged. The footer reads get the filter in physical names; a file whose names differ keeps all its row groups there, which is safe. check_delta_table_is_readable now accepts both modes; only an unknown mode raises. The V1 reader still raises for column mapping. The mapped-table tests run in both modes. In the id mode the helper writes files whose column names differ from the log's physical names, so only the field ids match; the reads fail without the id matching. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Abhishek Verma <[email protected]>
abhishekverma-ray
force-pushed
the
abhishek/delta-features-2-column-mapping-name
branch
from
November 26, 2026 03:34
ee5cc6f to
56f7081
Compare
abhishekverma-ray
force-pushed
the
abhishek/delta-features-3-column-mapping-id
branch
from
November 26, 2026 03:34
e88a583 to
78aa4f3
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Delta DataSourceV2 reader now reads tables with column mapping in the
idmode, where a data file's columns are matched to the table's columns by their Parquet field ids, not their names. After a rename, a file can use names that differ from the log's physical names. Completes #64854 for the V2 reader, on top of thenamemode (#68505).Before
read_deltaraisedNotImplementedErrorfor theidmode.After
DeltaColumnMappingnames columns per data file. In theidmode it reads the file's own schema, which the scan opens anyway. It matches each table column, nested fields included, to the file column whosePARQUET:field_idequals the log'sdelta.columnMapping.id, then scans and renames by those names.namemode is unchanged.check_delta_table_is_readableaccepts both modes; only an unknown mode raises. The V1 reader still raises for column mapping.flowchart TD subgraph Before subgraph BS[Subsystem: IO] subgraph BC[Component: DeltaFileReader] B1["names from the log's physical names"] end end end subgraph After subgraph AS[Subsystem: IO] subgraph AC[Component: DeltaFileReader] A0{"mode"} -->|name| A1["names from the log's physical names"] A0 -->|id| A2["names from the file's Parquet field ids"] end end end classDef added fill:#c8e6c9,stroke:#2e7d32,color:#000 class A2 addedSubsystems
IO (
formats/delta/delta_column_mapping.py,delta_scanner.py); docs in theread_deltadocstring.Not a duplicate
Issue #64854 asks for column mapping; no open PR implements it.
Testing
Local: pyenv with deltalake 1.5.0 and pyarrow 23.
pytestovertest_delta.py,test_delta_v2.py, the Delta unit tests andtest_pickle_gate_coverage.py: 363 passed.idmode,write_mapped_tablewrites files whose column names differ from the log's physical names, so only the field ids match. All fiveid-mode read cases fail without the field-id matching.test_delta_read_column_mapping: V2 reads both modes; V1 raises.AI assistance was used (Claude Code); every line has been reviewed by the submitter.
🤖 Generated with Claude Code