public IntWritable evaluate(Text s) {
    if (s == null) {
      return null;
    }
    result.set(s.toString().length());
    return result;
  }
A UDF for testing, which evaluates the length of a string.
itests/util/src/main/java/org/apache/hadoop/hive/ql/udf/UDFTestLength.java