Skip to content

add leaf reader conversion code - #3355

Draft
emkornfield wants to merge 17 commits into
delta-io:mainfrom
emkornfield:stack/leaf_reader
Draft

emkornfield wants to merge 17 commits into
delta-io:mainfrom
emkornfield:stack/leaf_reader

Conversation

@emkornfield

@emkornfield emkornfield commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

🥞 Stacked PR

Use this link to review incremental changes.


What changes are proposed in this pull request?

How was this change tested?

emkornfield and others added 17 commits September 17, 2026 22:23
Migrate branch code to upstream API changes pulled from main:
- Drop the removed `IntoEngineData` derive (unused here; conversions go
  through `struct_expr_from_schema`). Kept the test-only `IntoStructData`.
- Update test helpers for `create_many`'s owned `Vec<Vec<Scalar>>` signature.
- Construct `location`/`file_size_in_bytes` as required (non-Option) fields.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
…ta for both

Reconciles the concurrent builder.rs refactor with the content-tree read path
and returns FilteredEngineData from both AMT conversion functions for symmetry:
- convert_append_metadata_to_entry_batch -> FilteredEngineData (all rows selected)
- convert_root_entries_to_add_actions -> FilteredEngineData (live Data entries selected)

De-duplicates struct_expr_from_schema (shared in content_tree/mod.rs).

Co-authored-by: Isaac <no-reply@databricks.com>
The read-path WIP had flipped ContentTreeNodeEntry.location and
file_size_in_bytes to Option, but main's delta-io#3304 makes both required and the
schema contract test asserts non-nullable. Restore the required types and:
- Rework null_file_size_becomes_zero to inject the null via a nullable-size
  input schema at the batch level (the reader still coalesces null size -> 0).
- Update create_many test helpers for the owned Vec<Vec<Scalar>> signature.

Co-authored-by: Isaac <no-reply@databricks.com>
…n-dev

MODIFICATION_TIME_NAME and DATA_CHANGE_NAME are consumed only by the AMT
read path (content_tree::reader), which is gated on adaptive-metadata-in-dev.
The constants themselves were unconditional, so a default `cargo build`
triggered dead-code errors under -D warnings.

Co-authored-by: Isaac <no-reply@databricks.com>
Generalize the AMT content-tree builder from root-only to also produce
leaf-manifest `Data` entries via a private `ManifestKind` enum threaded
through a shared impl. Add `convert_append_metadata_to_leaf_entry_batch`
alongside the unchanged root entry point.

Leaf entries still write `snapshotId` but leave `sequenceNumber`,
`fileSequenceNumber`, and `firstRowId` null so they are inherited/assigned
from the parent manifest entry; the leaf required-non-null set drops to
`stats.numRecords` only. Tests are parameterized over root/leaf.

Co-authored-by: Isaac <no-reply@databricks.com>
Address PR review: instead of a `ManifestKind { Root, Leaf }` enum matched
in several places, capture the per-manifest-level differences (required
non-null columns + the sequenceNumber/firstRowId source expressions) in an
`AppendEntrySpec` struct with `root()`/`leaf()` constructors, consumed by a
single branch-free impl. Trim the module docstring to the high-level
description.

Apply the same data-driven pattern to tests: an `EntryPath { convert,
expected_versions }` struct (function pointers) drives the rstest cases in
place of matching on the enum.

Co-authored-by: Isaac <no-reply@databricks.com>
@github-actions

Copy link
Copy Markdown

PR title does not match the required pattern. Please ensure you follow the conventional commits spec.

Your title should start with feat:, fix:, chore:, docs:, perf:, refactor:, test:, or ci:, and if it's a breaking change that should be suffixed with a ! (like feat!:), and then a 1-72 character brief description of your change.

Title: add leaf reader conversion code

@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.73964% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.55%. Comparing base (c457674) to head (386e26c).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
kernel/src/content_tree/reader.rs 95.00% 7 Missing and 19 partials ⚠️
kernel/src/content_tree/builder.rs 96.47% 1 Missing and 9 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3355      +/-   ##
==========================================
+ Coverage   90.51%   90.55%   +0.04%     
==========================================
  Files         255      257       +2     
  Lines       91213    92081     +868     
  Branches    91213    92081     +868     
==========================================
+ Hits        82558    83387     +829     
- Misses       5642     5653      +11     
- Partials     3013     3041      +28     

☔ 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.

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.

1 participant