NullWritable即可。

 

 

       public static class XxxMapper

                extends Mapper<LongWritable, XxxRecord, LongWritable, NullWritable>

                {

                        private LongWritable uid = new LongWritable();

 

                        public void map(LongWritable key, XxxRecord value, Context context)

                                throws IOException, InterruptedException

                                {

                                        uid.set(value.uid);

                                        context.write(uid, NullWritable.get());

                                }

                }

 

 

说只输出Value不输出Key也类似。但没试过。不过我曾纠结于为什么K/V之间必须是Tab分隔呢?用这个可以轻松搞定了,呵呵。

相关文章:

  • 2021-07-28
  • 2022-12-23
  • 2022-02-05
  • 2021-06-05
  • 2021-06-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案