protected void checkIfPrimitive(ObjectInspector[] arguments, int i, String argOrder)
      throws UDFArgumentTypeException {
    ObjectInspector.Category oiCat = arguments[i].getCategory();
    if (oiCat != ObjectInspector.Category.PRIMITIVE) {
      throw new UDFArgumentTypeException(i, getFuncName() + " only takes primitive types as "
          + argOrder + " argument, got " + oiCat);
    }
  }
GenericUDFSoundex.

Soundex is an encoding used to relate similar names, but can also be used as
a general purpose scheme to find word with similar phonemes.
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSoundex.java