alex-plekhanov commented on a change in pull request #9085:
URL: https://github.com/apache/ignite/pull/9085#discussion_r630768380
##########
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:
> After this change fromTrait correlated by cor1 will satisfy to toTrait
correlated by (cor1,cor2), but this doesn't seem legit.
But what's wrong with this statement? I think it's correct. Correlated
trait, as far as I understand, means `depends on variable`, so if some node
depends on `cor1` and we have a requirement with a dependency for `cor1` and
`cor2`, then this node satisfies this requirement (no extra dependency needed).
Currently, there are no tests for this case, but I think it can be reproduced
with 2 nested `exists` subqueries.
--
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]