我们如何在Pig中的单行中组合多行

时间:2013-01-09 07:26:02

标签: hadoop mapreduce apache-pig

我需要使用Pig脚本将这多个元组组合在一个元组中。你能提供一些指导吗?

dump requestFile;

当前输出

(Logging Transaction ID:21214,/var/log/tibco/,NESS-A-1-LPNameRequesttoNESS.log,tibcoTest log)

(Default Data:LP Name Request Message Executed Successfully)

(LoanPath Request ID:  88128640)

(RequestGroupID#:   )

(SplitCount#:  2 )

(SplitIndex:  1)

(Correlation ID : 88128640-1 )

所需的输出

(Logging Transaction ID:21214,/var/log/tibco/,NESS-A-1-LPNameRequesttoNESS.log,tibcoTest log,Default Data:LP Name Request Message Executed Successfully,LoanPath Request ID:  88128640,RequestGroupID#:   ,SplitCount#:  2,SplitIndex:  1)
(Correlation ID : 88128640-1 )

1 个答案:

答案 0 :(得分:0)

怎么样:

requestFile = foreach requestFile generate flatten(tuple);
G = GROUP requestFile ALL;
F = FOREACH G generate requestFile;