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

Return null from `date_part()` for the null `field`

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0.0
    • Component/s: SQL
    • Labels:
      None

      Description

      PostgreSQL return NULL for the NULL field from the date_part() function:

      maxim=# select date_part(null, date'2019-09-20');
       date_part 
      -----------
                
      (1 row)
      

      but Spark fails with the error:

      spark-sql> select date_part(null, date'2019-09-20');
      Error in query: null; line 1 pos 7
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                maxgekk Maxim Gekk
                Reporter:
                maxgekk Maxim Gekk
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: