@Override
 public OptionValue validate(SqlLiteral value) throws ExpressionParsingException {
   OptionValue ov = super.validate(value);
   try {
     CompilerPolicy.valueOf(ov.string_val.toUpperCase());
   } catch (IllegalArgumentException e) {
     throw new ExpressionParsingException(
         String.format(
             "Invalid value '%s' specified for option '%s'. Valid values are %s.",
             ov.string_val, getOptionName(), Arrays.toString(CompilerPolicy.values())));
   }
   return ov;
 }
Example #2
0
 @Override
 public void validate(OptionValue v) {
   super.validate(v);
   try {
     CompilerPolicy.valueOf(v.string_val.toUpperCase());
   } catch (IllegalArgumentException e) {
     throw UserException.validationError()
         .message(
             "Invalid value '%s' specified for option '%s'. Valid values are %s.",
             v.string_val, getOptionName(), Arrays.toString(CompilerPolicy.values()))
         .build(logger);
   }
 }