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

Problem with CAST(BIGINT as TIMESTAMP)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.8.0, 0.8.1, 0.9.0, 0.10.0, 0.11.0, 0.12.0, 0.13.0, 0.13.1
    • Fix Version/s: 1.2.0
    • Component/s: Types, UDF
    • Labels:
    • Hadoop Flags:
      Incompatible change
    • Release Note:
      Hide
      The behaviors of converting from BOOLEAN/TINYINT/SMALLINT/INT/BIGINT and converting from FLOAT/DOUBLE to TIMESTAMP were inconsistent. The value of a BOOLEAN/TINYINT/SMALLINT/INT/BIGINT was treated as the time in milliseconds while the value of a FLOAT/DOUBLE was treated as the time in seconds. After the change, all the types during the conversion are interpreted in seconds.
      Show
      The behaviors of converting from BOOLEAN/TINYINT/SMALLINT/INT/BIGINT and converting from FLOAT/DOUBLE to TIMESTAMP were inconsistent. The value of a BOOLEAN/TINYINT/SMALLINT/INT/BIGINT was treated as the time in milliseconds while the value of a FLOAT/DOUBLE was treated as the time in seconds. After the change, all the types during the conversion are interpreted in seconds.
    • Tags:
      timestamp

      Description

      Ran into an issue while working with timestamp conversion.
      CAST(unix_timestamp() as TIMESTAMP) should create a timestamp for the current time from the BIGINT returned by unix_timestamp()

      Instead, however, a 1970-01-16 timestamp is returned.

        Attachments

        1. HIVE-3454.1.patch.txt
          0.5 kB
          Paul Bergeron
        2. HIVE-3454.patch
          0.9 kB
          Arijit Banerjee
        3. HIVE-3454.3.patch
          302 kB
          Aihua Xu

          Issue Links

            Activity

              People

              • Assignee:
                aihuaxu Aihua Xu
                Reporter:
                rharris Ryan Harris
              • Votes:
                6 Vote for this issue
                Watchers:
                20 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: