From issues-return-133527-archive-asf-public=cust-asf.ponee.io@hive.apache.org Tue Aug 21 17:17:04 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 95D57180630 for ; Tue, 21 Aug 2018 17:17:03 +0200 (CEST) Received: (qmail 26846 invoked by uid 500); 21 Aug 2018 15:17:02 -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 26836 invoked by uid 99); 21 Aug 2018 15:17:02 -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; Tue, 21 Aug 2018 15:17:02 +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 2D2811A1AFA for ; Tue, 21 Aug 2018 15:17:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, 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 (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id uisI-OlkGmiG for ; Tue, 21 Aug 2018 15:17: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 08A9C5F1BD for ; Tue, 21 Aug 2018 15:17: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 86DFFE02EB for ; Tue, 21 Aug 2018 15:17: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 352D82469B for ; Tue, 21 Aug 2018 15:17:00 +0000 (UTC) Date: Tue, 21 Aug 2018 15:17:00 +0000 (UTC) From: "Zoltan Haindrich (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-18624) Parsing time is extremely high (~10 min) for queries with complex select expressions 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-18624?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1658= 7574#comment-16587574 ]=20 Zoltan Haindrich commented on HIVE-18624: ----------------------------------------- [~ashutoshc] Could you please take a look? > Parsing time is extremely high (~10 min) for queries with complex select = expressions > -------------------------------------------------------------------------= ----------- > > Key: HIVE-18624 > URL: https://issues.apache.org/jira/browse/HIVE-18624 > Project: Hive > Issue Type: Bug > Components: Hive, Parser > Affects Versions: 3.0.0, 2.3.2 > Reporter: Amruth S > Assignee: Zoltan Haindrich > Priority: Major > Attachments: HIVE-18624.01.patch, thread_dump > > > Explain of the same query takes > 0.1 to 3=C2=A0seconds in hive 2.1.0 & > 10-15=C2=A0min in hive 2.3.2 & latest master > Sample expression below > {code:java} > EXPLAIN > SELECT DISTINCT > IF(lower('a') <=3D lower('a') > ,'a' > ,IF(('a' IS NULL AND from_unixtime(UNIX_TIMESTAMP()) <=3D 'a') > ,'a' > ,IF(if('a' =3D 'a', TRUE, FALSE) =3D 1 > ,'a' > ,IF(('a' =3D 1 and lower('a') NOT IN ('a', 'a') > and lower(if('a' =3D 'a','a','a')) <=3D lower('a')) > OR ('a' like 'a' OR 'a' like 'a') > OR 'a' in ('a','a') > ,'a' > ,IF(if(lower('a') in ('a', 'a') and 'a'=3D'a', TRUE, FALSE) =3D 1 > ,'a' > ,IF('a'=3D'a' and unix_timestamp(if('a' =3D 'a',cast('a' as string),coa= lesce('a',cast('a' as string),from_unixtime(unix_timestamp())))) <=3D unix_= timestamp(concat_ws('a',cast(lower('a') as string),'00:00:00')) + 9*3600 > ,'a' > ,If(lower('a') <=3D lower('a') > and if(lower('a') in ('a', 'a') and 'a'<>'a', TRUE, FALSE) <> 1 > ,'a' > ,IF('a'=3D1 AND 'a'=3D1 > ,'a' > ,IF('a' =3D 1 and COALESCE(cast('a' as int),0) =3D 0 > ,'a' > ,IF('a' =3D 'a' > ,'a' > ,If('a' =3D 'a' AND lower('a')>lower(if(lower('a')<1830,'a',cast(date_a= dd('a',1) as timestamp))) > ,'a' > ,IF('a' =3D 1 > ,IF('a' in ('a', 'a') and ((unix_timestamp('a')-unix_timestamp('a')) / = 60) > 30 and 'a' =3D 1 > ,'a', 'a') > ,IF(if('a' =3D 'a', FALSE, TRUE ) =3D 1 AND 'a' IS NULL > ,'a' > ,IF('a' =3D 1 and 'a'>0 > , 'a' > ,IF('a' =3D 1 AND 'a' =3D'a' > ,'a' > ,IF('a' is not null and 'a' is not null and 'a' > 'a' > ,'a' > ,IF('a' =3D 1 > ,'a' > ,IF('a' =3D 'a' > ,'a' > ,If('a' =3D 1 > ,'a' > ,IF('a' =3D 1 > ,'a' > ,IF('a' =3D 1 > ,'a' > ,IF('a' =3D'a' and 'a' =3D'a' and cast(unix_timestamp('a') as int) + 9= 3600 < cast(unix_timestamp() as int) > ,'a' > ,IF('a' =3D 'a' > ,'a' > ,IF('a' =3D 'a' and 'a' in ('a','a','a') > ,'a' > ,IF('a' =3D 'a' > ,'a','a')) > ))))))))))))))))))))))) > AS test_comp_exp > {code} > =C2=A0 > Taking a look at [^thread_dump] shows a very large function stack getting= created. > Reverting=C2=A0HIVE-15578 (92f31d07aa988d4a460aac56e369bfa386361776) seem= to speed up the parsing. > =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)