private void initForNonPrimitives(ObjectInspector arg0, ObjectInspector arg1) throws UDFArgumentException {
    assert arg0.getCategory() != Category.PRIMITIVE;
    assert arg1.getCategory() != Category.PRIMITIVE;
    assert arg0.getCategory() == arg1.getCategory();
    final TypeInfo type0 = TypeInfoUtils.getTypeInfoFromObjectInspector(arg0);
    final TypeInfo type1 = TypeInfoUtils.getTypeInfoFromObjectInspector(arg1);
    if (type0.equals(type1)) {
      compareType = CompareType.SAME_TYPE;
    } else {
      throw new UDFArgumentException("Type mismatch in " + opName + "(" + type0 + "," + type1 + ")");
    }
  }
Returns whether the operator can handle operands with the specified category.
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseCompare.java