Return-Path: X-Original-To: apmail-hive-issues-archive@minotaur.apache.org Delivered-To: apmail-hive-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B145E186D9 for ; Fri, 19 Feb 2016 22:45:19 +0000 (UTC) Received: (qmail 86121 invoked by uid 500); 19 Feb 2016 22:45:18 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 86038 invoked by uid 500); 19 Feb 2016 22:45:18 -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 85695 invoked by uid 99); 19 Feb 2016 22:45:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Feb 2016 22:45:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 643832C1F6B for ; Fri, 19 Feb 2016 22:45:18 +0000 (UTC) Date: Fri, 19 Feb 2016 22:45:18 +0000 (UTC) From: "Chaoyu Tang (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-13082) Enable constant propagation optimization in query with left semi join MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-13082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15155046#comment-15155046 ] Chaoyu Tang commented on HIVE-13082: ------------------------------------ There are the query results, all work: {code} hive> select table1.id, table1.val, table1.val1 from table1 left semi join table3 on table1.dimid = table3.id and table3.id = 100 where table1.dimid <> 100; OK -- not returned rows, correct hive> select table1.id, table1.val, table1.val1 from table1 left semi join table3 on table1.dimid = table3.id and table3.id = 100 where table1.dimid IN (100,200); OK 1 t1val01 val101 3 t1val01 val104 hive> select table1.id, table1.val, table1.val1 from table1 left semi join table3 on table1.dimid = table3.id and table3.id = 100 where table1.dimid = 200; OK -- no returned rows, correct hive> select table1.id, table1.val, table1.val1 from table1 left semi join table3 on table1.dimid = table3.id and table3.id = 100 where table1.dimid = 100; OK 1 t1val01 val101 3 t1val01 val104 hive> select table1.id, table1.val, table1.val1 from table1 left semi join table3 on table1.dimid = table3.id and table3.id = 100; OK 1 t1val01 val101 3 t1val01 val104 {code} All above queries seem to run successfully and return correct results. Would you like me to add these queries together with their explain plans in the positive test? > Enable constant propagation optimization in query with left semi join > --------------------------------------------------------------------- > > Key: HIVE-13082 > URL: https://issues.apache.org/jira/browse/HIVE-13082 > Project: Hive > Issue Type: Bug > Components: Query Processor > Affects Versions: 2.0.0 > Reporter: Chaoyu Tang > Assignee: Chaoyu Tang > Attachments: HIVE-13082.1.patch, HIVE-13082.patch > > > Currently constant folding is only allowed for inner or unique join, I think it is also applicable and allowed for left semi join. Otherwise the query like following having multiple joins with left semi joins will fail: > {code} > select table1.id, table1.val, table2.val2 from table1 inner join table2 on table1.val = 't1val01' and table1.id = table2.id left semi join table3 on table1.dimid = table3.id; > {code} > with errors: > {code} > java.lang.Exception: java.lang.RuntimeException: Error in configuring object > at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:462) ~[hadoop-mapreduce-client-common-2.6.0.jar:?] > at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:522) [hadoop-mapreduce-client-common-2.6.0.jar:?] > Caused by: java.lang.RuntimeException: Error in configuring object > at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109) ~[hadoop-common-2.6.0.jar:?] > at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75) ~[hadoop-common-2.6.0.jar:?] > at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133) ~[hadoop-common-2.6.0.jar:?] > at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:446) ~[hadoop-mapreduce-client-core-2.6.0.jar:?] > at org.apache.hadoop.mapred.MapTask.run(MapTask.java:343) ~[hadoop-mapreduce-client-core-2.6.0.jar:?] > at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:243) ~[hadoop-mapreduce-client-common-2.6.0.jar:?] > at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) ~[?:1.7.0_45] > at java.util.concurrent.FutureTask.run(FutureTask.java:262) ~[?:1.7.0_45] > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) ~[?:1.7.0_45] > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) ~[?:1.7.0_45] > at java.lang.Thread.run(Thread.java:744) ~[?:1.7.0_45] > ... > Caused by: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3 > at java.util.ArrayList.rangeCheck(ArrayList.java:635) ~[?:1.7.0_45] > at java.util.ArrayList.get(ArrayList.java:411) ~[?:1.7.0_45] > at org.apache.hadoop.hive.serde2.objectinspector.StandardStructObjectInspector.init(StandardStructObjectInspector.java:118) ~[hive-exec-2.1.0-SNAPSHOT.jar:2.1.0-SNAPSHOT] > at org.apache.hadoop.hive.serde2.objectinspector.StandardStructObjectInspector.(StandardStructObjectInspector.java:109) ~[hive-exec-2.1.0-SNAPSHOT.jar:2.1.0-SNAPSHOT] > at org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory.getStandardStructObjectInspector(ObjectInspectorFactory.java:326) ~[hive-exec-2.1.0-SNAPSHOT.jar:2.1.0-SNAPSHOT] > at org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory.getStandardStructObjectInspector(ObjectInspectorFactory.java:311) ~[hive-exec-2.1.0-SNAPSHOT.jar:2.1.0-SNAPSHOT] > at org.apache.hadoop.hive.ql.exec.CommonJoinOperator.getJoinOutputObjectInspector(CommonJoinOperator.java:181) ~[hive-exec-2.1.0-SNAPSHOT.jar:2.1.0-SNAPSHOT] > at org.apache.hadoop.hive.ql.exec.CommonJoinOperator.initializeOp(CommonJoinOperator.java:319) ~[hive-exec-2.1.0-SNAPSHOT.jar:2.1.0-SNAPSHOT] > at org.apache.hadoop.hive.ql.exec.AbstractMapJoinOperator.initializeOp(AbstractMapJoinOperator.java:78) ~[hive-exec-2.1.0-SNAPSHOT.jar:2.1.0-SNAPSHOT] > at org.apache.hadoop.hive.ql.exec.MapJoinOperator.initializeOp(MapJoinOperator.java:138) ~[hive-exec-2.1.0-SNAPSHOT.jar:2.1.0-SNAPSHOT] > at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:355) ~[hive-exec-2.1.0-SNAPSHOT.jar:2.1.0-SNAPSHOT] > at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:504) ~[hive-exec-2.1.0-SNAPSHOT.jar:2.1.0-SNAPSHOT] > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)