From dev-return-145446-archive-asf-public=cust-asf.ponee.io@hive.apache.org Fri Jan 5 06:18:47 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id E4707180657 for ; Fri, 5 Jan 2018 06:18:47 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D42B0160C3A; Fri, 5 Jan 2018 05:18:47 +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 F2155160C2B for ; Fri, 5 Jan 2018 06:18:46 +0100 (CET) Received: (qmail 1611 invoked by uid 500); 5 Jan 2018 05:18:45 -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 1600 invoked by uid 99); 5 Jan 2018 05:18:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Jan 2018 05:18:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id D805C1A047E; Fri, 5 Jan 2018 05:18:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.24 X-Spam-Level: *** X-Spam-Status: No, score=3.24 tagged_above=-999 required=6.31 tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_NONE=-0.0001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id pMSqkqBjkCv6; Fri, 5 Jan 2018 05:18:41 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 79ECC5F239; Fri, 5 Jan 2018 05:18:40 +0000 (UTC) Received: from reviews.apache.org (unknown [10.41.0.12]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id D6FC7E0617; Fri, 5 Jan 2018 05:18:38 +0000 (UTC) Received: from reviews-vm2.apache.org (localhost [IPv6:::1]) by reviews.apache.org (ASF Mail Server at reviews-vm2.apache.org) with ESMTP id BE1F6C4025A; Fri, 5 Jan 2018 05:18:35 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============6718540231183791395==" MIME-Version: 1.0 Subject: Re: Review Request 64900: HIVE-18359: Extend grouping set limits from int to long From: =?utf-8?q?Jes=C3=BAs_Camacho_Rodr=C3=ADguez?= To: =?utf-8?q?Jes=C3=BAs_Camacho_Rodr=C3=ADguez?= Cc: hive , j.prasanth.j@gmail.com Date: Fri, 05 Jan 2018 05:18:34 -0000 Message-ID: <20180105051834.37144.51359@reviews-vm2.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: =?utf-8?q?Jes=C3=BAs_Camacho_Rodr=C3=ADguez_=3Cnoreply=40reviews=2E?=@reviews.apache.org, =?utf-8?q?apache=2Eorg=3E?=@reviews.apache.org X-ReviewGroup: hive X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/64900/ X-Sender: =?utf-8?q?Jes=C3=BAs_Camacho_Rodr=C3=ADguez_=3Cnoreply=40reviews?= =?utf-8?b?LmFwYWNoZS5vcmc+?= References: <20180105043233.37144.32114@reviews-vm2.apache.org> In-Reply-To: <20180105043233.37144.32114@reviews-vm2.apache.org> X-ReviewBoard-Diff-For: ql/src/test/queries/clientpositive/groupingset_high_columns.q X-ReviewBoard-Diff-For: ql/src/test/results/clientpositive/groupingset_high_columns.q.out Reply-To: =?utf-8?q?Jes=C3=BAs_Camacho_Rodr=C3=ADguez_=3Cjcamachorodriguez?=@reviews.apache.org, =?utf-8?q?=40hortonworks=2Ecom=3E?=@reviews.apache.org X-ReviewRequest-Repository: hive-git --===============6718540231183791395== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit > On Jan. 5, 2018, 4:32 a.m., Jesús Camacho Rodríguez wrote: > > ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFGrouping.java > > Line 50 (original), 50 (patched) > > > > > > Return value for Grouping function should be Long now, as otherwise we will not be able to represent some of the possible values. > > Prasanth_J wrote: > Hmm.. I thought grouping() function only return 2 values. 1 for aggregated and 0 for non-aggregated. Atleast that's what the javadoc says. Should have been boolean :) Correct me if I am wrong. > > Prasanth_J wrote: > I think you are right, I missed this comment in the code > // grouping(c1, c2, c3) > // is equivalent to > // 4 * grouping(c1) + 2 * grouping(c2) + grouping(c3) > > I will fix it in the next patch. I was going to write you exactly the same thing, thanks! I think the test that I asked for below will be sufficient to validate whether this works as expected or not. You can see additional examples of usage in groupby_grouping_sets_grouping.q. > On Jan. 5, 2018, 4:32 a.m., Jesús Camacho Rodríguez wrote: > > ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFGrouping.java > > Line 63 (original), 63 (patched) > > > > > > I think it should be sufficient to check for LONG. > > Prasanth_J wrote: > The reason I am checking both INT and LONG here is there are many places in compiler that assumes Int for grouping. I fixed in many places, however there are places where string constansts "0" are initialized for "grouping__id" column, some cases where type inferences returns int, some cases constant folding returns int which became too intrusive of a change. So I handled it here in the UDF. Anyway, we use getLong() to retrieve the value. So I guess it is not a problem? As long as the bitmask is returned as long I think it shouldn't be a problem. I will wait for another test run to confirm this statement :) If only LONG is used, where do you observe the issue / for which tests? I saw that you changed it already in many places, including Calcite, thus it should be fine? If you let me know the test, I can help taking a look too. I agree that it might not be a problem, but I am not sure in which cases we would end up referencing an INT, hence I just want to make sure that we are not masking another issue. - Jesús ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/64900/#review194829 ----------------------------------------------------------- On Jan. 5, 2018, 3:32 a.m., Prasanth_J wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/64900/ > ----------------------------------------------------------- > > (Updated Jan. 5, 2018, 3:32 a.m.) > > > Review request for hive and Jesús Camacho Rodríguez. > > > Bugs: HIVE-18359 > https://issues.apache.org/jira/browse/HIVE-18359 > > > Repository: hive-git > > > Description > ------- > > HIVE-18359: Extend grouping set limits from int to long > > > Diffs > ----- > > ql/src/java/org/apache/hadoop/hive/ql/exec/GroupByOperator.java 8b94d1d > ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorGroupByOperator.java 90145e5 > ql/src/java/org/apache/hadoop/hive/ql/metadata/VirtualColumn.java 0032305 > ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveGroupingID.java adcda26 > ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveExpandDistinctAggregatesRule.java 89c5c23 > ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/HiveGBOpConvUtil.java 6f4188c > ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java 28b4cfe > ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java 5a88a96 > ql/src/java/org/apache/hadoop/hive/ql/plan/GroupByDesc.java 9d4ad22 > ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFGrouping.java cee0e14 > ql/src/test/queries/clientpositive/cte_1.q 15d3f06 > ql/src/test/queries/clientpositive/groupingset_high_columns.q PRE-CREATION > ql/src/test/results/clientpositive/annotate_stats_groupby.q.out ed3d594 > ql/src/test/results/clientpositive/annotate_stats_groupby2.q.out ffcb20f > ql/src/test/results/clientpositive/auto_join25.q.out 063d3ca > ql/src/test/results/clientpositive/cte_1.q.out 9374a32 > ql/src/test/results/clientpositive/groupby_cube1.q.out e5ece81 > ql/src/test/results/clientpositive/groupby_cube_multi_gby.q.out 9a6457c > ql/src/test/results/clientpositive/groupby_grouping_id3.q.out f13b6e5 > ql/src/test/results/clientpositive/groupby_grouping_sets1.q.out d70f065 > ql/src/test/results/clientpositive/groupby_grouping_sets2.q.out 453b9f7 > ql/src/test/results/clientpositive/groupby_grouping_sets3.q.out be8d20e > ql/src/test/results/clientpositive/groupby_grouping_sets4.q.out 0c6ead9 > ql/src/test/results/clientpositive/groupby_grouping_sets5.q.out 0bb12e1 > ql/src/test/results/clientpositive/groupby_grouping_sets6.q.out 5b990a1 > ql/src/test/results/clientpositive/groupby_grouping_sets_grouping.q.out 1f2f86b > ql/src/test/results/clientpositive/groupby_grouping_sets_limit.q.out b25b0e5 > ql/src/test/results/clientpositive/groupby_grouping_window.q.out 32135e4 > ql/src/test/results/clientpositive/groupby_rollup1.q.out bc1d8a9 > ql/src/test/results/clientpositive/groupby_rollup_empty.q.out 5db3184 > ql/src/test/results/clientpositive/groupingset_high_columns.q.out PRE-CREATION > ql/src/test/results/clientpositive/infer_bucket_sort_grouping_operators.q.out 5f1d264 > ql/src/test/results/clientpositive/limit_pushdown2.q.out cdd221b > ql/src/test/results/clientpositive/llap/cte_1.q.out ddef9db > ql/src/test/results/clientpositive/llap/groupby_rollup_empty.q.out 061b0d7 > ql/src/test/results/clientpositive/llap/insert_values_orig_table_use_metadata.q.out d135f08 > ql/src/test/results/clientpositive/llap/llap_acid.q.out 38889b9 > ql/src/test/results/clientpositive/llap/llap_acid_fast.q.out 4a7297d > ql/src/test/results/clientpositive/llap/multi_count_distinct_null.q.out 39feaec > ql/src/test/results/clientpositive/llap/sysdb.q.out 3bd407b > ql/src/test/results/clientpositive/llap/vector_groupby_cube1.q.out 39de888 > ql/src/test/results/clientpositive/llap/vector_groupby_grouping_id1.q.out 7224d59 > ql/src/test/results/clientpositive/llap/vector_groupby_grouping_id2.q.out e6075c7 > ql/src/test/results/clientpositive/llap/vector_groupby_grouping_id3.q.out da4b81f > ql/src/test/results/clientpositive/llap/vector_groupby_grouping_sets1.q.out d2b738b > ql/src/test/results/clientpositive/llap/vector_groupby_grouping_sets2.q.out 1877bba > ql/src/test/results/clientpositive/llap/vector_groupby_grouping_sets3.q.out 7c9f668 > ql/src/test/results/clientpositive/llap/vector_groupby_grouping_sets4.q.out 6a5e679 > ql/src/test/results/clientpositive/llap/vector_groupby_grouping_sets5.q.out 4d8fa16 > ql/src/test/results/clientpositive/llap/vector_groupby_grouping_sets6.q.out 5e9e204 > ql/src/test/results/clientpositive/llap/vector_groupby_grouping_sets_grouping.q.out b81a0d3 > ql/src/test/results/clientpositive/llap/vector_groupby_grouping_sets_limit.q.out e8ca06e > ql/src/test/results/clientpositive/llap/vector_groupby_grouping_window.q.out 4de6ebb > ql/src/test/results/clientpositive/llap/vector_groupby_rollup1.q.out d1263cd > ql/src/test/results/clientpositive/perf/spark/query18.q.out 88d289c > ql/src/test/results/clientpositive/perf/spark/query22.q.out 15fe441 > ql/src/test/results/clientpositive/perf/spark/query27.q.out 627821f > ql/src/test/results/clientpositive/perf/spark/query36.q.out d313337 > ql/src/test/results/clientpositive/perf/spark/query5.q.out 14e0bdb > ql/src/test/results/clientpositive/perf/spark/query67.q.out 25d37bd > ql/src/test/results/clientpositive/perf/spark/query70.q.out 862bdb0 > ql/src/test/results/clientpositive/perf/spark/query77.q.out 6dcaf7c > ql/src/test/results/clientpositive/perf/spark/query80.q.out 606d23c > ql/src/test/results/clientpositive/perf/spark/query86.q.out 8e159fd > ql/src/test/results/clientpositive/spark/groupby_cube1.q.out fa1480e > ql/src/test/results/clientpositive/spark/groupby_rollup1.q.out 460e7db > ql/src/test/results/clientpositive/spark/limit_pushdown2.q.out f6f0043 > ql/src/test/results/clientpositive/tez/multi_count_distinct.q.out 7f7d354 > ql/src/test/results/clientpositive/vector_grouping_sets.q.out f08c270 > ql/src/test/results/clientpositive/view_cbo.q.out e10cb7a > > > Diff: https://reviews.apache.org/r/64900/diff/2/ > > > Testing > ------- > > > Thanks, > > Prasanth_J > > --===============6718540231183791395==--