You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Daniel Dai (JIRA)" <ji...@apache.org> on 2019/02/20 03:40:00 UTC

[jira] [Created] (HIVE-21295) StorageHandler shall convert date to string using Hive convention

Daniel Dai created HIVE-21295:
---------------------------------

             Summary: StorageHandler shall convert date to string using Hive convention
                 Key: HIVE-21295
                 URL: https://issues.apache.org/jira/browse/HIVE-21295
             Project: Hive
          Issue Type: Improvement
            Reporter: Daniel Dai
            Assignee: Daniel Dai
         Attachments: HIVE-21295.1.patch

If we have date datatype in mysql, string datatype defined in hive, JdbcStorageHandler will translate the date to string with the format yyyy-MM-dd HH:mm:ss. However, Hive convention is yyyy-MM-dd, we shall follow Hive convention. Eg:

mysql: CREATE TABLE test ("datekey" DATE);
hive: CREATE TABLE test (datekey string) STORED BY 'org.apache.hive.storage.jdbc.JdbcStorageHandler' TBLPROPERTIES (......"hive.sql.table" = "test"......);

Then in hive, do: select datekey from test;

We get: 1999-03-24 00:00:00

But should be: 1999-03-24



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)