Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个很长的文本文件(几百 GB),我想改组其中的行。我想知道是否有使用 DataFlow 的好方法。我想如果我只是将文件放入并有一个运行仅输出行的 DoFn 的 ParDo,我会得到一个小的洗牌。但最好对文件进行更全面的改组。有什么好主意吗?
为了获得良好的随机播放效果,您可以尝试将每一行关联一个键,该键是该行的 MD5/CRC/UUID,然后按此键分组。在按功能分组(假设没有冲突)中,只需输出行。