aboutsummaryrefslogtreecommitdiff
path: root/exec/java-exec
diff options
context:
space:
mode:
authorParth Chandra <pchandra@maprtech.com>2014-12-17 17:58:58 -0800
committerParth Chandra <pchandra@maprtech.com>2014-12-17 22:27:28 -0800
commitac6e913bfaea4b1f453f4b307b456e20dc341dfa (patch)
tree3cebd9bd6f7fb7d528bc0ca60e07dec5808549d6 /exec/java-exec
parente10c2197b3884c9e6879462e0e1057aacadfa47f (diff)
DRILL-1886: Project on subquery containing a union all causes NPE
Diffstat (limited to 'exec/java-exec')
-rw-r--r--exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/union/UnionAllRecordBatch.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/union/UnionAllRecordBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/union/UnionAllRecordBatch.java
index 78b53a556..99aec9202 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/union/UnionAllRecordBatch.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/union/UnionAllRecordBatch.java
@@ -124,10 +124,8 @@ public class UnionAllRecordBatch extends AbstractRecordBatch<UnionAll> {
private void doTransfer() {
outRecordCount = current.getRecordCount();
- // skip empty batches
- if (outRecordCount == 0) {
- return;
- }
+ // If the batch is empty we still need to set up the outgoing vectors otherwise the downstream operators will get
+ // a NPE. SEE DRILL-1886
if (container.getSchema().getSelectionVectorMode() == BatchSchema.SelectionVectorMode.TWO_BYTE) {
this.sv = current.getSelectionVector2();
}