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 1616F2009C6 for ; Mon, 16 May 2016 19:34:15 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 14BFA160131; Mon, 16 May 2016 17:34:15 +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 1B8EE160A19 for ; Mon, 16 May 2016 19:34:13 +0200 (CEST) Received: (qmail 65889 invoked by uid 500); 16 May 2016 17:34:13 -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 65629 invoked by uid 99); 16 May 2016 17:34:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 May 2016 17:34:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id EC4F92C1F5D for ; Mon, 16 May 2016 17:34:12 +0000 (UTC) Date: Mon, 16 May 2016 17:34:12 +0000 (UTC) From: "Jesus Camacho Rodriguez (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-13767) Wrong type inferred in Semijoin condition leads to AssertionError MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 16 May 2016 17:34:15 -0000 [ https://issues.apache.org/jira/browse/HIVE-13767?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Jesus Camacho Rodriguez updated HIVE-13767: ------------------------------------------- Status: Patch Available (was: In Progress) > Wrong type inferred in Semijoin condition leads to AssertionError > ----------------------------------------------------------------- > > Key: HIVE-13767 > URL: https://issues.apache.org/jira/browse/HIVE-13767 > Project: Hive > Issue Type: Bug > Components: CBO > Affects Versions: 2.1.0 > Reporter: Jesus Camacho Rodriguez > Assignee: Jesus Camacho Rodriguez > Attachments: HIVE-13767.patch > > > Following query fails to run: > {noformat} > SELECT > COALESCE(498, LEAD(COALESCE(-973, -684, 515)) OVER (PARTITION BY (t2.= int_col_10 + t1.smallint_col_50) ORDER BY (t2.int_col_10 + t1.smallint_col_= 50), FLOOR(t1.double_col_16) DESC), 524) AS int_col, > (t2.int_col_10) + (t1.smallint_col_50) AS int_col_1, > FLOOR(t1.double_col_16) AS float_col, > COALESCE(SUM(COALESCE(62, -380, -435)) OVER (PARTITION BY (t2.int_col= _10 + t1.smallint_col_50) ORDER BY (t2.int_col_10 + t1.smallint_col_50) DES= C, FLOOR(t1.double_col_16) DESC ROWS BETWEEN UNBOUNDED PRECEDING AND 48 FOL= LOWING), 704) AS int_col_2 > FROM table_1 t1 > INNER JOIN table_18 t2 ON (((t2.tinyint_col_15) =3D (t1.bigint_col_7)) AN= D > ((t2.decimal2709_col_9) =3D (t1.decimal2016_co= l_26))) AND > ((t2.tinyint_col_20) =3D (t1.tinyint_col_3)) > WHERE (t2.smallint_col_19) IN (SELECT > COALESCE(-92, -994) AS int_col > FROM table_1 tt1 > INNER JOIN table_18 tt2 ON (tt2.decimal1911_col_16) =3D (tt1.decimal2= 612_col_77) > WHERE (t1.timestamp_col_9) =3D (tt2.timestamp_col_18)); > {noformat} > Following error is seen in the logs: > {noformat} > 2016-04-27T04:32:09,605 WARN [...2a24 HiveServer2-Handler-Pool: Thread-2= 11]: thrift.ThriftCLIService (ThriftCLIService.java:ExecuteStatement(501)) = - Error executing statement: > org.apache.hive.service.cli.HiveSQLException: Error running query: java.l= ang.AssertionError: mismatched type $8 TIMESTAMP(9) > at org.apache.hive.service.cli.operation.SQLOperation.prepare(SQL= Operation.java:178) ~[hive-service-2.1.0.2.5.0.0-248.jar:2.1.0.2.5.0.0-248] > at org.apache.hive.service.cli.operation.SQLOperation.runInternal= (SQLOperation.java:216) ~[hive-service-2.1.0.2.5.0.0-248.jar:2.1.0.2.5.0.0-= 248] > at org.apache.hive.service.cli.operation.Operation.run(Operation.= java:327) ~[hive-service-2.1.0.2.5.0.0-248.jar:2.1.0.2.5.0.0-248] > at org.apache.hive.service.cli.session.HiveSessionImpl.executeSta= tementInternal(HiveSessionImpl.java:458) ~[hive-service-2.1.0.2.5.0.0-248.j= ar:2.1.0.2.5.0.0-248] > at org.apache.hive.service.cli.session.HiveSessionImpl.executeSta= tementAsync(HiveSessionImpl.java:435) ~[hive-service-2.1.0.2.5.0.0-248.jar:= 2.1.0.2.5.0.0-248] > at org.apache.hive.service.cli.CLIService.executeStatementAsync(C= LIService.java:272) ~[hive-service-2.1.0.2.5.0.0-248.jar:2.1.0.2.5.0.0-248] > at org.apache.hive.service.cli.thrift.ThriftCLIService.ExecuteSta= tement(ThriftCLIService.java:492) [hive-service-2.1.0.2.5.0.0-248.jar:2.1.0= .2.5.0.0-248] > at org.apache.hive.service.rpc.thrift.TCLIService$Processor$Execu= teStatement.getResult(TCLIService.java:1317) [hive-service-rpc-2.1.0.2.5.0.= 0-248.jar:2.1.0.2.5.0.0-248] > at org.apache.hive.service.rpc.thrift.TCLIService$Processor$Execu= teStatement.getResult(TCLIService.java:1302) [hive-service-rpc-2.1.0.2.5.0.= 0-248.jar:2.1.0.2.5.0.0-248] > at org.apache.thrift.ProcessFunction.process(ProcessFunction.java= :39) [hive-exec-2.1.0.2.5.0.0-248.jar:2.1.0.2.5.0.0-248] > at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:3= 9) [hive-exec-2.1.0.2.5.0.0-248.jar:2.1.0.2.5.0.0-248] > at org.apache.hive.service.auth.TSetIpAddressProcessor.process(TS= etIpAddressProcessor.java:56) [hive-service-2.1.0.2.5.0.0-248.jar:2.1.0.2.5= .0.0-248] > at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(T= ThreadPoolServer.java:286) [hive-exec-2.1.0.2.5.0.0-248.jar:2.1.0.2.5.0.0-2= 48] > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolEx= ecutor.java:1142) [?:1.8.0_77] > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolE= xecutor.java:617) [?:1.8.0_77] > at java.lang.Thread.run(Thread.java:745) [?:1.8.0_77] > Caused by: java.lang.AssertionError: mismatched type $8 TIMESTAMP(9) > at org.apache.calcite.rex.RexUtil$FixNullabilityShuttle.visitInpu= tRef(RexUtil.java:2042) ~[calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0-= 248] > at org.apache.calcite.rex.RexUtil$FixNullabilityShuttle.visitInpu= tRef(RexUtil.java:2020) ~[calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0-= 248] > at org.apache.calcite.rex.RexInputRef.accept(RexInputRef.java:112= ) ~[calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0-248] > at org.apache.calcite.rex.RexShuttle.visitList(RexShuttle.java:14= 4) ~[calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0-248] > at org.apache.calcite.rex.RexShuttle.visitCall(RexShuttle.java:93= ) ~[calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0-248] > at org.apache.calcite.rex.RexShuttle.visitCall(RexShuttle.java:36= ) ~[calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0-248] > at org.apache.calcite.rex.RexCall.accept(RexCall.java:108) ~[calc= ite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0-248] > at org.apache.calcite.rex.RexShuttle.apply(RexShuttle.java:275) ~= [calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0-248] > at org.apache.calcite.rex.RexShuttle.mutate(RexShuttle.java:234) = ~[calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0-248] > at org.apache.calcite.rex.RexShuttle.apply(RexShuttle.java:252) ~= [calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0-248] > at org.apache.calcite.rex.RexUtil.fixUp(RexUtil.java:1239) ~[calc= ite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0-248] > at org.apache.calcite.rel.rules.FilterJoinRule.perform(FilterJoin= Rule.java:232) ~[calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0-248] > at org.apache.hadoop.hive.ql.optimizer.calcite.rules.HiveFilterJo= inRule$HiveFilterJoinMergeRule.onMatch(HiveFilterJoinRule.java:78) ~[hive-e= xec-2.1.0.2.5.0.0-248.jar:2.1.0.2.5.0.0-248] > at org.apache.calcite.plan.AbstractRelOptPlanner.fireRule(Abstrac= tRelOptPlanner.java:318) ~[calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0= -248] > at org.apache.hadoop.hive.ql.optimizer.calcite.rules.HiveFilterJo= inRule$HiveFilterJoinMergeRule.onMatch(HiveFilterJoinRule.java:78) ~[hive-e= xec-2.1.0.2.5.0.0-248.jar:2.1.0.2.5.0.0-248] > at org.apache.calcite.plan.AbstractRelOptPlanner.fireRule(Abstrac= tRelOptPlanner.java:318) ~[calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0= -248] > at org.apache.calcite.plan.hep.HepPlanner.applyRule(HepPlanner.ja= va:514) ~[calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0-248] > at org.apache.calcite.plan.hep.HepPlanner.applyRules(HepPlanner.j= ava:392) ~[calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0-248] > at org.apache.calcite.plan.hep.HepPlanner.executeInstruction(HepP= lanner.java:285) ~[calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0-248] > at org.apache.calcite.plan.hep.HepInstruction$RuleCollection.exec= ute(HepInstruction.java:72) ~[calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.= 0.0-248] > at org.apache.calcite.plan.hep.HepPlanner.executeProgram(HepPlann= er.java:207) ~[calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0-248] > at org.apache.calcite.plan.hep.HepPlanner.findBestExp(HepPlanner.= java:194) ~[calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0-248] > at org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerA= ction.hepPlan(CalcitePlanner.java:1293) ~[hive-exec-2.1.0.2.5.0.0-248.jar:2= .1.0.2.5.0.0-248] > at org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerA= ction.applyPreJoinOrderingTransforms(CalcitePlanner.java:1166) ~[hive-exec-= 2.1.0.2.5.0.0-248.jar:2.1.0.2.5.0.0-248] > at org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerA= ction.apply(CalcitePlanner.java:956) ~[hive-exec-2.1.0.2.5.0.0-248.jar:2.1.= 0.2.5.0.0-248] > at org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerA= ction.apply(CalcitePlanner.java:887) ~[hive-exec-2.1.0.2.5.0.0-248.jar:2.1.= 0.2.5.0.0-248] > at org.apache.calcite.tools.Frameworks$1.apply(Frameworks.java:11= 3) ~[calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0-248] > at org.apache.calcite.prepare.CalcitePrepareImpl.perform(CalciteP= repareImpl.java:969) ~[calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0-248= ] > at org.apache.calcite.tools.Frameworks.withPrepare(Frameworks.jav= a:149) ~[calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0-248] > at org.apache.calcite.tools.Frameworks.withPlanner(Frameworks.jav= a:106) ~[calcite-core-1.6.0.2.5.0.0-248.jar:1.6.0.2.5.0.0-248] > at org.apache.hadoop.hive.ql.parse.CalcitePlanner.getOptimizedAST= (CalcitePlanner.java:706) ~[hive-exec-2.1.0.2.5.0.0-248.jar:2.1.0.2.5.0.0-2= 48] > at org.apache.hadoop.hive.ql.parse.CalcitePlanner.genOPTree(Calci= tePlanner.java:274) ~[hive-exec-2.1.0.2.5.0.0-248.jar:2.1.0.2.5.0.0-248] > at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeIntern= al(SemanticAnalyzer.java:10642) ~[hive-exec-2.1.0.2.5.0.0-248.jar:2.1.0.2.5= .0.0-248] > at org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal= (CalcitePlanner.java:233) ~[hive-exec-2.1.0.2.5.0.0-248.jar:2.1.0.2.5.0.0-2= 48] > at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(B= aseSemanticAnalyzer.java:245) ~[hive-exec-2.1.0.2.5.0.0-248.jar:2.1.0.2.5.0= .0-248] > at org.apache.hadoop.hive.ql.parse.ExplainSemanticAnalyzer.analyz= eInternal(ExplainSemanticAnalyzer.java:74) ~[hive-exec-2.1.0.2.5.0.0-248.ja= r:2.1.0.2.5.0.0-248] > at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(B= aseSemanticAnalyzer.java:245) ~[hive-exec-2.1.0.2.5.0.0-248.jar:2.1.0.2.5.0= .0-248] > at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:476) ~[hi= ve-exec-2.1.0.2.5.0.0-248.jar:2.1.0.2.5.0.0-248] > at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:318) ~[hi= ve-exec-2.1.0.2.5.0.0-248.jar:2.1.0.2.5.0.0-248] > at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1= 191) ~[hive-exec-2.1.0.2.5.0.0-248.jar:2.1.0.2.5.0.0-248] > ... 15 more > {noformat} > Hive DDL for supporting tables are: > {noformat} > CREATE TABLE table_1 (timestamp_col_1 TIMESTAMP, decimal3003_col_2 DECIMA= L(30, 3), tinyint_col_3 TINYINT, decimal0101_col_4 DECIMAL(1, 1), boolean_c= ol_5 BOOLEAN, float_col_6 FLOAT, bigint_col_7 BIGINT, varchar0098_col_8 VAR= CHAR(98), timestamp_col_9 TIMESTAMP, bigint_col_10 BIGINT, decimal0903_col_= 11 DECIMAL(9, 3), timestamp_col_12 TIMESTAMP, timestamp_col_13 TIMESTAMP, f= loat_col_14 FLOAT, char0254_col_15 CHAR(254), double_col_16 DOUBLE, timesta= mp_col_17 TIMESTAMP, boolean_col_18 BOOLEAN, decimal2608_col_19 DECIMAL(26,= 8), varchar0216_col_20 VARCHAR(216), string_col_21 STRING, bigint_col_22 B= IGINT, boolean_col_23 BOOLEAN, timestamp_col_24 TIMESTAMP, boolean_col_25 B= OOLEAN, decimal2016_col_26 DECIMAL(20, 16), string_col_27 STRING, decimal02= 02_col_28 DECIMAL(2, 2), float_col_29 FLOAT, decimal2020_col_30 DECIMAL(20,= 20), boolean_col_31 BOOLEAN, double_col_32 DOUBLE, varchar0148_col_33 VARC= HAR(148), decimal2121_col_34 DECIMAL(21, 21), tinyint_col_35 TINYINT, boole= an_col_36 BOOLEAN, boolean_col_37 BOOLEAN, string_col_38 STRING, decimal342= 0_col_39 DECIMAL(34, 20), timestamp_col_40 TIMESTAMP, decimal1408_col_41 DE= CIMAL(14, 8), string_col_42 STRING, decimal0902_col_43 DECIMAL(9, 2), varch= ar0204_col_44 VARCHAR(204), boolean_col_45 BOOLEAN, timestamp_col_46 TIMEST= AMP, boolean_col_47 BOOLEAN, bigint_col_48 BIGINT, boolean_col_49 BOOLEAN, = smallint_col_50 SMALLINT, decimal0704_col_51 DECIMAL(7, 4), timestamp_col_5= 2 TIMESTAMP, boolean_col_53 BOOLEAN, timestamp_col_54 TIMESTAMP, int_col_55= INT, decimal0505_col_56 DECIMAL(5, 5), char0155_col_57 CHAR(155), boolean_= col_58 BOOLEAN, bigint_col_59 BIGINT, boolean_col_60 BOOLEAN, boolean_col_6= 1 BOOLEAN, char0249_col_62 CHAR(249), boolean_col_63 BOOLEAN, timestamp_col= _64 TIMESTAMP, decimal1309_col_65 DECIMAL(13, 9), int_col_66 INT, float_col= _67 FLOAT, timestamp_col_68 TIMESTAMP, timestamp_col_69 TIMESTAMP, boolean_= col_70 BOOLEAN, timestamp_col_71 TIMESTAMP, double_col_72 DOUBLE, boolean_c= ol_73 BOOLEAN, char0222_col_74 CHAR(222), float_col_75 FLOAT, string_col_76= STRING, decimal2612_col_77 DECIMAL(26, 12), timestamp_col_78 TIMESTAMP, ch= ar0128_col_79 CHAR(128), timestamp_col_80 TIMESTAMP, double_col_81 DOUBLE, = timestamp_col_82 TIMESTAMP, float_col_83 FLOAT, decimal2622_col_84 DECIMAL(= 26, 22), double_col_85 DOUBLE, float_col_86 FLOAT, decimal0907_col_87 DECIM= AL(9, 7)) STORED AS orc; > CREATE TABLE table_18 (boolean_col_1 BOOLEAN, boolean_col_2 BOOLEAN, deci= mal2518_col_3 DECIMAL(25, 18), float_col_4 FLOAT, timestamp_col_5 TIMESTAMP= , double_col_6 DOUBLE, double_col_7 DOUBLE, char0035_col_8 CHAR(35), decima= l2709_col_9 DECIMAL(27, 9), int_col_10 INT, timestamp_col_11 TIMESTAMP, dec= imal3604_col_12 DECIMAL(36, 4), string_col_13 STRING, int_col_14 INT, tinyi= nt_col_15 TINYINT, decimal1911_col_16 DECIMAL(19, 11), float_col_17 FLOAT, = timestamp_col_18 TIMESTAMP, smallint_col_19 SMALLINT, tinyint_col_20 TINYIN= T, timestamp_col_21 TIMESTAMP, boolean_col_22 BOOLEAN, int_col_23 INT) STOR= ED AS orc; > {noformat} > The problem is that the reference indices in the condition (and thus, the= ir type) are inferred incorrectly. -- This message was sent by Atlassian JIRA (v6.3.4#6332)