code: private static boolean isCompatibleWithProvidedType(Class<?> providedClass,
                                                        Class<?> replacementClass) {
      if (Integer.class.isAssignableFrom(providedClass)) {
        return (replacementClass == String.class ||
            replacementClass == Integer.class ||
            replacementClass == Long.class);
      } else if (Long.class.isAssignableFrom(providedClass)) {
        return (replacementClass == String.class ||
            replacementClass == Long.class);
      } else if (String.class.isAssignableFrom(providedClass)) {
        return replacementClass == String.class;
      }
      return false;
    }
docs: Check whether data already written to a provided partition can be read
  using the new partition type.
  <p>
  For example, existing ints can be read as strings, but existing strings
  can't be read as ints.
  
  @param providedClass the class from a provided partitioner
  @param replacementClass the partition class of the replacement partitioner
  @return {@code true} iff replacement class can be used with existing data