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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AccessPathPlanCollector.java:
##########
@@ -391,6 +411,18 @@ private void collectByExpressions(Plan plan, 
StatementContext context, boolean b
         }
     }
 
+    private boolean collectWholeVariantOutput(Slot slot) {
+        if (!slot.getDataType().isVariantType()
+                || (slot instanceof SlotReference && ((SlotReference) 
slot).hasSubColPath())) {
+            return false;
+        }
+        List<String> path = new ArrayList<>();
+        path.add(slot.getName());
+        allSlotToAccessPaths.put(slot.getExprId().asInt(),
+                new CollectAccessPathResult(path, false, 
ColumnAccessPathType.DATA));

Review Comment:
   Recording the full VARIANT output here is not propagated correctly through 
`LogicalGenerate` when the output slot comes from `explode(v)`. For example, 
`SELECT x FROM variant_tbl LATERAL VIEW explode(v) tmp AS x WHERE x['k'] IS NOT 
NULL` records a root path `[x]` for the project and a subpath `[x, k]` for the 
filter. In `visitLogicalGenerate()`, the root path enters the VARIANT child 
branch with `path.subList(1, path.size())`, which is an empty suffix; 
`visitSlotReference()` then sees the input `v` with an empty builder and 
records no root `[v]` access path. The filter still contributes `[v, k]`, so 
the scan can prune `v` to only `k` while the projected `x` requires the full 
exploded VARIANT value. This is distinct from the existing full-value 
expression and dynamic-subscript threads because the full-root requirement is 
introduced by generator-output propagation. Please make the `[x]` generator 
demand force a root access on the generator input for `explode(v)`, and add 
coverage co
 mbining full `x` projection with a nested `x[...]` or `v[...]` predicate.



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