Repository: hive Updated Branches: refs/heads/master 4f1cd26ce -> 4e850c753
HIVE-14381 : Handle null value in WindowingTableFunction.WindowingIterator.next() (Wei Zheng, reviewed by Jesus Camacho Rodriguez) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/4e850c75 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/4e850c75 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/4e850c75 Branch: refs/heads/master Commit: 4e850c753a31c542bac0ce83877b802131e09c72 Parents: 4f1cd26 Author: Wei Zheng <[email protected]> Authored: Sun Jul 31 15:08:58 2016 -0700 Committer: Wei Zheng <[email protected]> Committed: Sun Jul 31 15:08:58 2016 -0700 ---------------------------------------------------------------------- .../hadoop/hive/ql/udf/ptf/WindowingTableFunction.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/4e850c75/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/WindowingTableFunction.java ---------------------------------------------------------------------- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/WindowingTableFunction.java b/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/WindowingTableFunction.java index 3a2bc4f..e9f8ff9 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/WindowingTableFunction.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/WindowingTableFunction.java @@ -1567,7 +1567,13 @@ public class WindowingTableFunction extends TableFunctionEvaluator { wFn.getWFnEval().aggregate(aggBuffers[j], args[j]); Object out = ((ISupportStreamingModeForWindowing) wFn.getWFnEval()) .getNextResult(aggBuffers[j]); - out = ObjectInspectorUtils.copyToStandardObject(out, wFn.getOI()); + if (out != null) { + if (out == ISupportStreamingModeForWindowing.NULL_RESULT) { + out = null; + } else { + out = ObjectInspectorUtils.copyToStandardObject(out, wFn.getOI()); + } + } output.set(j, out); } else { Range rng = getRange(wFn, currIdx, iPart);
