Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-27764 Feature Parity between PostgreSQL and Spark
  3. SPARK-29369

Accept strings without `interval` prefix in casting to intervals

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • SQL
    • None

    Description

      PostgreSQL allows strings without the `interval` prefix while casting a string to an interval:

      maxim=# select cast('1 day' as interval);
       interval 
      ----------
       1 day
      (1 row)
      maxim=# select interval '1 microsecond';
          interval     
      -----------------
       00:00:00.000001
      (1 row)
      

      See https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-INTERVAL-INPUT

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: