yanlin-Lynn commented on a change in pull request #1496: [CALCITE-3400] Add
support for interpretering left/right/semi/anti/full join
URL: https://github.com/apache/calcite/pull/1496#discussion_r334734816
##########
File path: core/src/main/java/org/apache/calcite/interpreter/JoinNode.java
##########
@@ -47,28 +50,118 @@ public JoinNode(Compiler compiler, Join rel) {
}
public void run() throws InterruptedException {
- List<Row> rightList = null;
- final int leftCount = rel.getLeft().getRowType().getFieldCount();
- final int rightCount = rel.getRight().getRowType().getFieldCount();
- context.values = new Object[rel.getRowType().getFieldCount()];
- Row left;
- Row right;
- while ((left = leftSource.receive()) != null) {
- System.arraycopy(left.getValues(), 0, context.values, 0, leftCount);
- if (rightList == null) {
- rightList = new ArrayList<>();
- while ((right = rightSource.receive()) != null) {
- rightList.add(right);
+
+ final int fieldCount = rel.getLeft().getRowType().getFieldCount()
+ + rel.getRight().getRowType().getFieldCount();
+ context.values = new Object[fieldCount];
+
+ Source baseSource = leftSource;
Review comment:
OK, got your point.
Updated.
----------------------------------------------------------------
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