englefly opened a new pull request, #64436:
URL: https://github.com/apache/doris/pull/64436
### What problem does this PR solve?
When a lambda body is a constant expression (e.g. x -> true) that never
references the array item variable, visitArrayItemSlot is not called, so the
bound array column's full-access path is never registered in slotToAccessPaths.
This gap is exposed when IS NULL or cardinality() has already registered a
data-skipping path ([col.NULL] or [col.OFFSET]) for the same slot —
NestedColumnPruning then incorrectly prunes the complex column to null-only or
offset-only.
Fix: in collectArrayPathInLambda, after visiting the body, check whether
each bound array's underlying Slot appears in the body's input slots (via
getInputSlots()). If not, manually visit the bound array with an ACCESS_ALL
prefix to register the full-access path.
Regression test lambda_null_pruning covers:
- Constant lambda body + IS NULL (the original bug)
- Multi-variable lambda where body references some but not all vars
- Array functions: array_count, array_map, array_filter
- Data-skipping triggers: IS NULL, IS NOT NULL, cardinality
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR should
merge into -->
--
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]