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

Typo in timestamp value produces corrupt result instead of an error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • Impala 2.3.0
    • None
    • Backend

    Description

      Running timestamp tests, I hit the following bug where a typo in a timestamp string produced a strange result without complaining that the input value was invalid:

      Query: select to_utc_timestamp('2015-10-13-09:15:34.101', 'PDT')
       Oops. -----------------------------------^
      
      +----------------------------------------------------+
      | to_utc_timestamp('2015-10-13-09:15:34.101', 'pdt') |
      +----------------------------------------------------+
      | 2015-10-13 07:00:00                                | // ???
      +----------------------------------------------------+
      
      Query: select to_utc_timestamp('2015-10-13 09:15:34.101', 'PDT')
      +----------------------------------------------------+
      | to_utc_timestamp('2015-10-13 09:15:34.101', 'pdt') |
      +----------------------------------------------------+
      | 2015-10-13 16:15:34.101000000                      | // MUCH BETTER
      +----------------------------------------------------+
      

      It looks like anything after the bad character is ignored:

      Query: select to_utc_timestamp('2015-10-13-09:15:34.101', 'UTC')
      +----------------------------------------------------+
      | to_utc_timestamp('2015-10-13-09:15:34.101', 'utc') |
      +----------------------------------------------------+
      | 2015-10-13 00:00:00                                |
      +----------------------------------------------------+
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            blue_impala_48d6 Ryan Blue
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: