博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Type mismatch in key from map: expected .. Text, received … LongWritable
阅读量:2395 次
发布时间:2019-05-10

本文共 644 字,大约阅读时间需要 2 分钟。

Couple of things to be fixed in the code

  1. The old (o.a.h.mapred) and the new API (o.a.h.mapreduce) are not compatible, so they should not be mixed.

    import org.apache.hadoop.mapred.OutputCollector;

    import org.apache.hadoop.mapred.Reporter;
    import org.apache.hadoop.mapreduce.Job;
    import org.apache.hadoop.mapreduce.Mapper;
    import org.apache.hadoop.mapreduce.Reducer;

  2. Make sure the input/output for the mappers/reducers are of the type o.a.h.io.Writable. The input key for the Mapper is Object, make it LongWritable.

  3. Looks like the Combiner and the Reducer functionality is the same, so you need not repeat it.

    job.setCombinerClass(Reducer.class);

转载地址:http://hvwob.baihongyu.com/

你可能感兴趣的文章
BestCoder Round #28
查看>>
poj3299 Humidex
查看>>
poj2159 Ancient Cipher
查看>>
poj1083 Moving Tables
查看>>
poj2255 Tree Recovery
查看>>
zoj 1745 Are We There Yet?
查看>>
UVA100 The 3n + 1 problem
查看>>
hdu1754 I Hate It
查看>>
hdu 1166 敌兵布阵(求区间的和,单节点更新)
查看>>
hiho一下 第四十四周 题目1 : 博弈游戏·Nim游戏
查看>>
poj2299 Ultra-QuickSort(线段树计数问题)
查看>>
hdu4565 So Easy!(矩阵快速幂)
查看>>
poj2528 Mayor's posters(线段树,离散化)
查看>>
线段树多lazy-tag(两个)
查看>>
hdu4578(三个更新操作,三个求值操作)
查看>>
并查集(初级)小结
查看>>
Treap
查看>>
相似图片搜索——感知哈希算法
查看>>
编译原理 词法分析
查看>>
计算机系统结构 计算机指令集结构
查看>>