Repository navigation
[Data][Delta DSv2 features][5/5] Read type-widened Delta tables on DataSource V2 - #68508
Draft
abhishekverma-ray wants to merge 1 commit into
Draft
abhishekverma-ray wants to merge 1 commit into
abhishekverma-ray wants to merge 1 commit into
Conversation
abhishekverma-ray
force-pushed
the
abhishek/delta-features-5-type-widening
branch
from
November 25, 2026 02:54
171258d to
ab7bbc8
Compare
Delta's type widening lets a column's type grow (int to long, float to double, a decimal's precision and scale, date to timestamp_ntz, ...) without rewriting the files written before, which keep the narrow type. Databricks turns it on for some tables. read_delta raised for the typeWidening reader feature, and deltalake 1.6.6 can't query such tables. The DataSourceV2 reader needs no deltalake support for it: it reads the Parquet files itself and scans each with the table schema pinned, which casts an old file's narrow columns to the wider type. A filter on a column whose file type differs from the table type is already applied after that cast. deltalake opens these tables and parses their statistics in the wide types. So typeWidening and its preview name join the supported reader features. Tests write the log by hand, as Databricks does (the reader feature and each column's delta.typeChanges), with a first file in the narrow types and a second in the wide ones, and check the schema, the values and a filter on each widened column. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Abhishek Verma <[email protected]>
abhishekverma-ray
force-pushed
the
abhishek/delta-features-4-deletion-vectors
branch
from
November 26, 2026 03:34
18f3b8c to
efe962e
Compare
abhishekverma-ray
force-pushed
the
abhishek/delta-features-5-type-widening
branch
from
November 26, 2026 03:34
ab7bbc8 to
cf19ef8
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 type-widened tables. Delta's type widening lets a column's type grow (int to long, float to double, a decimal's precision and scale, date to timestamp_ntz, ...) without rewriting the files written before, which keep the narrow type.
Before
read_deltaraised for thetypeWideningreader feature.deltalake1.6.6 can't query these tables either.After
The V2 reader needs no
deltalakesupport for this:deltalakeopens these tables and parses their statistics in the wide types.So
typeWideningand its preview name join the supported reader features.flowchart TD subgraph Before subgraph BS[Subsystem: IO] B0["check_delta_table_is_readable"] -->|typeWidening| BX["NotImplementedError"] end end subgraph After subgraph AS[Subsystem: IO] A0["check_delta_table_is_readable: typeWidening supported"] --> A1["DeltaFileReader: scan with the table schema pinned (casts narrow files)"] end end classDef removed fill:#ffcdd2,stroke:#c62828,color:#000 classDef changed fill:#fff9c4,stroke:#f9a825,color:#000 class BX removed class A0 changedSubsystems
IO (
formats/delta/delta_datasource_v2.py); docs in theread_deltadocstring.Not a duplicate
No open PR adds type widening to
read_delta(searched open PRs for "delta type widening").Testing
Local: pyenv with deltalake 1.5.0 and pyarrow 23.
write_type_widened_tablewrites the log by hand, as Databricks does: the reader feature, and each column'sdelta.typeChanges. The first file is in the narrow types, the second in the wide ones.test_reads_type_widened_columnschecks the schema, the values, and a filter on each widened column: int to long, float to double, decimal(5,2) to decimal(10,4), date to timestamp_ntz.pytestovertest_delta.py,test_delta_v2.pyandtest_write_delta.py: 253 passed.tests/unit/datasource_v2/andtests/unit/datasource/: 1591 passed.AI assistance was used (Claude Code); every line has been reviewed by the submitter.
🤖 Generated with Claude Code