English 中文(简体)
Hadoop字数不成正数。 如何确定档案格式?
原标题:Hadoop word count example fails with not a SequentialFile . How set file format?
  • 时间:2011-11-20 19:40:09
  •  标签:
  • hadoop
最佳回答
问题回答

In the ValueAggregatorJob the following check is done

int numOfReducers = 1;
if (args.length > 2) {
  numOfReducers = Integer.parseInt(args[2]);
}

..............

if (args.length > 3 && 
    args[3].compareToIgnoreCase("textinputformat") == 0) {
  theInputFormat = TextInputFormat.class;
} else {
  theInputFormat = SequenceFileInputFormat.class;
}

如果textinputformat (literal string)没有被具体指明为理由,那么输入格式就对SequenceFileInputFormat违约,因此huckfinn.txt not a SequenceFile mis。 此外,如果未具体说明,则减员违约为1人。

利用以下指挥人员来管理工作

hadoop jar hadoop-mapred-examples-0.21.0.jar aggregatewordcount /user/praveensripati/input/sample.txt /user/praveensripati/output 2 textinputformat

请注意,通常情况下,斜体-地图-ex-0.21.0.jar的版本编号。 该档案存放在Hadoop安装室。 确保文件<代码>/usr/lib/hadoop/hadoop-examples.jar上。

解决<代码>java.lang.RuntimeException: 相容物体的误差,请查对ack痕的标识文档,并将之退回。





相关问题
Hadoop - namenode is not starting up

I am trying to run hadoop as a root user, i executed namenode format command hadoop namenode -format when the Hadoop file system is running. After this, when i try to start the name node server, it ...

What default reducers are available in Elastic MapReduce?

I hope I m asking this in the right way. I m learning my way around Elastic MapReduce and I ve seen numerous references to the "Aggregate" reducer that can be used with "Streaming" job flows. In ...

Establishing Eclipse project environment for HadoopDB

I have checked-out a project from SourceForge named HadoopDB. It uses some class in another project named Hive. I have used Eclipse Java build path setting to link source to the Hive project root ...

Hadoop: intervals and JOIN

I m very new to Hadoop and I m currently trying to join two sources of data where the key is an interval (say [date-begin/date-end]). For example: input1: 20091001-20091002 A 20091011-20091104 ...

hadoop- determine if a file is being written to

Is there a way to determine if a file in hadoop is being written to? eg- I have a process that puts logs into hdfs. I have another process that monitors for the existence of new logs in hdfs, but I ...

Building Apache Hive - impossible to resolve dependencies

I am trying out the Apache Hive as per http://wiki.apache.org/hadoop/Hive/GettingStarted and am getting this error from Ivy: Downloaded file size doesn t match expected Content Length for http://...