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

from_unixtime() given an out-of-range unix time produces inconsistent results

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • Impala 2.11.0
    • Backend

    Description

      The FROM_UNIXTIME(time) and FROM_UNIXTIME(time, fmt) produce different results when time is out of range of TimestampValue. The former produces an empty string, while the latter gives null (the latter being better).

      [dhecht-desktop.ca.cloudera.com:21000] > select from_unixtime(999999999999999);
      Query: select from_unixtime(999999999999999)
      Query submitted at: 2017-03-31 10:00:14 (Coordinator: http://dhecht-desktop.ca.cloudera.com:25000)
      Query progress can be monitored at: http://dhecht-desktop.ca.cloudera.com:25000/query_plan?query_id=ee4630ce642b62eb:c666b0f500000000
      +--------------------------------+
      | from_unixtime(999999999999999) |
      +--------------------------------+
      |                                |
      +--------------------------------+
      Fetched 1 row(s) in 0.01s
      [dhecht-desktop.ca.cloudera.com:21000] > select from_unixtime(999999999999999, "yyyy-MM-dd HH:mm:ss.SSSS");
      Query: select from_unixtime(999999999999999, "yyyy-MM-dd HH:mm:ss.SSSS")
      Query submitted at: 2017-03-31 10:03:47 (Coordinator: http://dhecht-desktop.ca.cloudera.com:25000)
      Query progress can be monitored at: http://dhecht-desktop.ca.cloudera.com:25000/query_plan?query_id=4d46d2087b6f74c0:8ab6d24600000000
      +------------------------------------------------------------+
      | from_unixtime(999999999999999, 'yyyy-mm-dd hh:mm:ss.ssss') |
      +------------------------------------------------------------+
      | NULL                                                       |
      +------------------------------------------------------------+
      Fetched 1 row(s) in 0.01s
      

      Attachments

        Activity

          People

            jinchul Jin Chul Kim
            dhecht Daniel Hecht
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: