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

Ashutosh Chauhan edited comment on HIVE-10454 at 5/4/15 7:04 PM:
-----------------------------------------------------------------

I see point [~xuefuz] is making and I agree with him. For query you pointed :
{code:sql}
select * from t1 where t1.c2 < to_date(date_add(from_unixtime( unix_timestamp() 
),1));
{code}

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. 


was (Author: ashutoshc):
I see point Xuefu is making and I agree with him. For query you pointed :
{code:sql}
select * from t1 where t1.c2 < to_date(date_add(from_unixtime( unix_timestamp() 
),1));
{code}

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
(v6.3.4#6332)

Reply via email to