Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-27790 Support ANSI SQL INTERVAL types
  3. SPARK-36431

Support comparison of ANSI intervals with different fields

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.2.0
    • 3.2.0
    • SQL
    • None

    Description

      Support comparison of

      • a day-time interval with another day-time interval which has different fields
      • a year-month interval with another year-month interval where fields are different.

      The example below shows the issue:

      spark-sql> select interval '1' day > interval '1' hour;
      Error in query: cannot resolve '(INTERVAL '1' DAY > INTERVAL '01' HOUR)' due to data type mismatch: differing types in '(INTERVAL '1' DAY > INTERVAL '01' HOUR)' (interval day and interval hour).; line 1 pos 7;
      'Project [unresolvedalias((INTERVAL '1' DAY > INTERVAL '01' HOUR), None)]
      +- OneRowRelation
      
      spark-sql> select interval '2' year > interval '11' month;
      Error in query: cannot resolve '(INTERVAL '2' YEAR > INTERVAL '11' MONTH)' due to data type mismatch: differing types in '(INTERVAL '2' YEAR > INTERVAL '11' MONTH)' (interval year and interval month).; line 1 pos 7;
      'Project [unresolvedalias((INTERVAL '2' YEAR > INTERVAL '11' MONTH), None)]
      +- OneRowRelation
      

      Attachments

        Activity

          People

            angerszhuuu angerszhu
            maxgekk Max Gekk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: