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

Different format when casting interval type to string type

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.1.0
    • None
    • SQL
    • None

    Description

      Spark SQL:

      spark-sql> select cast(INTERVAL '10' SECOND as string);
      interval 10 seconds
      

      PostgreSQL:

      postgres=# select substr(version(), 0, 16), cast(INTERVAL '10' SECOND as text);
           substr      |   text
      -----------------+----------
       PostgreSQL 11.3 | 00:00:10
      (1 row)
      

      Vertica:

      dbadmin=> select version(), cast(INTERVAL '10' SECOND as varchar(255));
                    version               | ?column?
      ------------------------------------+----------
       Vertica Analytic Database v9.1.1-0 | 10
      (1 row)
      

      Presto:

      presto> select cast(INTERVAL '10' SECOND as varchar(255));
           _col0
      ----------------
       0 00:00:10.000
      (1 row)
      

      Oracle:

      SQL> select cast(INTERVAL '10' SECOND as varchar(255)) from dual;
      
      CAST(INTERVAL'10'SECONDASVARCHAR(255))
      --------------------------------------------------------------------------------
      INTERVAL'+00 00:00:10.000000'DAY TO SECOND
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              yumwang Yuming Wang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: