Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1124

Add support for timestampadd / timestampdiff functions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.7.0
    • core
    • None

    Description

      When calling timestampadd / timestampdiff with first parameter:

      (SQL_TSI_)MICROSECOND ((SQL_TSI_)FRAC_SECOND (deprecated but we can leave for older versions compatibility)), (SQL_TSI_)SECOND, (SQL_TSI_)MINUTE, (SQL_TSI_)HOUR, (SQL_TSI_)DAY, (SQL_TSI_)WEEK, (SQL_TSI_)MONTH, (SQL_TSI_)QUARTER, (SQL_TSI_)YEAR

      (ex: timestampadd(second, 1, current_datetime), calcite throws an error:

      Caused by: org.apache.calcite.sql.parser.SqlParseException: Encountered "( SECOND" at line 1, column 25.
      Was expecting one of:
      "(" "*" ...
      "(" ")" ...
      "(" "WITH" ...

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              arina Arina Ielchiieva
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: