我正在写一个减速器,每个键的值可能非常大(大于long
值的范围)。我计划使用BigInteger
作为值的类型,我注意到在猪中定义了一个类BigIntegerWritable。但是,我使用库pig-0.11.0.jar
或pig-0.11.0-withouthadoop.jar
进行编译。它找不到BigIntegerWritable
。如何在Reducer中导入BigIntegerWritable?
这是我用来编译命令:
javac -classpath /var/hadoop/hadoop-core-1.0.4.jar:/var/pig/pig-0.11.0.jar wordcount.java wordcountReducer.java wordcountMapper.java
这里的错误消息:
wordcountReducer.java:8: error: cannot find symbol
import org.apache.pig.backend.hadoop.BigIntegerWritable;
^
symbol: class BigIntegerWritable
location: package org.apache.pig.backend.hadoop
wordcountReducer.java:18: error: cannot find symbol
implements Reducer<Text, LongWritable, Text, BigIntegerWritable> {
^
symbol: class BigIntegerWritable
wordcountReducer.java:21: error: cannot find symbol
OutputCollector<Text, BigIntegerWritable> output, Reporter reporter)
^
symbol: class BigIntegerWritable
location: class wordcountReducer
wordcountReducer.java:28: error: cannot find symbol
output.collect(key, new BigIntegerWritable(wordNumber));
^
symbol: class BigIntegerWritable
location: class wordcountReducer
4 errors