简体   繁体   English

Apache Pig:将嵌套袋合并到一个袋中

[英]Apache Pig: merge nested bags to one bag

How can I merge a nested bag in Pig? 如何在Pig中合并嵌套袋?

like 喜欢

{{item1, item2}, {item3, item4}, {item5, item6}} 

to

{item1, item2, item3, item4, item5, item6} 

Just calling on flatten on multiple bags would create a cross-product. 只需将多个袋子扁平化即可产生交叉产品。 For your case, you probably need to convert the bags to tuple and then unnest the tuple by calling flatten. 对于您的情况,您可能需要将包装袋转换为元组,然后通过调用flatten将其嵌套。 http://pig.apache.org/docs/r0.17.0/func.html#bagtotuple http://pig.apache.org/docs/r0.17.0/func.html#bagtotuple

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM