foldby 后 Dask map 变成连续的

Dask map becomes sequential after foldby

我一直在使用 dask 与 jupyter 一起做定制的 ETL 工作(工作起来很有魅力)。

我的大部分管道只是 filter -> map -> foldby -> map,我发现第二个 map 操作(在 folby 之后)按顺序执行(见下面的散景图)。

代码片段:

(
    db
    .read_text(path, storage_options=credentials)
    .filter(predicate)
    .map(transform)
    .foldby(key, binop, initial, combine, initial)
    .map(transform2)
)  

这正常吗?我不明白为什么 .map(transform2) 操作需要顺序执行。

foldby 的输出是一个只有一个分区的包。您可能会考虑 repartition折叠后将您的包重新分开。