vlsi commented on a change in pull request #2623:
URL: https://github.com/apache/calcite/pull/2623#discussion_r767762068



##########
File path: core/src/main/java/org/apache/calcite/rel/core/RelFactories.java
##########
@@ -162,10 +162,20 @@ private RelFactories() {
      * @param hints The hints
      * @param childExprs The projection expressions
      * @param fieldNames The projection field names
+     * @param variablesSet Correlating variables that are set when reading
+     *   a row from the input, and which may be referenced from inside the
+     *   projection
      * @return a project
      */
     RelNode createProject(RelNode input, List<RelHint> hints,
-        List<? extends RexNode> childExprs, @Nullable List<? extends @Nullable 
String> fieldNames);
+        List<? extends RexNode> childExprs, @Nullable List<? extends @Nullable 
String> fieldNames,
+        Set<CorrelationId> variablesSet);
+
+    @Deprecated // to be removed before 2.0
+    default RelNode createProject(RelNode input, List<RelHint> hints,
+        List<? extends RexNode> childExprs, @Nullable List<? extends @Nullable 
String> fieldNames) {
+      return createProject(input, hints, childExprs, fieldNames, 
ImmutableSet.of());
+    }

Review comment:
       I wonder if there's a better way to evolve interfaces like this.
   
   1) I am not sure we should deprecate `variablesSet=empty` method. I believe, 
it would be the most commonly used case, and it would be sad to pass 
`ImmutableSet.of()` all over the place.
   
   2) I am not sure how often Calcite consumers implement `ProjectFactory`, 
however, adding a non-default method breaks consumers.
   
   3) Does this change mean that every implementation has to implement 
`variablesSet` in `Project`? In other words, what if `mongo` adapter does not 
support correlation columns as a part of `Project`? What should it do? Should 
the rules be updated to convert the project into something else?




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