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

Ashutosh Chauhan edited comment on HIVE-6934 at 10/14/14 12:01 AM:
-------------------------------------------------------------------

Can you also add following tests in your patch:
{code}
explain select count(1) from srcpart where true;
explain select count(1) from srcpart where false;
explain select count(1) from srcpart where true and hr='11';
explain select count(1) from srcpart where true or hr='11';
explain select count(1) from srcpart where false or hr='11';
explain select count(1) from srcpart where false and hr='11';
{code}


was (Author: ashutoshc):
Can you also add following tests in your patch:
{code}
select count(1) from x where true;
select count(1) from x where false;
select * from x where key = 'abc' or key > 5;
select count(1) from x where true and ts='2001-01-02';
select count(1) from x where true or ts='2001-01-02';
select count(1) from x where false or ts = '2010';
select count(1) from x where false and ts = '2010';
{code}

> PartitionPruner doesn't handle top level constant expression correctly
> ----------------------------------------------------------------------
>
>                 Key: HIVE-6934
>                 URL: https://issues.apache.org/jira/browse/HIVE-6934
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Harish Butani
>            Assignee: Hari Sankar Sivarama Subramaniyan
>            Priority: Critical
>             Fix For: 0.14.0
>
>         Attachments: HIVE-6934.4.patch, HIVE-6934.5.patch, HIVE-6934.6.patch, 
> HIVE-6934.7.patch
>
>
> You hit this error indirectly, because how we handle invalid constant 
> comparisons. Consider:
> {code}
> create table x(key int, value string) partitioned by (dt int, ts string);
> -- both these queries hit this issue
> select * from x where key = 'abc';
> select * from x where dt = 'abc';
> -- the issue is the comparison get converted to the constant false
> -- and the PartitionPruner doesn't handle top level constant exprs corrcetly
> {code}
> Thanks to [~hsubramaniyan] for uncovering this as part of adding tests for 
> HIVE-5376



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

Reply via email to