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

ExprTest fails on Ubuntu 16 when the timezone is America/Los_Angeles

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 3.2.0
    • Impala 3.2.0
    • Backend
    • None
    • ghx-label-6

    Description

      When setting up an Ubuntu development environment, I installed Ubuntu 16.04 using America/Los_Angeles as the timezone. When running on this configuration, ExprTest.TimestampFunctions() fails with several timezone issues:

      [ RUN ] ExprTest.TimestampFunctions
      /home/joe/view2/Impala/be/src/exprs/expr-test.cc:559: Failure
      Value of: ConvertValue<int64_t>(result)
      Actual: -28800
      Expected: expected_result
      Which is: 0
      unix_timestamp(cast('1969-12-31 16:00:00' as timestamp))
      /home/joe/view2/Impala/be/src/exprs/expr-test.cc:559: Failure
      Value of: ConvertValue<int64_t>(result)
      Actual: -28800
      Expected: expected_result
      Which is: 0
      unix_timestamp('1969-12-31 16:00:00')
      /home/joe/view2/Impala/be/src/exprs/expr-test.cc:559: Failure
      Value of: ConvertValue<int64_t>(result)
      Actual: -28800
      Expected: expected_result
      Which is: 0
      unix_timestamp('1969-12-31 16:00:00', 'yyyy-MM-dd HH:mm:ss')
      /home/joe/view2/Impala/be/src/exprs/expr-test.cc:559: Failure
      Value of: ConvertValue<int64_t>(result)
      Actual: 0
      Expected: expected_result
      Which is: 28800
      unix_timestamp('1970-01-01', 'yyyy-MM-dd')
      /home/joe/view2/Impala/be/src/exprs/expr-test.cc:559: Failure
      Value of: ConvertValue<int64_t>(result)
      Actual: 0
      Expected: expected_result
      Which is: 28800
      unix_timestamp('1970-01-01 10:10:10', 'yyyy-MM-dd')
      /home/joe/view2/Impala/be/src/exprs/expr-test.cc:559: Failure
      Value of: ConvertValue<int64_t>(result)
      Actual: -28800
      Expected: expected_result
      Which is: 0
      unix_timestamp('1969-12-31 16:00:00 extra text', 'yyyy-MM-dd HH:mm:ss')
      /home/joe/view2/Impala/be/src/exprs/expr-test.cc:289: Failure
      Value of: GetValue(expr, TYPE_STRING)
      Actual: "1970-01-01 00:00:00"
      Expected: expected_result
      Which is: "1969-12-31 16:00:00"
      cast(cast(0 as timestamp) as string)
      /home/joe/view2/Impala/be/src/exprs/expr-test.cc:289: Failure
      Value of: GetValue(expr, TYPE_STRING)
      Actual: "1970-01-01 00:00:00"
      Expected: expected_result
      Which is: "1969-12-31 16:00:00"
      cast(cast(0 as timestamp) as string)
      /home/joe/view2/Impala/be/src/exprs/expr-test.cc:289: Failure
      Value of: GetValue(expr, TYPE_STRING)
      Actual: "1970-01-01 00:00:00"
      Expected: expected_result
      Which is: "1969-12-31 16:00:00"
      from_unixtime(0)
      /home/joe/view2/Impala/be/src/exprs/expr-test.cc:289: Failure
      Value of: GetValue(expr, TYPE_STRING)
      Actual: "1970-01-01 00:00:00"
      Expected: expected_result
      Which is: "1969-12-31 16:00:00"
      from_unixtime(cast(0 as bigint))
      /home/joe/view2/Impala/be/src/exprs/expr-test.cc:289: Failure
      Value of: GetValue(expr, TYPE_STRING)
      Actual: "1970-01-01 00:00:00"
      Expected: expected_result
      Which is: "1969-12-31 16:00:00"
      from_unixtime(0, 'yyyy-MM-dd HH:mm:ss')
      /home/joe/view2/Impala/be/src/exprs/expr-test.cc:289: Failure
      Value of: GetValue(expr, TYPE_STRING)
      Actual: "1970-01-01 00:00:00"
      Expected: expected_result
      Which is: "1969-12-31 16:00:00"
      from_unixtime(cast(0 as bigint), 'yyyy-MM-dd HH:mm:ss')
      /home/joe/view2/Impala/be/src/exprs/expr-test.cc:289: Failure
      Value of: GetValue(expr, TYPE_STRING)
      Actual: "1970-01-01 08:00:00"
      Expected: expected_result
      Which is: "1970-01-01 00:00:00"
      cast(to_timestamp(28800) as string)
      /home/joe/view2/Impala/be/src/exprs/expr-test.cc:445: Failure
      Expected: (value) <= (end), actual: 1546465102 vs 1546436302
      Google Test trace:
      /home/joe/view2/Impala/be/src/exprs/expr-test.cc:6572: 
      [ FAILED ] ExprTest.TimestampFunctions (3577 ms)
      

      There are a couple workarounds to this:

      # Set UTC as timezone
      sudo timedatectl set-timezone UTC
      
      # Use actual timezone name (e.g. PST8PDT rather than America/Los_Angeles
      # or CST6CDT rather than America/Chicago)
      sudo timedatectl set-timezone PST8PDT

      This looks like it is coming from the tests using TestTimestampUnixEpochConversions(). The tests work on other timezones (Americas/La_Paz, Europe/Paris, Asia/Tokyo all work). It is likely that this is a duplicate of some other known issue.

      Filing this Jira so that others who run into this might find this workaround.

      Attachments

        Issue Links

          Activity

            People

              attilaj Attila Jeges
              joemcdonnell Joe McDonnell
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: