使用 Pig 有效合并 2 个已排序的文件
我的 HDFS 2 数据集具有完全相同的结构,都按相同的键排序。我想将它们合并成一个按该键排序的大数据集。
现在我知道pig有一个有效的合并连接(http://wiki.apache.org/pig/PigMergeJoin)它也有一个有效的合并排序吗?
I have on my HDFS 2 datasets with exactly the same structure, both sorted on the same key. I would like to merge them into one big dataset sorted on that key.
Now I know that pig has an efficient merge-join (http://wiki.apache.org/pig/PigMergeJoin) does it also have an efficient merge-sort?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许是一个智能加载程序(像 Zebra )可以根据每个地图的索引创建正确的分割,并且
COGROUP USING 'merge'
后跟GENERATE group
仍然保持顺序吗?如果不是新的
UNION USING 'merge'
在这种情况下将是完美的!Maybe a smart loader (like Zebra) could create the correct splits from an index for each map and a
COGROUP USING 'merge'
followed by aGENERATE group
still keep the order?If not a new
UNION USING 'merge'
would be perfect in this case!合并连接的输出将是单个排序列表。所以你不需要单独排序。
the output of a merge-join will be a single sorted list. so you don't need a separate sort.