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 804E8200BCE for ; Fri, 2 Dec 2016 22:55:45 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 7EFCD160B24; Fri, 2 Dec 2016 21:55:45 +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 C9649160B08 for ; Fri, 2 Dec 2016 22:55:44 +0100 (CET) Received: (qmail 88306 invoked by uid 500); 2 Dec 2016 21:55:43 -0000 Mailing-List: contact dev-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list dev@hive.apache.org Received: (qmail 88290 invoked by uid 99); 2 Dec 2016 21:55:43 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Dec 2016 21:55:43 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 2606A2D91E8; Fri, 2 Dec 2016 21:55:43 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============2037139404901776055==" MIME-Version: 1.0 Subject: Re: Review Request 54284: StatsOptimizer should return no rows on empty table with group by From: pengcheng xiong To: Ashutosh Chauhan Cc: pengcheng xiong , hive Date: Fri, 02 Dec 2016 21:55:43 -0000 Message-ID: <20161202215543.1641.78284@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: pengcheng xiong X-ReviewGroup: hive X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/54284/ X-Sender: pengcheng xiong References: <20161202211050.1642.69520@reviews.apache.org> In-Reply-To: <20161202211050.1642.69520@reviews.apache.org> X-ReviewBoard-Diff-For: ql/src/test/queries/clientpositive/constGby.q X-ReviewBoard-Diff-For: ql/src/test/results/clientpositive/constGby.q.out Reply-To: pengcheng xiong X-ReviewRequest-Repository: hive-git archived-at: Fri, 02 Dec 2016 21:55:45 -0000 --===============2037139404901776055== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On Dec. 2, 2016, 9:10 p.m., Ashutosh Chauhan wrote: > > ql/src/java/org/apache/hadoop/hive/ql/optimizer/StatsOptimizer.java, line 182 > > > > > > Is there any differnce between NULL & constant? It seems you are not making use of NULL any where. Yes, I have make use of NULL. Please See {code} if (getGbyKeyType(pgbyOp) == GbyKeyType.OTHER) { return null; } // we already check if rowCnt is null and rowCnt==0 means table is // empty. else if (getGbyKeyType(pgbyOp) == GbyKeyType.CONSTANT && rowCnt == 0) { return null; } {code} That means, only if it is groupby constant and rowCnt=0, we skip the StatsOptimizer. If it is NULL, which should be the 3rd condition (if, else if, else), we continue. - pengcheng ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/54284/#review157823 ----------------------------------------------------------- On Dec. 2, 2016, 1:23 a.m., pengcheng xiong wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/54284/ > ----------------------------------------------------------- > > (Updated Dec. 2, 2016, 1:23 a.m.) > > > Review request for hive and Ashutosh Chauhan. > > > Repository: hive-git > > > Description > ------- > > HIVE-13452 > > > Diffs > ----- > > ql/src/java/org/apache/hadoop/hive/ql/optimizer/StatsOptimizer.java 17510e9 > ql/src/test/queries/clientpositive/constGby.q PRE-CREATION > ql/src/test/results/clientpositive/constGby.q.out PRE-CREATION > > Diff: https://reviews.apache.org/r/54284/diff/ > > > Testing > ------- > > > Thanks, > > pengcheng xiong > > --===============2037139404901776055==--