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

Unregister the TIMESTAMPADD/DIFF functions and remove DATE_ADD/DIFF

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.3.0
    • 3.3.0
    • SQL
    • None

    Description

      1. Unregister the functions `timestampadd()` and `timestampdiff()` in `FunctionRegistry.expressions`.
      2. Remove the aliases `date_add` for `timestampadd()` and `date_diff` for `timestampdiff()`.
      3. Align tests (regenerate golden files) to the syntax rules

      where the first parameter `unit` can have one of the identifiers:

      • YEAR
      • QUARTER
      • MONTH
      • WEEK
      • DAY, DAYOFYEAR (valid for timestampadd)
      • HOUR
      • MINUTE
      • SECOND
      • MILLISECOND
      • MICROSECOND

      Why are the changes needed?

      1. The `timestampadd()`/`timestampdiff()` functions (and their aliases) with arbitrary string column as the first parameter is not require by any standard.
      2. Remove the functions and aliases should reduce maintenance cost.

      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: