コード例 #1
0
 public void validateCall(
     SqlCall call,
     SqlValidator validator,
     SqlValidatorScope scope,
     SqlValidatorScope operandScope) {
   // The base method validates all operands. We override because
   // we don't want to validate the identifier.
   final SqlNode[] operands = call.operands;
   assert operands.length == 2;
   assert operands[1] instanceof SqlIdentifier;
   operands[0].validateExpr(validator, scope);
   SqlIdentifier id = (SqlIdentifier) operands[1];
   if (!id.isSimple()) {
     throw validator.newValidationError(
         id, EigenbaseResource.instance().AliasMustBeSimpleIdentifier.ex());
   }
 }
コード例 #2
0
 public void validate(SqlValidator validator, SqlValidatorScope scope) {
   validator.validateDynamicParam(this);
 }
コード例 #3
0
 /**
  * Validates this node in an expression context.
  *
  * <p>Usually, this method does much the same as {@link #validate}, but a {@link SqlIdentifier}
  * can occur in expression and non-expression contexts.
  */
 public void validateExpr(SqlValidator validator, SqlValidatorScope scope) {
   validate(validator, scope);
   Util.discard(validator.deriveType(scope, this));
 }
コード例 #4
0
 public RelDataType deriveType(SqlValidator validator, SqlValidatorScope scope, SqlCall call) {
   // special case for AS:  never try to derive type for alias
   RelDataType nodeType = validator.deriveType(scope, call.operands[0]);
   assert nodeType != null;
   return validateOperands(validator, scope, call);
 }