关闭。这个问题需要细节或清晰。它目前不接受答案。
**想改进这个问题吗?**通过编辑这个帖子来添加细节并澄清问题。
四年前关门了。
改进这个问题
首先我有数据和我的小组
A = LOAD './test.txt' USING PigStorage(' ') AS (id:int, time:int, value:float);
B = GROUP A BY time;
例如,我有这样的结构。
1001 {(1,1001,0.2),(3,1001,0.3),(2,1001,0.3),(4,1001,0.6)}
1002 {(2,1002,0.5),(1,1002,0.3),(3,1002,0.1),(4,1002,0.6)}
1003 {(4,1003,0.2),(1,1003,0.8),(2,1003,0.4),(3,1003,0.5)}
但我想
1001 {(1,1001,0.2),(2,1001,0.3),(3,1001,0.3),(4,1001,0.6)}
1002 {(1,1002,0.3),(2,1002,0.5),(3,1002,0.1),(4,1002,0.6)}
1003 {(1,1003,0.8),(2,1003,0.4),(3,1003,0.5),(4,1003,0.2)}
1条答案
按热度按时间wljmcqd81#
使用嵌套foreach