0
我能夠從xml處理兩個節點。而我得到下面的輸出:如何輸出第一行作爲列限定符名稱
bin/hadoop fs -text /user/root/t-output1/part-r-00000
name:ST17925 currentgrade 1.02
name:ST17926 currentgrade 3.0
name:ST17927 currentgrade 3.0
,但我需要有一個像輸出:
studentid curentgrade
ST17925 1.02
ST17926 3.00
ST17927 3.00
我怎樣才能做到這一點?
我的完整的源代碼:https://github.com/studhadoop/xml/blob/master/XmlParser11.java
編輯:解
protected void setup(Context context) throws IOException, InterruptedException {
context.write(new Text("studentid"), new Text("currentgrade"));
}
k fine.Thanks for your reply。我用setup()方法 – 2013-05-02 07:31:40
好。我可以看看你的代碼嗎? – Rags 2013-05-02 07:34:19
ys.pasted abv(SOLUTION) – 2013-05-02 07:37:16