Github user jacques-n commented on a diff in the pull request:
https://github.com/apache/drill/pull/190#discussion_r41717893
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinStatus.java
---
@@ -81,114 +58,82 @@ public JoinStatus(RecordBatch left, RecordBatch right,
MergeJoinBatch output) {
@Override
public String toString() {
return
- super.toString()
+ super.toString()
+ "["
- + "leftPosition = " + leftPosition
- + ", rightPosition = " + rightPosition
- + ", svRightPosition = " + svRightPosition
+ + "leftPosition = " + left.getCurrentPosition()
+ + ", rightPosition = " + right.getCurrentPosition()
+ ", outputPosition = " + outputPosition
- + ", lastLeft = " + lastLeft
- + ", lastRight = " + lastRight
- + ", rightSourceMode = " + rightSourceMode
- + ", sv4 = " + sv4
+ ", joinType = " + joinType
+ ", ok = " + ok
+ ", initialSet = " + initialSet
- + ", leftRepeating = " + leftRepeating
+ ", left = " + left
+ ", right = " + right
+ ", outputBatch = " + outputBatch
+ "]";
}
- public boolean hasIntermediateData() {
- return hasIntermediateData;
- }
-
- public void resetIntermediateData() {
- hasIntermediateData = false;
- }
-
- public void setIntermediateData(int initialRightPosition, boolean
crossedBatchBoundaries) {
- this.initialRightPosition = initialRightPosition;
- this.crossedBatchBoundaries = crossedBatchBoundaries;
- this.hasIntermediateData = true;
- }
-
- public int getInitialRightPosition() {
- return initialRightPosition;
- }
-
- public boolean getCrossedBatchBoundaries() {
- return crossedBatchBoundaries;
- }
-
- private final IterOutcome nextLeft() {
- return outputBatch.next(LEFT_INPUT, left);
- }
-
- private final IterOutcome nextRight() {
- return outputBatch.next(RIGHT_INPUT, right);
- }
public final void ensureInitial() {
switch(initialSet) {
case INIT:
- this.lastLeft = nextLeft();
- this.lastRight = nextRight();
+ advanceLeft();
+ advanceRight();
initialSet = InitState.CHECK;
break;
case CHECK:
- if (lastLeft != IterOutcome.NONE && left.getRecordCount() == 0) {
- this.lastLeft = nextLeft();
+ if (getLeftStatus() != IterOutcome.NONE &&
left.getInnerRecordCount() == 0) {
+ advanceLeft();
}
- if (lastRight != IterOutcome.NONE && right.getRecordCount() == 0) {
- this.lastRight = nextRight();
+ if (getRightStatus() != IterOutcome.NONE &&
right.getInnerRecordCount() == 0) {
+ advanceRight();
}
initialSet = InitState.READY;
- // fall through
+ break;
default:
break;
}
}
public final void advanceLeft() {
- leftPosition++;
+ left.next();
--- End diff --
My movement, I mean iterator movement.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---