public static boolean compareSupported(ObjectInspector oi) {
    switch (oi.getCategory()) {
    case PRIMITIVE:
      return true;
    case LIST:
      ListObjectInspector loi = (ListObjectInspector) oi;
      return compareSupported(loi.getListElementObjectInspector());
    case STRUCT:
      StructObjectInspector soi = (StructObjectInspector) oi;
      List<? extends StructField> fields = soi.getAllStructFieldRefs();
      for (int f = 0; f < fields.size(); f++) {
        if (!compareSupported(fields.get(f).getFieldObjectInspector())) {
          return false;
        }
      }
      return true;
    case MAP:
      return false;
    case UNION:
      UnionObjectInspector uoi = (UnionObjectInspector) oi;
      for (ObjectInspector eoi : uoi.getObjectInspectors()) {
        if (!compareSupported(eoi)) {
          return false;
        }
      }
      return true;
    default:
      return false;
    }
  }
Whether comparison is supported for this type.
Currently all types that references any map are not comparable.
serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorUtils.java