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());
 public void validate(SqlValidator validator, SqlValidatorScope scope) {
  * 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));
 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);