私はリデューサーを書いていますが、各キーの値は非常に大きな数になる可能性があります(long
値の範囲よりも大きい)。BigInteger
値の型として使用する予定でしたが、豚でBigIntegerWritableクラスが定義されていることに気付きました。ただし、ライブラリを使用するpig-0.11.0.jar
かpig-0.11.0-withouthadoop.jar
、コンパイルします。が見つかりませんでした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