@Override public String getDisplayString(String[] children) {
    assert children.length == 3 || children.length == 4;
    StringBuilder sb = new StringBuilder();
    sb.append("CAST( ");
    sb.append(children[1]);
    sb.append(" AS ");
    int typeKey = Integer.parseInt(children[0]);
    if (!OUTPUT_TYPES.keySet().contains(typeKey)) {
      sb.append("HiveParsers_IdentifiersParser index ").append(typeKey);
    } else {
      sb.append(OUTPUT_TYPES.get(typeKey));
      if (children.length == 4) {
        sb.append("(").append(children[3]).append(")");
      }
    }
    sb.append(" FORMAT ");
    sb.append(children[2]);
    sb.append(" )");
    return sb.toString();
  }
@param arguments
 0. const int, value of a HiveParser_IdentifiersParser constant which represents a TOK_[TYPE]
 1. expression to convert
 2. constant string, format pattern
 3. (optional) constant int, output char/varchar length
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFCastFormat.java