jh3507 commented on a change in pull request #1334: [CALCITE-3111] Allow custom
implementations of Correlate in RelDecorr…
URL: https://github.com/apache/calcite/pull/1334#discussion_r310764671
##########
File path: core/src/main/java/org/apache/calcite/tools/RelBuilder.java
##########
@@ -1978,6 +1978,21 @@ public RelBuilder join(JoinRelType joinType, RexNode
condition,
return this;
}
+ /** Creates a {@link org.apache.calcite.rel.core.Correlate}
+ * with correlateId and requiredColumns. */
+ public RelBuilder correlate(JoinRelType joinType,
+ CorrelationId correlationId, ImmutableBitSet requiredColumns) {
+ Frame right = stack.pop();
+ final Frame left = stack.pop();
+ final RelNode join = correlateFactory
+ .createCorrelate(left.rel, right.rel, correlationId, requiredColumns,
joinType);
+ final ImmutableList.Builder<Field> fields = ImmutableList.builder();
+ fields.addAll(left.fields);
+ fields.addAll(right.fields);
+ stack.push(new Frame(join, fields.build()));
+ return this;
+ }
+
Review comment:
I changed it to a list of integers(using varargs could be another option)
and added a test case. I think this is a bit more user-friendly.
----------------------------------------------------------------
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]
With regards,
Apache Git Services