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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AccessPathExpressionCollector.java:
##########
@@ -98,14 +98,33 @@ public void collect(Expression expression) {
         expression.accept(this, new CollectorContext(statementContext, 
bottomPredicate));
     }
 
+    public void collectWholeVariantExpression(Expression expression) {
+        CollectorContext context = new CollectorContext(statementContext, 
bottomPredicate);
+        context.setCollectVariantRoot(true);
+        expression.accept(this, context);
+    }
+
     private Void continueCollectAccessPath(Expression expr, CollectorContext 
context) {
         return expr.accept(this, context);
     }
 
+    private void recordVariantRootAccessPath(SlotReference slotReference, 
CollectorContext context) {
+        int slotId = slotReference.getExprId().asInt();
+        slotToAccessPaths.put(slotId,
+                new CollectAccessPathResult(
+                        ImmutableList.of(slotReference.getName()),
+                        context.bottomFilter, ColumnAccessPathType.DATA));
+    }
+
     @Override
     public Void visit(Expression expr, CollectorContext context) {
         for (Expression child : expr.children()) {
-            child.accept(this, new CollectorContext(context.statementContext, 
context.bottomFilter));
+            if (child.getDataType().isVariantType()

Review Comment:
   This propagation also turns top-level nullable VARIANT null checks into a 
fake nested subpath on OLAP scans. For `SELECT 1 FROM olap_variant_tbl WHERE v 
IS NULL`, `visitIsNull()` seeds the builder with `NULL`; this branch preserves 
that non-empty builder into the VARIANT child, and `visitSlotReference()` 
records `[v, NULL]` as a VARIANT DATA path. `NestedColumnPruning` handles 
VARIANT slots outside the `DataTypeAccessTree` null-only logic, and 
`visitLogicalOlapScan()` does not call 
`normalizeDataSkippingOnlyAccessPaths()`, so BE receives `NULL` as if it were a 
VARIANT field name rather than a top-level null-map/root requirement. File/TVF 
scans normalize this pseudo suffix away, which is why this is a distinct OLAP 
path issue. Please special-case VARIANT `IS NULL`/`IS NOT NULL` to record a 
valid root/null access for OLAP (or normalize these pseudo suffixes before 
building VARIANT `AccessPathInfo`) and add coverage for nullable top-level 
VARIANT null predicates.



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