Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6ADB910A91 for ; Mon, 28 Jul 2014 08:09:39 +0000 (UTC) Received: (qmail 33727 invoked by uid 500); 28 Jul 2014 08:09:38 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 33641 invoked by uid 500); 28 Jul 2014 08:09:38 -0000 Mailing-List: contact dev-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 dev@hive.apache.org Received: (qmail 33626 invoked by uid 500); 28 Jul 2014 08:09:38 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 33623 invoked by uid 99); 28 Jul 2014 08:09:38 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jul 2014 08:09:38 +0000 Date: Mon, 28 Jul 2014 08:09:38 +0000 (UTC) From: "Navis (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-1986) partition pruner do not take effect for non-deterministic UDF 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-1986?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14076012#comment-14076012 ] Navis commented on HIVE-1986: ----------------------------- use to_unix_timestamp() instead of unix_timestamp() > partition pruner do not take effect for non-deterministic UDF > ------------------------------------------------------------- > > Key: HIVE-1986 > URL: https://issues.apache.org/jira/browse/HIVE-1986 > Project: Hive > Issue Type: Bug > Components: Query Processor > Affects Versions: 0.4.1, 0.5.0, 0.6.0, 0.7.0 > Environment: trunk-src,hive default configure > Reporter: zhaowei > Fix For: 0.11.0 > > > hive udf can be deterministic or non-deterministic,but for non-deterministic udf such as rand and unix_timestamp,ppr do not take effect. > and for unix_timestamp with para, for example unix_timestamp('2010-01-01'),I think it is deterministic. > case : > hive -hiveconf hive.root.logger=DEBUG,console > create kv_part(key int,value string) partitioned by(ds string); > alter table kv_part add partition (ds=2010) partition (ds=2011) partition (ds=2012); > create kv2(key int,value string) partitioned by(ds string); > alter table kv2 add partition (ds=2013) partition (ds=2014) partition (ds=2015); > explain select * from kv_part join kv2 on(kv_part.key=kv2.key) where kv_part.ds=2011 and rand() > 0.5 > rand() is non-deterministic ,so kv_part.ds=2011 no not filter the partition ds=2010,ds=2012 > ..... > 11/02/14 12:22:32 DEBUG lazy.LazySimpleSerDe: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe initialized with: columnNames=[key, value] columnTypes=[int, string] separator=[[B@1ac9683] nullstring=\N lastColumnTakesRest=false > 11/02/14 12:22:32 INFO hive.log: DDL: struct kv_part { i32 key, string value} > 11/02/14 12:22:32 DEBUG optimizer.GenMapRedUtils: Information added for path hdfs://172.25.38.253:54310/user/hive/warehouse/kv_part/ds=2010 > 11/02/14 12:22:32 DEBUG optimizer.GenMapRedUtils: Information added for path hdfs://172.25.38.253:54310/user/hive/warehouse/kv_part/ds=2011 > 11/02/14 12:22:32 DEBUG optimizer.GenMapRedUtils: Information added for path hdfs://172.25.38.253:54310/user/hive/warehouse/kv_part/ds=2012 > 11/02/14 12:22:32 INFO parse.SemanticAnalyzer: Completed plan generation > ..... > explain select * from kv_part join kv2 on(kv_part.key=kv2.key) where kv_part.ds=2011 and sin(kv2.key) < 0.5; > sin() is deterministic,so ppr work ok > ..... > 11/02/14 12:25:22 DEBUG optimizer.GenMapRedUtils: Information added for path hdfs://172.25.38.253:54310/user/hive/warehouse/kv_part/ds=2011 > .... > And user should get the deterministic info for UDF from wiki,or we shoud add this info to describe function -- This message was sent by Atlassian JIRA (v6.2#6252)