[
https://issues.apache.org/jira/browse/HBASE-1593?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
jaehong choi updated HBASE-1593:
--------------------------------
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
was:
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.
<code>
public interface TableMap<K extends WritableComparable<K>, V extends Writable>
extends Mapper<ImmutableBytesWritable, Result, K, V> {
}
<code>
<code>
public class LongWritable implements WritableComparable
<code>
> TableMap's generic type inconsistcy with Hadoop
> -----------------------------------------------
>
> Key: HBASE-1593
> URL: https://issues.apache.org/jira/browse/HBASE-1593
> Project: Hadoop HBase
> Issue Type: Bug
> Components: mapred
> Reporter: jaehong choi
>
> 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
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.