我是hadoop mapreduce的新手
我有输入文本文件,其中数据已存储如下.这里只有几个元组(data.txt)
{"author":"Shari?f Qa?sim","book":"al- Rabi?? al-manshu?d"}
{"author":"Na?s?ir Nimri?","book":"Adi?b ?Abba?si?"}
{"author":"Muz?affar ?Abd al-Maji?d Kammu?nah","book":"Asma?? Alla?h al-h?usna? al-wa?ridah fi? muh?kam kita?bih"}
{"author":"H?asan Mus?t?afa? Ah?mad","book":"al- Jabhah al-sharqi?yah wa-ma?a?rikuha? fi? h?arb Ramad?a?n"}
{"author":"Rafi?qah Sali?m H?ammu?d","book":"Ta?li?m fi? al-Bah?rayn"}
Run Code Online (Sandbox Code Playgroud)
这是我的java文件,我应该编写我的代码(CombineBooks.java)
package org.hwone;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.util.GenericOptionsParser;
//TODO import necessary components
/*
* Modify this file to combine books from the same other into
* single JSON object.
* i.e. {"author": "Tobias Wells", "books": [{"book":"A die in the country"},{"book": "Dinky died"}]}
* Beaware that, …Run Code Online (Sandbox Code Playgroud)