[ 
https://issues.apache.org/jira/browse/HIVE-10454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14523214#comment-14523214
 ] 

Aihua Xu commented on HIVE-10454:
---------------------------------

Before the change, we only check predicates on TableScan operator. PPD will 
optimize to push the predicates down to TableScan in the most cases. If ppd 
optimization is turned off or the predicates are nondeterministic, then 
predicates are not pushed down to TableScan. See the following example, 

{noformat}
   TableScan
          alias: srcpart
          Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: 
NONE
          Filter Operator
            predicate: (time < 
to_date(date_add(from_unixtime(unix_timestamp()), 1))) (type: boolean)
{noformat}

Before the change, since we only check TableScan operator, then it will always 
throw "No partition predicate found" exception. After the change, we will also 
check the child "Filter Operator" and then it won't throw exceptions.

This predicate check tells the user if the query contains partition predicates 
only and the actual partition pruning logic doesn't change. 

I'm still checking  input39.q unit test. It could be related to my change.



> Query against partitioned table in strict mode failed with "No partition 
> predicate found" even if partition predicate is specified.
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-10454
>                 URL: https://issues.apache.org/jira/browse/HIVE-10454
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Aihua Xu
>            Assignee: Aihua Xu
>         Attachments: HIVE-10454.patch
>
>
> The following queries fail:
> {noformat}
> create table t1 (c1 int) PARTITIONED BY (c2 string);
> set hive.mapred.mode=strict;
> select * from t1 where t1.c2 < to_date(date_add(from_unixtime( 
> unix_timestamp() ),1));
> {noformat}
> The query failed with "No partition predicate found for alias t1".



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to