2012-04-01 37 views

回答

0

我覺得在這個前面的回答SO回答你的問題,對於小的修改:

Is it possible to read MongoDB data, process it with Hadoop, and output it into a RDBS(MySQL)?

的主要區別是,你會在OutputFormatClass設置是這樣的:

job.setOutputFormatClass(SequenceFileOutputFormat.class); 

您還需要在HDFS上設置要將數據保存到的輸出路徑。有關完整的代碼示例,請參閱它們的WordCount示例,但使用上述內容作爲輸出格式而不是MongoOutputFormat。

+0

我剛剛意識到我連接的問題就是你問的問題。它基本上與輸出格式略有不同的問題相同。 – 2012-04-02 02:58:24