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

Druid Needs Explicit CASTs from Timestamp to STRING when the output of timestamp function is used as String

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Druid timestamp expression functions returns numeric values in form of millis since epoch.
      Functions that use the output of the timestamp functions as String return different values for tables stored in HIVE and Druid.

      SELECT SUBSTRING(to_date(datetime0),4) FROM tableau_orc.calcs;
      | 4-07-25  |
      
      SELECT SUBSTRING(to_date(datetime0),4) FROM druid_tableau.calcs;
      | 0022400000  |
      
      SELECT CONCAT(to_date(datetime0),' 00:00:00') FROM tableau_orc.calcs;
      | 2004-07-17 00:00:00  |
      
      SELECT CONCAT(to_date(datetime0),' 00:00:00') FROM druid_tableau.calcs;
      | 1090454400000 00:00:00  |
      

      We need to add explicit CAST to String before generating Druid expressions.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                nishantbangarwa Nishant Bangarwa
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: