Github user amansinha100 commented on a diff in the pull request:
https://github.com/apache/drill/pull/407#discussion_r55561188
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/union/UnionAllRecordBatch.java
---
@@ -294,13 +313,41 @@ public UnionAllInput(UnionAllRecordBatch
unionAllRecordBatch, RecordBatch left,
rightSide = new OneSideInput(right);
}
+ private boolean isBothSideEmpty() {
+ return leftIsFinish && rightIsFinish;
+ }
+
public IterOutcome nextBatch() throws SchemaChangeException {
if(upstream == RecordBatch.IterOutcome.NOT_YET) {
IterOutcome iterLeft = leftSide.nextBatch();
switch(iterLeft) {
case OK_NEW_SCHEMA:
- break;
+ whileLoop:
+ while(leftSide.getRecordBatch().getRecordCount() == 0) {
+ iterLeft = leftSide.nextBatch();
+
+ switch(iterLeft) {
+ case STOP:
+ case OUT_OF_MEMORY:
+ return iterLeft;
+
+ case NONE:
--- End diff --
Is the NONE state not reached outside this while loop ? It wasn't clear why
we need the inner while loop for the left input considering that you don't do
that for the right input.
---
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.
---