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

Maxim Gekk commented on SPARK-28624:
------------------------------------

The problem is in storing values of DATE type to a hive table. The values (days 
since epoch) are converted to java.sql.Date, and after that serialized to 
string by hive-exec *using Date.toString() which is wrong*, see the attached 
screenshot.

> make_date is inconsistent when reading from table
> -------------------------------------------------
>
>                 Key: SPARK-28624
>                 URL: https://issues.apache.org/jira/browse/SPARK-28624
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.0.0
>            Reporter: Yuming Wang
>            Priority: Major
>         Attachments: Screen Shot 2019-08-05 at 18.19.39.png
>
>
> {code:sql}
> spark-sql> create table test_make_date as select make_date(-44, 3, 15) as d;
> spark-sql> select d, make_date(-44, 3, 15) from test_make_date;
> 0045-03-15    -0044-03-15
> spark-sql>
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to