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

SQL sequence function with interval returns unexpected error in latest versions

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.3, 3.1.2
    • Fix Version/s: 3.2.0, 3.1.3, 3.0.4
    • Component/s: SQL
    • Labels:
      None

      Description

      For example this returns java.lang.ArrayIndexOutOfBoundsException: 1 

      select sequence(
       date_trunc('month', '2021-08-30'),
       date_trunc('month', '2021-08-15'),
       - interval 1 month)

      Another cases like - all ok

      select sequence(
       date_trunc('month', '2021-07-15'),
       date_trunc('month', '2021-08-30'),
       interval 1 month) as x
      
       , sequence(
       date_trunc('month', '2021-08-30'),
       date_trunc('month', '2021-07-15'),
       - interval 1 month) as y
      
       , sequence(
       date_trunc('month', '2021-08-15'),
       date_trunc('month', '2021-08-30'),
       interval 1 month) as z

      In version 3.0.0 this works

        Attachments

          Activity

            People

            • Assignee:
              sarutak Kousuke Saruta
              Reporter:
              amstel8 Ignatiy Vdovichenko
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: