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

CURRENT_DATE() (with parentheses) is illegal in Calcite

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: