DRILL-293: Sort operator throws NPE on empty record batch
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/4a83dae3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/4a83dae3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/4a83dae3 Branch: refs/heads/master Commit: 4a83dae35f8782a9737b31723769724f3b274894 Parents: 366bf8e Author: Ben Becker <[email protected]> Authored: Sun Dec 1 20:11:27 2013 -0800 Committer: Jacques Nadeau <[email protected]> Committed: Sun Dec 1 20:11:27 2013 -0800 ---------------------------------------------------------------------- .../org/apache/drill/exec/physical/impl/sort/SortBatch.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/4a83dae3/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortBatch.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortBatch.java index 9cefce1..7881115 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortBatch.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortBatch.java @@ -134,10 +134,11 @@ public class SortBatch extends AbstractRecordBatch<Sort> { } } - if (builder == null) + if (builder == null){ // builder may be null at this point if the first incoming batch is empty return IterOutcome.NONE; - + } + builder.build(context); sv4 = builder.getSv4();
