Repository: hive Updated Branches: refs/heads/branch-2.1 d50cdf74c -> 89ce41d81
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/89ce41d8 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/89ce41d8 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/89ce41d8 Branch: refs/heads/branch-2.1 Commit: 89ce41d814ac37263cdc5c58c57d667861e07724 Parents: d50cdf7 Author: Wei Zheng <[email protected]> Authored: Sun Jul 31 15:08:58 2016 -0700 Committer: Wei Zheng <[email protected]> Committed: Sun Jul 31 15:09:32 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/89ce41d8/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 858b47a..aca6a0c 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 @@ -1566,7 +1566,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);
