mihaibudiu commented on code in PR #4109:
URL: https://github.com/apache/calcite/pull/4109#discussion_r1896903000


##########
core/src/main/java/org/apache/calcite/rel/metadata/RelColumnOrigin.java:
##########
@@ -17,20 +17,27 @@
 package org.apache.calcite.rel.metadata;
 
 import org.apache.calcite.plan.RelOptTable;
+import org.apache.calcite.rel.core.CorrelationId;
 
 import org.checkerframework.checker.nullness.qual.Nullable;
 
+import static java.util.Objects.requireNonNull;
+
 /**
  * RelColumnOrigin is a data structure describing one of the origins of an
  * output column produced by a relational expression.
  */
 public class RelColumnOrigin {
   //~ Instance fields --------------------------------------------------------
 
-  private final RelOptTable originTable;
+  private final @Nullable RelOptTable originTable;

Review Comment:
   Ideally this would be implemented using an interface and two subclasses, one 
for each kind of origin.
   Not sure how easy this can be accomplished while keeping compatibility. 



##########
core/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnOrigins.java:
##########
@@ -303,6 +328,17 @@ private static Set<RelColumnOrigin> 
getMultipleColumns(RexNode rexNode, RelNode
             }
             return null;
           }
+
+          @Override public Void visitFieldAccess(RexFieldAccess fieldAccess) {

Review Comment:
   shouldn't this actually use as origin the table that correlated variable 
comes from (recursively)?



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

Reply via email to