[ 
https://issues.apache.org/jira/browse/DRILL-5002?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rahul Challapalli updated DRILL-5002:
-------------------------------------
    Attachment: 0_0_0.parquet

Check the exact same query that I ran from the above comment. The below query 
is also one good example

*DRILL* : Wrong Result
{code}
select l_shipdate, last_day(l_shipdate) from hive.lineitem where l_shipdate = 
date '1994-02-01' limit 2;
+-------------+-------------+
| l_shipdate  |   EXPR$1    |
+-------------+-------------+
| 1994-02-01  | 1994-01-31  |
| 1994-02-01  | 1994-01-31  |
+-------------+-------------+
2 rows selected (0.402 seconds)
{code}

*HIVE* : Correct Result
{code}
hive> select l_shipdate, `last_day`(l_shipdate) from lineitem where l_shipdate 
= date '1994-02-01' limit 2;
OK
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further 
details.
1994-02-01      1994-02-28
1994-02-01      1994-02-28
Time taken: 1.608 seconds, Fetched: 2 row(s)
{code}

> Using hive's date functions on top of date column in parquet gives wrong 
> results
> --------------------------------------------------------------------------------
>
>                 Key: DRILL-5002
>                 URL: https://issues.apache.org/jira/browse/DRILL-5002
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Hive, Storage - Parquet
>            Reporter: Rahul Challapalli
>            Assignee: Vitalii Diravka
>            Priority: Critical
>         Attachments: 0_0_0.parquet
>
>
> git.commit.id.abbrev=190d5d4
> Wrong Result 1 :
> {code}
> select l_shipdate, `month`(l_shipdate) from cp.`tpch/lineitem.parquet` where 
> l_shipdate = date '1994-02-01' limit 2;
> +-------------+---------+
> | l_shipdate  | EXPR$1  |
> +-------------+---------+
> | 1994-02-01  | 1       |
> | 1994-02-01  | 1       |
> +-------------+---------+
> {code}
> Wrong Result 2 : 
> {code}
> select l_shipdate, `day`(l_shipdate) from cp.`tpch/lineitem.parquet` where 
> l_shipdate = date '1998-06-02' limit 2;
> +-------------+---------+
> | l_shipdate  | EXPR$1  |
> +-------------+---------+
> | 1998-06-02  | 1       |
> | 1998-06-02  | 1       |
> +-------------+---------+
> {code}
> Correct Result :
> {code}
> select l_shipdate, `month`(l_shipdate) from cp.`tpch/lineitem.parquet` where 
> l_shipdate = date '1998-06-02' limit 2;
> +-------------+---------+
> | l_shipdate  | EXPR$1  |
> +-------------+---------+
> | 1998-06-02  | 6       |
> | 1998-06-02  | 6       |
> +-------------+---------+
> {code}
> It looks like we are getting wrong results when the 'day' is '01'. I only 
> tried month and day hive functions....but wouldn't be surprised if they have 
> similar issues too.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to