public int evaluate(Boolean b) {
    if (b) {
      return 1;
    } else {
      throw new RuntimeException("UDFTestErrorOnFalse got b=false");
    }
  }
A UDF for testing, which throws RuntimeException if  the length of a string.
itests/util/src/main/java/org/apache/hadoop/hive/ql/udf/UDFTestErrorOnFalse.java