github-actions[bot] commented on code in PR #63229:
URL: https://github.com/apache/doris/pull/63229#discussion_r3241351122


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/NestedColumnPruning.java:
##########
@@ -399,7 +375,10 @@ && 
containsDataSkippingOnlyAccessPath(collectAccessPathResults)) {
         // third: build predicate access path
         for (Entry<Slot, DataTypeAccessTree> kv : 
slotIdToPredicateAccessTree.entrySet()) {
             Slot slot = kv.getKey();
+            stripCoveredOffsetSuffixPaths(slot, predicateAccessPaths, 
allAccessPaths);
+            stripCoveredArrayNullSuffixPaths(slot, predicateAccessPaths, 
allAccessPaths);
             stripNullSuffixPaths(slot, predicateAccessPaths);
+            retainPredicatePathsInAllAccessPaths(slot, predicateAccessPaths, 
allAccessPaths);
             List<ColumnAccessPath> predicatePaths =

Review Comment:
   This filtering still checks predicate paths against the raw collected 
`allAccessPaths`, but some earlier branches emit normalized `AccessPathInfo` 
paths without updating that multimap. For example, `where 
cardinality(map_arr_col['a']) > 0` on `MAP<STRING, ARRAY<INT>>` takes the 
`hasMapValueOffsetOnlyAccess()` branch and emits all paths `[map_arr_col.KEYS, 
map_arr_col.VALUES.OFFSET]`, while the collected predicate path remains 
`[map_arr_col.*.OFFSET]`. Because raw `allAccessPaths` also still contains 
`[map_arr_col.*.OFFSET]`, `retainPredicatePathsInAllAccessPaths()` keeps it, so 
BE receives a predicate path that is not a subset of the emitted all paths, 
violating the invariant this PR adds in tests. Please normalize/filter 
predicate paths against the actual `AccessPathInfo.getAllAccessPaths()` result 
(or update `allAccessPaths` in the special map branch), and add a test for a 
predicate-only `cardinality(map_arr_col['a'])` query.



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