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

Jason Dere commented on HIVE-4800:
----------------------------------

Looks like the root cause of this is HIVE-2703 - if the partition column was 
correctly treated as the timestamp type rather than as a string type then this 
would not be an issue. 
Noticed this same issue during while making changes for Date type (HIVE-4055), 
though I did a workaround by allowing comparisons between string and date 
types. We could do the same here for timestamps.
                
> Partition pruning doesn't work properly with timestamp type
> -----------------------------------------------------------
>
>                 Key: HIVE-4800
>                 URL: https://issues.apache.org/jira/browse/HIVE-4800
>             Project: Hive
>          Issue Type: Bug
>          Components: Types
>    Affects Versions: 0.11.0
>            Reporter: Jason Dere
>
> During partition pruning the partition columns are treated as string values, 
> even if the partition table was defined as being of type timestamp.  If the 
> user specifies a predicate with a Timestamp type, the comparison does not 
> work correctly between the string and date types.  
> For example:
> create table part1 (
>   c1 int, 
>   c2 string
> ) partitioned by (dt timestamp);
> insert overwrite table part1 partition(dt='2001-01-01 01:02:03')
>   select key, value from src limit 2; 
> -- This query returns no results
> select * from part1 where dt=timestamp('2001-01-01 01:02:03');
> -- This query works fine
> select * from part1 where dt='2001-01-01 01:02:03';
> A workaround is to simply not use the timestamp() function and simply compare 
> the values as strings, as is done in the 2nd query. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to