Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-3809

CURRENT_DATE() (with parentheses) is illegal in Calcite

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      Calcite doesn't allow system functions to be specified with parenthesis who doesn't accept arguments.

      For eg:-
      CURRENT_DATE() is illegal whereas CURRENT_DATE is expected.

      At validation level:- SqlValidatorImpl#validateCall

          if ((call.operandCount() == 0)
              && (operator.getSyntax() == SqlSyntax.FUNCTION_ID)
              && !call.isExpanded()) {
            // For example, "LOCALTIME()" is illegal. (It should be
            // "LOCALTIME", which would have been handled as a
            // SqlIdentifier.)
            throw handleUnresolvedFunction(call, (SqlFunction) operator,
                ImmutableList.<RelDataType>of(), null);
          }
      

      Attachments

        Issue Links

          Activity

            People

              ankit@apache.org Ankit Singhal
              ankit@apache.org Ankit Singhal
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: