如何使用Hadoop Python流媒体在Hypeable中插入多个值?我可以插入单列的值,但不能超过一列。在我尝试的时候,我得到以下例外:
java.lang.RuntimeException: java.io.IOException: Unable to write cell - java.lang.Exception: incorrect output line format only 1 tabs
at org.apache.hadoop.streaming.PipeMapRed.waitOutputThreads(PipeMapRed.java:325)
at org.apache.hadoop.streaming.PipeMapRed.mapRedFinished(PipeMapRed.java:545)
at org.apache.hadoop.streaming.PipeReducer.close(PipeReducer.java:137)
at org.apache.hadoop.mapred.ReduceTask.runOldReducer(ReduceTask.java:528)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:419)
at org.apache.hadoop.mapred.Child$4.run(Child.java:259)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1059)
at org.apache.hadoop.mapred.Child.main(Child.java:253)
Caused by: java.io.IOException: Unable to write cell - java.lang.Exception: incorrect output line format only 1 tabs
at org.hypertable.hadoop.mapred.TextTableOutputFormat$HypertableRecordWriter.write(TextTableOutputFormat.java:247)
at org.hypertable.hadoop.mapred.TextTableOutputFormat$HypertableRecordWriter.write(TextTableOutputFormat.java:69)
at org.apache.hadoop.mapred.ReduceTask$OldTrackingRecordWriter.write(ReduceTask.java:456)
at org.apache.hadoop.mapred.ReduceTask$3.collect(ReduceTask.java:496)
at org.apache.hadoop.streaming.PipeMapRed$MROutputThread.run(PipeMapRed.java:381)
map.py
import sys
for line in sys.stdin:
print line
reduce.py
import sys
for line in sys.stdin:
txt= line.split('\t')
print txt[0]+'\t'+txt[1]+'\t'+txt[2]
输入表格超文本将是制表符分隔值, 例如:“这是文字”。
输出表包含三列,我需要按选项卡拆分输入文本并将其保存为hypertabel。
Hypertable输出列名cc
,kw
和oc
。