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

Reading timestamps from Kudu are wrong with -use_local_tz_for_unix_ts

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • Impala 2.9.0
    • Impala 2.10.0
    • Backend
    • ghx-label-5

    Description

      our impalad start with flag use_local_tz_for_unix_timestamp_conversions = true
      so be timeconversion use local time zone

      Frontend KuduUtil call utc_to_unix_micros function got time (not handle local time zone branch , time is not equal be time conversion TimestampValue::ToUnixTime)

      // Some comments here
      inline bool TimestampValue::UtcToUnixTime(time_t* unix_time) const {
        DCHECK(unix_time != nullptr);
        if (UNLIKELY(!HasDateAndTime())) return false;
        const boost::posix_time::ptime temp(date_, time_);
        tm temp_tm = boost::posix_time::to_tm(temp);
        // TODO: Conversion using libc is very expensive (IMPALA-5357); find an alternative.
          *unix_time = timegm(&temp_tm);
        return true;
      }
      

      beijing/china is UTC + 8, return wrong result

      Attachments

        Activity

          People

            mjacobs Matthew Jacobs
            zzjj yyzzjj
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: