Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
None
-
None
-
None
-
None
Description
Hello~
I've been trying to global sort rows whose key is LongWritable and value is Text type.
Since there are a few result files after finishing a mapreduce job, I need to do a merge sort on them.
I want to sort rows in a decreasing order, but ImmutableBytesWritable only supports increasing sort.
So, I assign LongWritable.DecreasingComparator on JobConf.setOutputKeyComparatorClass() in order that output keys are in decreasing order.
However, There is a big problem. As you see, TableMap requires K must implement or extend WritableComparable<K>, but LongWritable only implements WritableComparable, not WritableComparable<LongWritable>. This makes a compilation time error.
I think we should come up with an idea to solve this one.
TableMap.java
public interface TableMap<K extends WritableComparable<K>, V extends Writable>
extends Mapper<ImmutableBytesWritable, Result, K, V> {
}
LongWritable.java
public class LongWritable implements WritableComparable