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



##########
File path: 
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/trait/CorrelationTrait.java
##########
@@ -92,7 +92,12 @@ public boolean correlated() {
         if (trait == this || this == UNCORRELATED)
             return true;
 
-        return equals(trait);
+        if (!(trait instanceof CorrelationTrait))
+            return false;
+
+        CorrelationTrait other = (CorrelationTrait) trait;
+
+        return other.correlated() && 
other.correlationIds().containsAll(correlationIds());

Review comment:
       Assume we have slightly modified spool that keeps track of provided 
correlated variables and restarts itself if latter have changed. This spool 
will preserve only those correlates that were specified.
   
   Now if there is a tree like Node_1(corr1, corr2) -> ... -> Node_N(corr1, 
corr2), it's possible to put Spool(corr1) anywhere in between Node_1 and 
Node_N, but this will actually break correlation by corr2 for Node_1.
   
   The point is if there is a correlated stream, the only possible relations 
should be only those aware of all correlations of this stream.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to