[ 
https://issues.apache.org/jira/browse/PHOENIX-3809?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ankit Singhal updated PHOENIX-3809:
-----------------------------------
    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 
{code}
    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);
    }
{code}

  was:
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.

SqlValidatorImpl#validateCall
{code}
    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);
    }
{code}


> CURRENT_DATE() (with paranthesis) is illegal in calcite
> -------------------------------------------------------
>
>                 Key: PHOENIX-3809
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3809
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Ankit Singhal
>            Assignee: Ankit Singhal
>              Labels: calcite
>
> 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 
> {code}
>     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);
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to