[
https://issues.apache.org/jira/browse/HIVE-14661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17165571#comment-17165571
]
zhishui commented on HIVE-14661:
--------------------------------
I has fix this issuce with commit
https://github.com/letsflyinthesky/hive/commit/ee24112887f523d0cbba4a6f91d958f3d48cd984,
you could pull and have a try
> Hive should extract deterministic conditions from where clause and use them
> for partition pruning
> -------------------------------------------------------------------------------------------------
>
> Key: HIVE-14661
> URL: https://issues.apache.org/jira/browse/HIVE-14661
> Project: Hive
> Issue Type: Improvement
> Reporter: Yibing Shi
> Priority: Major
>
> Currently, if a non-deterministic function is used in where clause, partition
> pruning doesn't work. This can be reproduced as below:
> {code:sql}
> create table part1 (id int, content string) partitioned by (p int);
> alter table part1 add partition(p=1);
> alter table part1 add partition(p=2);
> create table part2 (id int, another_content string);
> set hive.mapred.mode=strict;
> set hive.cbo.enable=false;
> explain select p1.id, p1.content, p2.another_content from part1 p1 join part2
> p2 on p1.id=p2.id where p1.p=1 and rand < 0.5;
> {code}
> The last query would fail with below error:
> {noformat}
> 16/08/23 23:55:52 ERROR ql.Driver: [main]: FAILED: SemanticException [Error
> 10041]: No partition predicate found for Alias "p1" Table "part1"
> org.apache.hadoop.hive.ql.parse.SemanticException: No partition predicate
> found for Alias "p1" Table "part1"
> {noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)