Ashutosh Chauhan commented on HIVE-10454:

I see point Xuefu is making and I agree with him. For query you pointed :
select * from t1 where t1.c2 < to_date(date_add(from_unixtime( unix_timestamp() 

Your point is in query user has given us has a predicate on partitioning 
column, so exception should not be thrown in strict mode. But the spirit of 
strict mode is not whether predicate is given or not, it is to stop user from 
doing full table scans (reading all rows from disk IO) which will happen in 
this case, since partition pruner cant handle this expression (reason being udf 
being underministic). So, I think we need not to check for filter any where 
else other than on TS.

When exception is thrown in such cases, its telling user that Hive is 
undertaking full table scan, which is disallowed under strict mode. He has two 
options at this point. He need to rewrite his filter to make it more strict (by 
making it deterministic) or get out of strict mode. 

> 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.2.patch, 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

Reply via email to