Skip to content

docs: doc the requirement for ParquetHandler to do type widening - #3313

Open
dengsh12 wants to merge 2 commits into
delta-io:mainfrom
dengsh12:docs/parquet-reader-type-widening
Open

docs: doc the requirement for ParquetHandler to do type widening#3313
dengsh12 wants to merge 2 commits into
delta-io:mainfrom
dengsh12:docs/parquet-reader-type-widening

Conversation

@dengsh12

@dengsh12 dengsh12 commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

What changes are proposed in this pull request?

doc the type widening expectation for ParquetHandler impl
resolves #1612

How was this change tested?

doc only

@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.34%. Comparing base (e315ecf) to head (6aa9c47).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3313   +/-   ##
=======================================
  Coverage   90.34%   90.34%           
=======================================
  Files         250      250           
  Lines       89131    89131           
  Branches    89131    89131           
=======================================
  Hits        80524    80524           
  Misses       5672     5672           
  Partials     2935     2935           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nicklan nicklan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Comment thread kernel/src/lib.rs
Comment on lines +807 to +808
/// truncated). The default engine does this via `arrow::compute::cast` while reordering columns
/// to the requested schema.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
/// truncated). The default engine does this via `arrow::compute::cast` while reordering columns
/// to the requested schema.
/// truncated). The default engine does this via `arrow::compute::cast`.

@dengsh12
dengsh12 marked this pull request as ready for review September 12, 2026 00:06
Comment thread kernel/src/lib.rs
Comment on lines +795 to +798
/// When `physical_schema` requests a type different from the matched Parquet column, the reader
/// must coerce it to the requested type when the conversion is allowed by the [Delta protocol
/// type widening rules]. Examples include `INTEGER` -> `LONG`, `FLOAT` -> `DOUBLE`, and `DATE`
/// -> `TIMESTAMP_NTZ`. See the protocol for the complete list.

@dengsh12 dengsh12 Sep 12, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DefaultEngine does this, but some engine has not implemented this -- will inform them

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Review (draft - human review required)

Show review

No blocking issues. This is a docs-only change to the ParquetHandler coercion contract. The protocol reviewer verified the type-widening examples (INTEGER -> LONG, FLOAT -> DOUBLE, DATE -> TIMESTAMP_NTZ) against PROTOCOL.md, and the docs reviewer confirmed each example and the INT32 -> DATE / INT64 -> TIMESTAMP/TIMESTAMP_NTZ checkpoint conversions map to real branches in check_cast_compat in kernel/src/engine/ensure_data_types.rs. The DATE -> TIMESTAMP_NTZ example correctly excludes the timezone-bearing TIMESTAMP variant, and the microsecond normalization text matches the protocol.

Summary

The documentation accurately reflects both the Delta protocol and the default engine's coercion behavior, and the change is safe to merge. Coverage note: the maintainer-codex, delta-protocol, and docs reviewers completed and reached quorum; the maintainer-claude reviewer did not return within the review window, so its pass is not reflected here.


Automated review - workflow run

Comment thread kernel/src/lib.rs
/// requested schema.
/// When `physical_schema` requests a type different from the matched Parquet column, the reader
/// must coerce it to the requested type when the conversion is allowed by the [Delta protocol
/// type widening rules]. Examples include `INTEGER` -> `LONG`, `FLOAT` -> `DOUBLE`, and `DATE`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit1 The examples INTEGER -> LONG, FLOAT -> DOUBLE, and DATE -> TIMESTAMP_NTZ sit directly under the type widening rules link, while the next paragraph lists INT32 -> DATE and INT64 -> TIMESTAMP/TIMESTAMP_NTZ as extra Kernel requirements. A reader could infer these coercions are gated on the type-widening table feature rather than being reader-side coercions needed to materialize the requested physical_schema. Raised by: maintainer-codex-reviewer. Suggested fix: add a short clause noting these coercions are required whenever physical_schema asks for a compatible type and are not conditional on the type-widening feature being enabled.

@github-actions

Copy link
Copy Markdown

Benchmark results: ✅ Pass

Summary: 🚀 0  ·  ✅ 3  ·  ☑️ 2  ·  🚧 10  ·  ❌ 0

Per-benchmark results (15 rows)
Test Change Base PR
clustered/readMetadataLatestPredicate/serial ✅ 1.00x 94.6±2.28ms 94.8±2.36ms
crcLatest/snapshotLatest 🚧 1.04x slower 9.5±0.44ms 9.9±0.29ms
crcMissing/snapshotLatest 🚧 1.04x slower 23.1±0.70ms 24.1±1.08ms
crcSlightlyStale/snapshotLatest ☑️ 1.01x slower 10.6±0.36ms 10.7±0.32ms
crcVeryStale/snapshotLatest 🚧 1.04x slower 15.8±0.41ms 16.4±0.53ms
partitioned/readMetadataLatestPredicate/serial 🚧 1.06x slower 53.8±1.67ms 56.8±2.63ms
v1Checkpoint/readMetadataLatest/serial 🚧 1.04x slower 11.9±0.23ms 12.4±0.58ms
v1Checkpoint/snapshotLatest 🚧 1.10x slower 766.9±33.30µs 843.5±24.47µs
v2Checkpoint/readMetadataLatest/parallel2 ☑️ 1.01x slower 8.6±0.44ms 8.7±0.47ms
v2Checkpoint/readMetadataLatest/serial ✅ 1.00x 13.8±0.27ms 13.8±0.33ms
v2Checkpoint/snapshotLatest 🚧 1.09x slower 756.6±37.03µs 826.7±26.66µs
wideSchemaJsonStats/readMetadataLatestPredicate/serial ✅ 1.01x faster 72.0±1.25ms 71.3±1.01ms
wideSchemaJsonStats/snapshotLatest 🚧 1.05x slower 2.2±0.06ms 2.3±0.05ms
wideSchemaStructStats/readMetadataLatestPredicate/serial 🚧 1.04x slower 31.2±0.93ms 32.3±0.96ms
wideSchemaStructStats/snapshotLatest 🚧 1.05x slower 2.1±0.04ms 2.2±0.07ms

Legend: 🚀 ≥1.15x faster  · ✅ faster or unchanged  · ☑️ ≤1.03x slower  · 🚧 1.03x-1.15x slower  · ❌ ≥1.15x slower
Commit: 6aa9c47 · Trigger: auto-push · Tags: base · Updated: 2026-09-11 17:16 PDT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document type widening requirements for parquet readers

3 participants