Return-Path: Delivered-To: apmail-hadoop-hive-dev-archive@minotaur.apache.org Received: (qmail 25100 invoked from network); 17 Feb 2010 14:49:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Feb 2010 14:49:52 -0000 Received: (qmail 9279 invoked by uid 500); 17 Feb 2010 14:49:51 -0000 Delivered-To: apmail-hadoop-hive-dev-archive@hadoop.apache.org Received: (qmail 9247 invoked by uid 500); 17 Feb 2010 14:49:51 -0000 Mailing-List: contact hive-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hadoop.apache.org Delivered-To: mailing list hive-dev@hadoop.apache.org Received: (qmail 9192 invoked by uid 99); 17 Feb 2010 14:49:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Feb 2010 14:49:51 +0000 X-ASF-Spam-Status: No, hits=-1999.6 required=10.0 tests=ALL_TRUSTED,SUBJECT_FUZZY_TION X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Feb 2010 14:49:49 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 273BD29A0021 for ; Wed, 17 Feb 2010 06:49:28 -0800 (PST) Message-ID: <1439044716.334851266418168159.JavaMail.jira@brutus.apache.org> Date: Wed, 17 Feb 2010 14:49:28 +0000 (UTC) From: "Namit Jain (JIRA)" To: hive-dev@hadoop.apache.org Subject: [jira] Commented: (HIVE-1173) Partition pruner cancels pruning if non-deterministic function present in filtering expression only in joins is present in query In-Reply-To: <818832840.287991266273147878.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HIVE-1173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12834788#action_12834788 ] Namit Jain commented on HIVE-1173: ---------------------------------- I think we should fix this for 0.5 also > Partition pruner cancels pruning if non-deterministic function present in filtering expression only in joins is present in query > -------------------------------------------------------------------------------------------------------------------------------- > > Key: HIVE-1173 > URL: https://issues.apache.org/jira/browse/HIVE-1173 > Project: Hadoop Hive > Issue Type: Bug > Components: Query Processor > Affects Versions: 0.4.0, 0.4.1 > Reporter: Vladimir Klimontovich > > Brief description: > case 1) non-deterministic present in partition condition, joins are present in query => partition pruner doesn't do filtering of partitions based on condition > case 2) non-deterministic present in partition condition, joins aren't present in query => partition pruner do filtering of partitions based on condition > It's quite illogical when pruning depends on presence of joins in query. > Example: > Let's consider following sequence of hive queries: > 1) Create non-deterministic function: > create temporary function UDF2 as 'UDF2'; > {{ > import org.apache.hadoop.hive.ql.exec.UDF; > import org.apache.hadoop.hive.ql.udf.UDFType; > @UDFType(deterministic=false) > public class UDF2 extends UDF { > public String evaluate(String val) { > return val; > } > } > }} > 2) Create tables > CREATE TABLE Main ( > a STRING, > b INT > ) > PARTITIONED BY(part STRING) > ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' > LINES TERMINATED BY '10' > STORED AS TEXTFILE; > ALTER TABLE Main ADD PARTITION (part="part1") LOCATION "/hive-join-test/part1/"; > ALTER TABLE Main ADD PARTITION (part="part2") LOCATION "/hive-join-test/part2/"; > CREATE TABLE Joined ( > a STRING, > f STRING > ) > ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' > LINES TERMINATED BY '10' > STORED AS TEXTFILE > LOCATION '/hive-join-test/join/'; > 3) Run first query: > select > m.a, > m.b > from Main m > where > part > UDF2('part0') AND part = 'part1'; > The pruner will work for this query: mapred.input.dir=hdfs://localhost:9000/hive-join-test/part1 > 4) Run second query (with join): > select > m.a, > j.a, > m.b > from Main m > join Joined j on > j.a=m.a > where > part > UDF2('part0') AND part = 'part1'; > Pruner doesn't work: mapred.input.dir=hdfs://localhost:9000/hive-join-test/part1,hdfs://localhost:9000/hive-join-test/part2,hdfs://localhost:9000/hive-join-test/join > 5) Also lets try to run query with MAPJOIN hint > select /*+MAPJOIN(j)*/ > m.a, > j.a, > m.b > from Main m > join Joined j on > j.a=m.a > where > part > UDF2('part0') AND part = 'part1'; > The result is the same, pruner doesn't work: mapred.input.dir=hdfs://localhost:9000/hive-join-test/part1,hdfs://localhost:9000/hive-join-test/part2 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.