sequencefileinputformat

n7taea2i  于 2021-06-01  发布在  Hadoop
关注(0)|答案(0)|浏览(194)

我正在googlebooks ngram上实现单词计数风格的程序。我的输入是二进制文件:https://aws.amazon.com/datasets/google-books-ngrams/ 我被告知要使用sequencefileinputformat才能使用它。
我正在使用hadoop2.6.5。

Configuration conf = new Configuration();
        Job job = Job.getInstance(conf, "PartA");
        job.setJarByClass(MyDriver.class);
        job.setMapperClass(MyMapperA.class);
        job.setReducerClass(MyReducerA.class);
        job.setCombinerClass(MyReducerA.class);
        job.setOutputKeyClass(Text.class);
        job.setOutputValueClass(IntWritable.class);
        job.setInputFormatClass(SequenceFileInputFormat.class); // The new line

        FileInputFormat.addInputPath(job, new Path(args[0]));
        FileOutputFormat.setOutputPath(job, new Path(args[1]));

        System.exit(job.waitForCompletion(true) ? 0 : 1);

遗憾的是,在添加以下行之后,我收到了问题:

job.setInputFormatClass(SequenceFileInputFormat.class);

收到的错误:

java.lang.Exception: java.lang.IllegalArgumentException: Unknown codec: com.hadoop.compression.lzo.LzoCodec
at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:462)

我尝试过添加几个maven依赖项,但是没有成功

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题