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


##########
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:
   I think this would also be difficult to keep compatible. Another compromise 
would be to keep the RelColumnOrigin unchanged and return null if the input 
field's CorField comes from outside the input RelNode.
   This way we just need to add a Map to maintain the mapping of CorrelationId, 
Index to ColumnOrigin, and go top-down to getColumnOrigin.
   ` public @Nullable Set<RelColumnOrigin> getColumnOrigins(Aggregate rel,
         RelMetadataQuery mq, int iOutputColumn, Map<Pair<CorrelationId, 
Integer>, ColumnOrigin>) corVarOriginMap) {
   ...
   }`



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