Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-1579

unix_timestamp() builtins return INT

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Impala 2.0.1
    • Fix Version/s: Impala 2.2
    • Component/s: None
    • Labels:

      Description

      unix_timestamp() wraps when it hits INT_MAX.

      select cast('2038-01-19 03:14:06' as timestamp) a,
      cast(unix_timestamp(cast('2038-01-19 03:14:06' as timestamp)) as bigint) b,
      cast('2038-01-19 03:14:07' as timestamp) a1,
      cast(unix_timestamp(cast('2038-01-19 03:14:07' as timestamp)) as bigint) b1,
      cast('2038-01-19 03:14:08' as timestamp) a2,
      cast(unix_timestamp(cast('2038-01-19 03:14:08' as timestamp)) as bigint) b2,
      cast('2038-01-19 03:14:09' as timestamp) a3,
      cast(unix_timestamp(cast('2038-01-19 03:14:09' as timestamp)) as bigint) b3
      from tpcds.customer
      limit 1;
      

      IMPALA

      2038-01-19 03:14:06 2147483646
      2038-01-19 03:14:07 2147483647
      2038-01-19 03:14:08 -2147483648
      2038-01-19 03:14:09 -2147483647

      HIVE
      2038-01-19 03:14:06 2147501646
      2038-01-19 03:14:07 2147501647
      2038-01-19 03:14:08 2147501648
      2038-01-19 03:14:09 2147501649

      Hive is not affected by this problem.

        Attachments

          Activity

            People

            • Assignee:
              caseyc casey
              Reporter:
              henryr Henry Robinson
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: