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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AccessPathExpressionCollector.java:
##########
@@ -380,20 +380,50 @@ private static boolean 
isFunctionNullCheckPath(List<String> suffixPath) {
 
     @Override
     public Void visitMapContainsKey(MapContainsKey mapContainsKey, 
CollectorContext context) {
+        // MAP_CONTAINS_KEY(<map>, <key>)
+        // Map argument: only the key sub-column is needed.
         context.accessPathBuilder.addPrefix(AccessPathInfo.ACCESS_MAP_KEYS);
-        return continueCollectAccessPath(mapContainsKey.getArgument(0), 
context);
+        continueCollectAccessPath(mapContainsKey.getArgument(0), context);
+        // Key argument: visit with a fresh context to register its data 
access paths.
+        // The key may reference nested sub-columns (e.g. element_at(s, 'a')) 
whose
+        // full-data paths must be collected; otherwise an IS NULL / OFFSET 
path on
+        // the same slot would cause NestedColumnPruning to prune to 
metadata-only.
+        Expression keyArg = mapContainsKey.getArgument(1);
+        if (keyArg != null) {

Review Comment:
   These arguments are fixed by the function arity 
(`MapContainsKey`/`MapContainsValue` are binary and `MapContainsEntry` is 
ternary, with constructors/`withChildren` enforcing the size), so the new `if 
(... != null)` guards are speculative defensive checks. The repository guidance 
asks us to assert correctness rather than silently skip impossible states. 
Please remove the three null guards and call `continueCollectAccessPath(...)` 
directly, or use an assertion/precondition if there is a real invariant concern.



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