Details
-
Bug
-
Status: Resolved
-
Trivial
-
Resolution: Fixed
-
2.0.0-alpha
-
None
-
Reviewed
Description
The current TotalOrderPartitioner class will not work with an alternative serialization library such as Avro.
To make it work, we may edit the readPartitions bits in it to support non-WritableComparable keys and also remove the WritableComparable check in the class types definition.
That is, since we do not use the values at all (NullWritable), we may as well do:
private K[] readPartitions(FileSystem fs, Path p, Class<K> keyClass, Configuration conf) throws IOException { … while ((key = (K) reader.next(key)) != null) { parts.add(key); key = ReflectionUtils.newInstance(keyClass, conf); } … }