From issues-return-130743-archive-asf-public=cust-asf.ponee.io@hive.apache.org Mon Jul 30 05:49:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 402CA18067C for ; Mon, 30 Jul 2018 05:49:05 +0200 (CEST) Received: (qmail 47677 invoked by uid 500); 30 Jul 2018 03:49:04 -0000 Mailing-List: contact issues-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 issues@hive.apache.org Received: (qmail 47471 invoked by uid 99); 30 Jul 2018 03:49:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jul 2018 03:49:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 8DD03C0940 for ; Mon, 30 Jul 2018 03:49:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id n4lF3FKi_vgo for ; Mon, 30 Jul 2018 03:49:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 7E4C85F30C for ; Mon, 30 Jul 2018 03:49:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E5FC1E260D for ; Mon, 30 Jul 2018 03:49:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4A49F27762 for ; Mon, 30 Jul 2018 03:49:00 +0000 (UTC) Date: Mon, 30 Jul 2018 03:49:00 +0000 (UTC) From: "Ganesha Shreedhara (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Issue Comment Deleted] (HIVE-20220) Incorrect result when hive.groupby.skewindata is enabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-20220?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Ganesha Shreedhara updated HIVE-20220: -------------------------------------- Comment: was deleted (was: Can someone review this patch please? Please let me know if there is = a better way of fixing this. I can update the qtest files based on the fix.= =C2=A0 =C2=A0) > Incorrect result when hive.groupby.skewindata is enabled > -------------------------------------------------------- > > Key: HIVE-20220 > URL: https://issues.apache.org/jira/browse/HIVE-20220 > Project: Hive > Issue Type: Bug > Components: Query Processor > Affects Versions: 3.0.0 > Reporter: Ganesha Shreedhara > Assignee: Ganesha Shreedhara > Priority: Major > > hive.groupby.skewindata makes use of rand UDF to randomly distribute grou= ped by keys to the reducers and hence avoids overloading a single reducer w= hen there is a skew in data.=C2=A0 > This random distribution of keys is buggy when the reducer fails to fetch= the mapper output due to a faulty datanode or any other reason. When reduc= er finds that it can't fetch mapper output, it sends a signal to Applicatio= n Master to reattempt the corresponding map task.=C2=A0The reattempted map = task will now get the different random value from rand function and hence t= he keys that gets distributed now to the reducer will not be same as the pr= evious run.=C2=A0 > =C2=A0 > *Steps to reproduce:* > create table test(id int); > insert into test values (1),(2),(2),(3),(3),(3),(4),(4),(4),(4),(5),(5),(= 5),(5),(5),(6),(6),(6),(6),(6),(6),(7),(7),(7),(7),(7),(7),(7),(7),(8),(8),= (8),(8),(8),(8),(8),(8),(9),(9),(9),(9),(9),(9),(9),(9),(9); > SET hive.groupby.skewindata=3Dtrue; > SET=C2=A0mapreduce.reduce.reduces=3D2; > //Add a debug port for reducer > select count(1) from test group by id; > //Remove mapper's intermediate output file when map stage is completed an= d one out of 2 reduce tasks is completed and then continue the run. This ca= uses 2nd reducer to send event to Application Master to rerun the map task.= =C2=A0 > The following is the expected result.=C2=A0 > 1 > 2 > 3 > 4 > 5 > 6 > 8 > 8 > 9=C2=A0 > =C2=A0 > But you may get different result due to a different value returned by the= rand function in the second run causing different distribution of keys. > This=C2=A0needs to be fixed such that the mapper distributes the same key= s even if it is reattempted multiple times.=C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)