Hive
  1. Hive
  2. HIVE-3822

Casting from double to timestamp type seems inconsistent

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.9.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      select cast(1355944339 as timestamp) from decimal_3 limit 1;
      1970-01-16 08:39:04.339
      
      select cast(1355944339000 as timestamp) from decimal_3 limit 1;
      2012-12-19 11:12:19
      
      select cast(1355944339.123456789 as timestamp) from decimal_3 limit 1;
      2012-12-19 11:12:19.1234567
      

      If specifying the unixTimestamp without a decimal point, we need to specify the millisecond timestamp. If specifying with a decimal point, we need to specify only the second timestamp and the rest goes after decimal. Moreover, it seems like some precision is lost (notice '89' are lost in the last query.

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Mark Grover
              Reporter:
              Mark Grover
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:

                Development