Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 184DD200B63 for ; Mon, 1 Aug 2016 00:07:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 16F98160AA9; Sun, 31 Jul 2016 22:07:13 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5BBA4160A81 for ; Mon, 1 Aug 2016 00:07:12 +0200 (CEST) Received: (qmail 43753 invoked by uid 500); 31 Jul 2016 22:07:11 -0000 Mailing-List: contact commits-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hive.apache.org Delivered-To: mailing list commits@hive.apache.org Received: (qmail 43742 invoked by uid 99); 31 Jul 2016 22:07:11 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 31 Jul 2016 22:07:11 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 662CBE1101; Sun, 31 Jul 2016 22:07:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: weiz@apache.org To: commits@hive.apache.org Message-Id: <8cfec0f0c6474e97809dd4ce1a3b6248@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hive git commit: HIVE-14381 : Handle null value in WindowingTableFunction.WindowingIterator.next() (Wei Zheng, reviewed by Jesus Camacho Rodriguez) Date: Sun, 31 Jul 2016 22:07:11 +0000 (UTC) archived-at: Sun, 31 Jul 2016 22:07:13 -0000 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 Authored: Sun Jul 31 15:08:58 2016 -0700 Committer: Wei Zheng 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);