public static boolean isConversionRequiredForComparison(TypeInfo typeA, TypeInfo typeB) {
    if (typeA.equals(typeB)) {
      return false;
    }

    if (TypeInfoUtils.doPrimitiveCategoriesMatch(typeA, typeB)) {
      return false;
    }

    return true;
  }
Given two types, determine whether conversion needs to occur to compare the two types.
This is needed for cases like varchar, where the TypeInfo for varchar(10) != varchar(5),
but there would be no need to have to convert to compare these values.
@param typeA
@param typeB
@return
serde/src/java/org/apache/hadoop/hive/serde2/typeinfo/TypeInfoUtils.java