Copilot commented on code in PR #7471:
URL: https://github.com/apache/ignite-3/pull/7471#discussion_r2721197786
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/rel/CorrelatedNestedLoopJoinNode.java:
##########
@@ -485,7 +491,14 @@ private Node<RowT> rightSource() {
private void prepareCorrelations() {
for (int i = 0; i < correlationIds.size(); i++) {
RowT row = i < leftInBuf.size() ? leftInBuf.get(i) :
first(leftInBuf);
- context().correlatedVariable(row, correlationIds.get(i).getId());
+ int corrId = correlationIds.get(i).getId();
+
+ for (int fieldIndex = correlationColumns.nextSetBit(0); fieldIndex
!= -1;
+ fieldIndex = correlationColumns.nextSetBit(fieldIndex +
1)) {
+ Object value = context().rowAccessor().get(fieldIndex, row);
+
+ context().correlatedVariable(corrId, fieldIndex, value);
Review Comment:
This change makes correlation propagation dependent on `correlationColumns`
(only those fields are written into the context). There doesn’t appear to be an
execution-level test that exercises a right-side expression reading correlated
values via `SqlEvaluationContext#correlatedVariable(corrId, fieldIndex)`.
Adding a test that uses a correlated predicate/projection would help prevent
regressions where `correlationColumns` is incomplete and stale values are read.
--
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]