Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-21295

StorageHandler shall convert date to string using Hive convention

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0.0-alpha-1
    • None
    • None
    • Reviewed

    Description

      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

      Attachments

        1. HIVE-21295.1.patch
          8 kB
          Daniel Dai
        2. HIVE-21295.2.patch
          8 kB
          Daniel Dai

        Activity

          People

            daijy Daniel Dai
            daijy Daniel Dai
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: