suxiaogang223 opened a new pull request, #71337:
URL: https://github.com/apache/doris/pull/71337

   ### Background
   
   A shredded Parquet Variant stores selected fields in typed columns and the 
remaining values in residual columns. Doris can use the typed leaf's footer 
statistics and page index to skip data when its residual cannot supply a 
matching value.
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: #66413 (typed statistics guards), #66575 (deep leaf projection), 
#69016 (deep leaf projection backport)
   PR Type: Performance
   
   Problem Summary:
   
   Predicates on nested shredded fields miss row-group and page pruning when an 
ancestor residual contains sibling keys outside the predicate's path. Use the 
terminal residual to decide whether the typed leaf can supply all values for 
the predicate. Most of the diff adds metadata cases and a real-file reader test.
   
   ### Details
   
   - **Change map:** 26 changed lines in Parquet statistics (9 added, 17 
removed) and 276 in tests (233 added, 43 removed). The tests cover the metadata 
decision at both pruning levels and compare native reader output on a file with 
a populated ancestor residual.
   - **Why it was slow:** Both pruning paths required every residual along the 
path to be all NULL. A partially shredded object often keeps unrelated keys in 
an ancestor residual, making that requirement fail even when the scalar leaf is 
fully shredded.
   - **Optimization:** Apply the existing row-group null-count proof to the 
terminal residual for both pruning paths. Parquet's shredded object format 
keeps keys represented in `typed_value` out of the corresponding object's 
residual.
   - **Results:** The Fedora ASAN native reader scanned a real 128-row Parquet 
file with two row groups and evaluated `v.a.b > 95`. With metadata pruning 
disabled, the Profile recorded zero row groups and zero rows pruned by page 
index. With pruning enabled, the Profile recorded one row group pruned by 
min/max and rows skipped by page index in the surviving group. Both full 
Variant reads and leaf-only projections returned the same 32 rows (IDs 96–127) 
in both modes. The comparison measures pruning counters and result equality.
   - **Applicability and cost:** This applies to supported scalar paths whose 
terminal residual is proven all NULL for the row group. A populated terminal 
residual or missing null count keeps the candidate data. Both paths reuse the 
existing metadata and require no additional reads or configuration.
   
   ### Testing
   
   - Fedora ASAN BE: `./run-be-ut.sh --run -j 8 --filter 
'NativeParquetStatisticsTest.*:NewParquetReaderTest.*'` passed all 109 tests 
(20 statistics and 89 reader tests). The test target was scoped to the two 
suites and their shared test support.
   - `ShreddedVariantPruningUsesOnlyTerminalFallback` covers row-group and page 
exclusion with a populated ancestor residual, plus retention when the terminal 
residual has a value or its null count is absent.
   - `PrunesNestedVariantWithNonEmptyAncestorResidual` writes the Parquet 
fixture with real page indexes, compares every returned ID and Variant value 
with pruning enabled and disabled, and verifies pruning and leaf projection via 
Profile counters.
   - Clang-format 16, build hygiene, diff whitespace checks, and clang-tidy on 
changed lines passed.
   
   ### Release note
   
   Nested Parquet Variant predicates can skip more row groups and pages when 
ancestor objects have unrelated residual fields.
   
   ### Check List (For Author)
   
   - Behavior changed: No
   - Does this need documentation: No
   - Pre-submission status: Ready
   
   ### AI Disclosure
   
   - Tool: OpenAI Codex (GPT-6)
   - Generated: Implementation, tests, verification, and PR description.
   - Human review: The author approved the design. Implementation review was 
not stated.
   


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