korlov42 commented on a change in pull request #9103:
URL: https://github.com/apache/ignite/pull/9103#discussion_r667838128



##########
File path: 
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rule/TableFunctionScanConverterRule.java
##########
@@ -53,8 +60,23 @@ private TableFunctionScanConverterRule() {
             .replace(RewindabilityTrait.REWINDABLE)
             .replace(IgniteDistributions.broadcast());
 
+        RexBuilder rexBuilder = rel.getCluster().getRexBuilder();
+
         Set<CorrelationId> corrIds = 
RexUtils.extractCorrelationIds(rel.getCall());
 
+        // TODO: remove all near 'if' scope after 
https://issues.apache.org/jira/browse/CALCITE-4673 will be merged.
+        if (corrIds.size() > 1) {
+            final List<CorrelationId> correlNames = U.arrayList(corrIds);
+
+            RelNode rel0 = DeduplicateCorrelateVariables.go(rexBuilder, 
correlNames.get(0), Util.skip(correlNames), rel);
+
+            corrIds = RelOptUtil.getVariablesUsed(rel0);
+
+            assert corrIds.size() == 1 : "Multiple correlates are appied: " + 
corrIds;

Review comment:
       ```suggestion
               assert corrIds.size() == 1 : "Multiple correlates are applied: " 
+ corrIds;
   ```




-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to