Github user jacques-n commented on a diff in the pull request:
https://github.com/apache/drill/pull/190#discussion_r41717952
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java
---
@@ -216,34 +206,34 @@ public IterOutcome innerNext() {
// get the outcome of the join.
switch (status.getOutcome()) {
- case BATCH_RETURNED:
- // only return new schema if new worker has been setup.
- logger.debug("BATCH RETURNED; returning {}", (first ?
"OK_NEW_SCHEMA" : "OK"));
- setRecordCountInContainer();
- return first ? IterOutcome.OK_NEW_SCHEMA : IterOutcome.OK;
- case FAILURE:
- kill(false);
- return IterOutcome.STOP;
- case NO_MORE_DATA:
- logger.debug("NO MORE DATA; returning {}",
(status.getOutPosition() > 0 ? (first ? "OK_NEW_SCHEMA" : "OK") : (first ?
"OK_NEW_SCHEMA" :"NONE")));
- setRecordCountInContainer();
- state = BatchState.DONE;
- return status.getOutPosition() > 0 ? (first ?
IterOutcome.OK_NEW_SCHEMA : IterOutcome.OK): (first ? IterOutcome.OK_NEW_SCHEMA
: IterOutcome.NONE);
- case SCHEMA_CHANGED:
- worker = null;
- if (status.getOutPosition() > 0) {
- // if we have current data, let's return that.
- logger.debug("SCHEMA CHANGED; returning {} ", (first ?
"OK_NEW_SCHEMA" : "OK"));
+ case BATCH_RETURNED:
+ // only return new schema if new worker has been setup.
+ logger.debug("BATCH RETURNED; returning {}", (first ?
"OK_NEW_SCHEMA" : "OK"));
setRecordCountInContainer();
return first ? IterOutcome.OK_NEW_SCHEMA : IterOutcome.OK;
- }else{
- // loop again to rebuild worker.
- continue;
- }
- case WAITING:
- return IterOutcome.NOT_YET;
- default:
- throw new IllegalStateException();
+ case FAILURE:
+ kill(false);
+ return IterOutcome.STOP;
+ case NO_MORE_DATA:
--- End diff --
This seems like a location where we need to make sure we deplete the
incoming iterators.
---
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.
---