mrhhsg opened a new pull request, #69309:
URL: https://github.com/apache/doris/pull/69309
### What problem does this PR solve?
Issue Number: None
Related PR: #65355
Problem Summary: This is the branch-4.2 backport of #65355. With nested
column pruning enabled, a map nested inside a struct could be lazily
materialized with only its keys or only its values after a sibling struct field
was used for filtering. The map placeholder is cleared during the lazy phase,
but the skipped key/value counterpart stayed empty, so the ColumnMap offsets no
longer matched both child column sizes. On branch-4.2 this surfaces as a
`ColumnVector<T>::insert_range_from` out-of-range error. This change fills only
the truly skipped counterparts with defaults during lazy map materialization,
keeps the child data already read in the predicate phase, and still avoids
reading pruned data pages.
### Release note
None
### Check List (For Author)
- Test: Regression test and unit test
- Unit Test:
ColumnReaderTest.MapLazyReadByRowidsFillsSkippedKeysForValuesOnlyPath and
ColumnReaderTest.MapLazyReadByRowidsPreservesPredicateKeysForValuesOnlyPath
- Regression test:
regression-test/suites/nereids_rules_p0/column_pruning/struct_map_pruning_lazy_read.groovy
- Behavior changed: No
- Does this need documentation: No
### Test results
- BE unit tests (ASAN build, `-j 64`): `./run-be-ut.sh --run
--filter=ColumnReaderTest.MapLazyReadByRowidsFillsSkippedKeysForValuesOnlyPath:ColumnReaderTest.MapLazyReadByRowidsPreservesPredicateKeysForValuesOnlyPath`
Result: PASSED 2 tests. The same filter FAILS 2 tests on the unfixed
source (skipped key column size 0 vs 1; predicate key re-seeked), confirming
both tests cover the bug.
- Full build (BE + FE, Release): `DISABLE_BE_JAVA_EXTENSIONS=OFF
doris-local-regression build`
Result: "Successfully build Doris".
- Regression test: `doris-local-regression run -d
nereids_rules_p0/column_pruning -s struct_map_pruning_lazy_read`
Result: "All suites success", 1 suite passed / 0 failed. The
expected-output file was generated with `-forceGenOut` and then verified again
without it.
- Formatting: `build-support/check-format.sh` (clang-format 16) reports no
file to format; `git diff --check` is clean.
--
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]