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

Unparse a new function of FUNCTION_ID syntax will be quoted

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • core
    • None

    Description

      In Flink, we would like to introduce some new functions of FUNCTION_ID syntax, e.g. CURRENT_ROW_TIMESTAMP. However, when unparsing this new function, we will get the quoted string `CURRENT_ROW_TIMESTAMP` which can't be executed anymore, because Calcite think it is a column reference.

      The root cause of it is org.apache.calcite.sql.SqlIdentifier#unparse calls org.apache.calcite.sql.SqlUtil#unparseSqlIdentifierSyntax where it uses a static Calcite SqlStdOperatorTable.instance() instead of a user-defined operator table. Therefore, it thinks it's not a sql function and unparse it with quotes.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jark Jark Wu
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: