public void validateCall( SqlCall call, SqlValidatorScope scope) { final SqlOperator operator = call.getOperator(); if ((call.operandCount() == 0) && (operator.getSyntax() == SqlSyntax.FUNCTION_ID) && !call.isExpanded() && !conformance.allowNiladicParentheses()) { // For example, "LOCALTIME()" is illegal. (It should be // "LOCALTIME", which would have been handled as a // SqlIdentifier.) throw handleUnresolvedFunction(call, (SqlFunction) operator, ImmutableList.of(), null); } SqlValidatorScope operandScope = scope.getOperandScope(call); if (operator instanceof SqlFunction && ((SqlFunction) operator).getFunctionType() == SqlFunctionCategory.MATCH_RECOGNIZE && !(operandScope instanceof MatchRecognizeScope)) { throw newValidationError(call, Static.RESOURCE.functionMatchRecognizeOnly(call.toString())); } // Delegate validation to the operator. operator.validateCall(call, this, scope, operandScope); }
public void validateCall( SqlCall call, SqlValidator validator, SqlValidatorScope scope, SqlValidatorScope operandScope) { // This implementation looks for the quantifier keywords DISTINCT or // ALL as the first operand in the list. If found then the literal is // not called to validate itself. Further the function is checked to // make sure that a quantifier is valid for that particular function. // // If the first operand does not appear to be a quantifier then the // parent ValidateCall is invoked to do normal function validation. super.validateCall(call, validator, scope, operandScope); validateQuantifier(validator, call); }
public void validateCall( SqlCall call, SqlValidator validator, SqlValidatorScope scope, SqlValidatorScope operandScope) { // This implementation looks for the quantifier keywords DISTINCT or // ALL as the first operand in the list. If found then the literal is // not called to validate itself. Further the function is checked to // make sure that a quantifier is valid for that particular function. // // If the first operand does not appear to be a quantifier then the // parent ValidateCall is invoked to do normal function validation. super.validateCall(call, validator, scope, operandScope); validateQuantifier(validator, call); }
public void validateCall( SqlCall call, SqlValidatorScope scope) { final SqlOperator operator = call.getOperator(); if ((call.operandCount() == 0) && (operator.getSyntax() == SqlSyntax.FUNCTION_ID) && !call.isExpanded() && !conformance.allowNiladicParentheses()) { // For example, "LOCALTIME()" is illegal. (It should be // "LOCALTIME", which would have been handled as a // SqlIdentifier.) throw handleUnresolvedFunction(call, (SqlFunction) operator, ImmutableList.of(), null); } SqlValidatorScope operandScope = scope.getOperandScope(call); if (operator instanceof SqlFunction && ((SqlFunction) operator).getFunctionType() == SqlFunctionCategory.MATCH_RECOGNIZE && !(operandScope instanceof MatchRecognizeScope)) { throw newValidationError(call, Static.RESOURCE.functionMatchRecognizeOnly(call.toString())); } // Delegate validation to the operator. operator.validateCall(call, this, scope, operandScope); }
public void validateCall( SqlCall call, SqlValidatorScope scope) { final SqlOperator operator = call.getOperator(); if ((call.operandCount() == 0) && (operator.getSyntax() == SqlSyntax.FUNCTION_ID) && !call.isExpanded() && !conformance.allowNiladicParentheses()) { // For example, "LOCALTIME()" is illegal. (It should be // "LOCALTIME", which would have been handled as a // SqlIdentifier.) throw handleUnresolvedFunction(call, (SqlFunction) operator, ImmutableList.of(), null); } SqlValidatorScope operandScope = scope.getOperandScope(call); if (operator instanceof SqlFunction && ((SqlFunction) operator).getFunctionType() == SqlFunctionCategory.MATCH_RECOGNIZE && !(operandScope instanceof MatchRecognizeScope)) { throw newValidationError(call, Static.RESOURCE.functionMatchRecognizeOnly(call.toString())); } // Delegate validation to the operator. operator.validateCall(call, this, scope, operandScope); }