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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/NestedColumnPruning.java:
##########
@@ -380,10 +287,8 @@ && 
containsDataSkippingOnlyAccessPath(collectAccessPathResults)) {
         // third: build predicate access path
         for (Entry<Slot, DataTypeAccessTree> kv : 
slotIdToPredicateAccessTree.entrySet()) {
             Slot slot = kv.getKey();
-            stripExactCoveredDataSkippingSuffixPaths(slot, 
predicateAccessPaths, allAccessPaths);
-            stripCoveredOffsetSuffixPaths(slot, predicateAccessPaths, 
allAccessPaths);
-            stripCoveredArrayNullSuffixPaths(slot, predicateAccessPaths, 
allAccessPaths);
-            stripNullSuffixPaths(slot, predicateAccessPaths);
+            expandMapStarPaths(slot, predicateAccessPaths);
+            MetaPathStriper.strip(slot.getExprId().asInt(), 
predicateAccessPaths, allAccessPaths);

Review Comment:
   This predicate normalization can run even when the final all-path 
representation was not normalized the same way.
   
   Reduced plan:
   
   ```text
   Project(element_at(map_col, 'a'))
     Filter(element_at(map_col, 'a') = 'x')
       OlapScan(map_col: MAP<STRING, STRING>)
   ```
   
   `AccessPathExpressionCollector` records `[map_col, *]` for both 
`allAccessPaths` and `predicateAccessPaths`. Because there is no 
`NULL`/`OFFSET` path, the all-path loop above does not call 
`expandMapStarPaths`, so final all paths stay as `[map_col, *]`. This line then 
expands only the predicate paths to `[map_col, KEYS]` and `[map_col, VALUES]`. 
`retainPredicatePathsInFinalAllAccessPaths` compares exact `ColumnAccessPath`s 
against all paths `[map_col, *]` and removes both predicate paths, so the 
`SlotDescriptor` loses predicate access metadata that existed before the 
refactor.
   
   Please keep the two representations consistent: either expand predicate 
paths only when the corresponding all paths were expanded, or expand all paths 
whenever predicate paths are expanded. A focused test like `select map_col['a'] 
from str_tbl where map_col['a'] = 'x'` should assert that predicate access 
paths still survive.



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