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

Add the TIMESTAMPADD() function

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.3.0
    • 3.3.0
    • SQL
    • None

    Description

      The function TIMESTAMPADD() is a part of the ODBC api and implemented virtually by ALL other databases are missing in Spark SQL.

      The first argument is an unary interval (HOUR, YEAR, DAY, etc)

      TIMESTAMPADD( SECOND, 2 , timestamp '2021-12-12 12:00:00.00') returns 2021-12-12 12:00:02.00
      

      The ODBC syntax requires the interval value to have a prefix of sql_tsi_ while plain sql doesn't. See

      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: