Hive
  1. Hive
  2. HIVE-3454

Problem with CAST(BIGINT as TIMESTAMP)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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.

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

        Issue Links

          Activity

          Aihua Xu made changes -
          Link This issue is related to HIVE-11168 [ HIVE-11168 ]
          Sushanth Sowmyan made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Chao Sun made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Fix Version/s 1.2.0 [ 12329345 ]
          Resolution Fixed [ 1 ]
          Aihua Xu made changes -
          Status In Progress [ 3 ] Patch Available [ 10002 ]
          Aihua Xu made changes -
          Attachment HIVE-3454.3.patch [ 12706362 ]
          Aihua Xu made changes -
          Status Patch Available [ 10002 ] In Progress [ 3 ]
          Aihua Xu made changes -
          Attachment HIVE-3454.3.patch [ 12706162 ]
          Aihua Xu made changes -
          Status In Progress [ 3 ] Patch Available [ 10002 ]
          Aihua Xu made changes -
          Attachment HIVE-3454.3.patch [ 12706162 ]
          Aihua Xu made changes -
          Attachment HIVE-3454.3.patch [ 12705949 ]
          Aihua Xu made changes -
          Status Patch Available [ 10002 ] In Progress [ 3 ]
          Aihua Xu made changes -
          Status In Progress [ 3 ] Patch Available [ 10002 ]
          Aihua Xu made changes -
          Attachment HIVE-3454.3.patch [ 12705949 ]
          Aihua Xu made changes -
          Attachment HIVE-3454.3.patch [ 12705945 ]
          Aihua Xu made changes -
          Status Patch Available [ 10002 ] In Progress [ 3 ]
          Aihua Xu made changes -
          Status In Progress [ 3 ] Patch Available [ 10002 ]
          Aihua Xu made changes -
          Status Patch Available [ 10002 ] In Progress [ 3 ]
          Aihua Xu made changes -
          Attachment HIVE-3454.3.patch [ 12705945 ]
          Aihua Xu made changes -
          Attachment HIVE-3454.3.patch [ 12697536 ]
          Aihua Xu made changes -
          Attachment HIVE-3454.2.patch [ 12697289 ]
          Aihua Xu made changes -
          Status In Progress [ 3 ] Patch Available [ 10002 ]
          Aihua Xu made changes -
          Status Patch Available [ 10002 ] In Progress [ 3 ]
          Aihua Xu made changes -
          Hadoop Flags Incompatible change [ 10342 ]
          Aihua Xu made changes -
          Release Note The behaviors of converting from BOOLEAN/TINYINT/SMALLINT/INT/BIGINT and converting from FLOAT/DOUBLE to TIMESTAMP are inconsistent. The value of a BOOLEAN/TINYINT/SMALLINT/INT/BIGINT is treated as the time in milliseconds while the value of a FLOAT/DOUBLE is treated as the time in seconds. After the change, all the types during the conversion are interpreted in seconds.
          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.
          Aihua Xu made changes -
          Release Note The behaviors of converting from BOOLEAN/TINYINT/SMALLINT/INT/BIGINT and converting from FLOAT/DOUBLE to TIMESTAMP have been inconsistent. The value of a BOOLEAN/TINYINT/SMALLINT/INT/BIGINT is treated as the time in milliseconds while the value of a FLOAT/DOUBLE is treated as the time in seconds.

          With the change of HIVE-3454, we support an additional configuration "hive.int.timestamp.conversion.in.seconds" to enable the interpretation the BOOLEAN/BYTE/SHORT/INT/BIGINT value in seconds during the timestamp conversion without breaking the existing customers. By default, the existing functionality is kept.
          The behaviors of converting from BOOLEAN/TINYINT/SMALLINT/INT/BIGINT and converting from FLOAT/DOUBLE to TIMESTAMP are inconsistent. The value of a BOOLEAN/TINYINT/SMALLINT/INT/BIGINT is treated as the time in milliseconds while the value of a FLOAT/DOUBLE is treated as the time in seconds. After the change, all the types during the conversion are interpreted in seconds.
          Aihua Xu made changes -
          Attachment HIVE-3454.4.patch [ 12701998 ]
          Aihua Xu made changes -
          Link This issue is depended upon by HIVE-9917 [ HIVE-9917 ]
          Aihua Xu made changes -
          Status In Progress [ 3 ] Patch Available [ 10002 ]
          Aihua Xu made changes -
          Attachment HIVE-3454.4.patch [ 12701998 ]
          Aihua Xu made changes -
          Attachment HIVE-3454.4.patch [ 12699952 ]
          Aihua Xu made changes -
          Status Patch Available [ 10002 ] In Progress [ 3 ]
          Aihua Xu made changes -
          Status In Progress [ 3 ] Patch Available [ 10002 ]
          Aihua Xu made changes -
          Attachment HIVE-3454.4.patch [ 12699952 ]
          Aihua Xu made changes -
          Attachment HIVE-3454.4.patch [ 12699930 ]
          Aihua Xu made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Aihua Xu made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Aihua Xu made changes -
          Status In Progress [ 3 ] Patch Available [ 10002 ]
          Release Note The behaviors of converting from BOOLEAN/BYTE/SHORT/INT/BIGINT and converting from FLOAT/DOUBLE to TIMESTAMP have been inconsistent. The value of a BOOLEAN/BYTE/SHORT/INT/BIGINT is treated as the time in milliseconds while the value of a FLOAT/DOUBLE is treated as the time in seconds.

          With the change of HIVE-3454, we support an additional configuration "hive.int.timestamp.conversion.in.seconds" to enable the interpretation the BOOLEAN/BYTE/SHORT/INT/BIGINT value in seconds during the timestamp conversion without breaking the existing customers. By default, the existing functionality is kept.
          The behaviors of converting from BOOLEAN/TINYINT/SMALLINT/INT/BIGINT and converting from FLOAT/DOUBLE to TIMESTAMP have been inconsistent. The value of a BOOLEAN/TINYINT/SMALLINT/INT/BIGINT is treated as the time in milliseconds while the value of a FLOAT/DOUBLE is treated as the time in seconds.

          With the change of HIVE-3454, we support an additional configuration "hive.int.timestamp.conversion.in.seconds" to enable the interpretation the BOOLEAN/BYTE/SHORT/INT/BIGINT value in seconds during the timestamp conversion without breaking the existing customers. By default, the existing functionality is kept.
          Aihua Xu made changes -
          Attachment HIVE-3454.4.patch [ 12699930 ]
          Aihua Xu made changes -
          Attachment HIVE-3454.4.patch [ 12699541 ]
          Aihua Xu made changes -
          Attachment HIVE-3454.4.patch [ 12699541 ]
          Aihua Xu made changes -
          Attachment HIVE-3454.3.patch [ 12699474 ]
          Aihua Xu made changes -
          Status Patch Available [ 10002 ] In Progress [ 3 ]
          Aihua Xu made changes -
          Release Note The behaviors of converting from BOOLEAN/BYTE/SHORT/INT/BIGINT and converting from FLOAT/DOUBLE to TIMESTAMP have been inconsistent. The value of a BOOLEAN/BYTE/SHORT/INT/BIGINT is treated as the time in milliseconds while the value of a FLOAT/DOUBLE is treated as the time in seconds.

          With the change of HIVE-3454, we support an additional configuration "int.timestamp.conversion.in.seconds" to enable the interpretation the BOOLEAN/BYTE/SHORT/INT/BIGINT value in seconds during the timestamp conversion without breaking the existing customers. By default, the existing functionality is kept.
          The behaviors of converting from BOOLEAN/BYTE/SHORT/INT/BIGINT and converting from FLOAT/DOUBLE to TIMESTAMP have been inconsistent. The value of a BOOLEAN/BYTE/SHORT/INT/BIGINT is treated as the time in milliseconds while the value of a FLOAT/DOUBLE is treated as the time in seconds.

          With the change of HIVE-3454, we support an additional configuration "hive.int.timestamp.conversion.in.seconds" to enable the interpretation the BOOLEAN/BYTE/SHORT/INT/BIGINT value in seconds during the timestamp conversion without breaking the existing customers. By default, the existing functionality is kept.
          Aihua Xu made changes -
          Attachment HIVE-3454.3.patch [ 12699343 ]
          Aihua Xu made changes -
          Attachment HIVE-3454.3.patch [ 12699474 ]
          Aihua Xu made changes -
          Status In Progress [ 3 ] Patch Available [ 10002 ]
          Hadoop Flags Incompatible change [ 10342 ]
          Release Note The behaviors of converting from BOOLEAN/BYTE/SHORT/INT/BIGINT and converting from FLOAT/DOUBLE to TIMESTAMP have been inconsistent. The value of a BOOLEAN/BYTE/SHORT/INT/BIGINT is treated as the time in milliseconds while the value of a FLOAT/DOUBLE is treated as the time in seconds.

          With the change of HIVE-3454, the value of all the data types is treated as the time in seconds during the conversion.
          The behaviors of converting from BOOLEAN/BYTE/SHORT/INT/BIGINT and converting from FLOAT/DOUBLE to TIMESTAMP have been inconsistent. The value of a BOOLEAN/BYTE/SHORT/INT/BIGINT is treated as the time in milliseconds while the value of a FLOAT/DOUBLE is treated as the time in seconds.

          With the change of HIVE-3454, we support an additional configuration "int.timestamp.conversion.in.seconds" to enable the interpretation the BOOLEAN/BYTE/SHORT/INT/BIGINT value in seconds during the timestamp conversion without breaking the existing customers. By default, the existing functionality is kept.
          Aihua Xu made changes -
          Attachment HIVE-3454.3.patch [ 12699343 ]
          Aihua Xu made changes -
          Status Patch Available [ 10002 ] In Progress [ 3 ]
          Aihua Xu made changes -
          Hadoop Flags Incompatible change [ 10342 ]
          Release Note The behaviors of converting from BOOLEAN/BYTE/SHORT/INT/BIGINT and converting from FLOAT/DOUBLE to TIMESTAMP have been inconsistent. The value of a BOOLEAN/BYTE/SHORT/INT/BIGINT is treated as the time in milliseconds while the value of a FLOAT/DOUBLE is treated as the time in seconds.

          With the change of HIVE-3454, the value of all the data types is treated as the time in seconds during the conversion.
          Aihua Xu made changes -
          Status In Progress [ 3 ] Patch Available [ 10002 ]
          Aihua Xu made changes -
          Attachment HIVE-3454.3.patch [ 12697536 ]
          Aihua Xu made changes -
          Status Patch Available [ 10002 ] In Progress [ 3 ]
          Aihua Xu made changes -
          Status In Progress [ 3 ] Patch Available [ 10002 ]
          Aihua Xu made changes -
          Attachment HIVE-3454.2.patch [ 12697289 ]
          Aihua Xu made changes -
          Status Patch Available [ 10002 ] In Progress [ 3 ]
          Aihua Xu made changes -
          Assignee Aihua Xu [ aihuaxu ]
          Ryan Harris made changes -
          Affects Version/s 0.13.1 [ 12326829 ]
          Affects Version/s 0.13.0 [ 12324986 ]
          Affects Version/s 0.12.0 [ 12324312 ]
          Affects Version/s 0.11.0 [ 12323587 ]
          Affects Version/s 0.10.0 [ 12320745 ]
          Arijit Banerjee made changes -
          Attachment HIVE-3454.patch [ 12588389 ]
          Paul Bergeron made changes -
          Attachment HIVE-3454.1.patch.txt [ 12573223 ]
          Paul Bergeron made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Labels newbie newdev patch
          Ryan Harris made changes -
          Affects Version/s 0.8.1 [ 12319268 ]
          Affects Version/s 0.8.0 [ 12316178 ]
          Mark Grover made changes -
          Field Original Value New Value
          Link This issue is duplicated by HIVE-3822 [ HIVE-3822 ]
          Ryan Harris created issue -

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development