Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-29651

Incorrect parsing of interval seconds fraction

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.4.0
    • 2.4.5, 3.0.0
    • SQL

    Description

      • The fractional part of interval seconds unit is incorrectly parsed if the number of digits is less than 9, for example:
        spark-sql> select interval '10.123456 seconds';
        interval 10 seconds 123 microseconds
        

        The result must be interval 10 seconds 123 milliseconds 456 microseconds

      • If the seconds unit of an interval is negative, it is incorrectly converted to `CalendarInterval`, for example:
        spark-sql> select interval '-10.123456789 seconds';
        interval -9 seconds -876 milliseconds -544 microseconds
        

        Taking into account truncation to microseconds, the result must be interval -10 seconds -123 milliseconds -456 microseconds

      Attachments

        Activity

          People

            maxgekk Max Gekk
            maxgekk Max Gekk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: