adriangb opened a new pull request, #23397:
URL: https://github.com/apache/datafusion/pull/23397

   ## Which issue does this PR close?
   
   - Related to https://github.com/apache/datafusion-comet/issues/4859. Second 
of a 3-PR stack: #23396 (refactor), this benchmark, and the feature PR (nested 
schema pruning for the parquet reader).
   
   ## Rationale for this change
   
   When a table's declared schema is narrower than a parquet file's nested 
column (logical `events: LIST<STRUCT<x, y>>` over a physical `LIST<STRUCT<x, y, 
+8 pads>>`), the reader currently fetches and decodes **every** leaf of the 
column and discards the extra subfields in memory via the adapter-inserted 
cast. This is how engines like Spark (via Comet) communicate nested projection 
pruning to the scan — as a clipped read schema — and it is where Comet measured 
reading 1.35 TB where Spark read 30.9 GB for the same pruned `ReadSchema`.
   
   This PR adds a benchmark that documents the current behavior as a checked-in 
baseline, independent of any fix:
   
   ```
   list_struct_narrow_schema:      bytes_scanned=25.19 MB   3.45 ms
   list_struct_full_schema:        bytes_scanned=25.19 MB   3.36 ms   <- narrow 
== full today
   list_struct_physically_narrow:  bytes_scanned= 3.32 KB    164 µs   <- the 
floor
   ```
   
   ## What changes are included in this PR?
   
   A criterion benchmark, 
`datafusion/core/benches/parquet_nested_schema_pruning.rs`, that registers the 
same wide `list<struct>` (and top-level struct) parquet file with both its full 
schema and a narrower declared schema, plus a physically-narrow file as the 
floor, and prints the scans' `bytes_scanned` at setup so the IO pattern is 
visible alongside wall time.
   
   ## Are these changes tested?
   
   It is a benchmark; it compiles under `cargo bench --no-run` and runs green.
   
   ## Are there any user-facing changes?
   
   No.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01KuMaRtFSPDQesuzjN5Koyd


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to