google-cloud-dataflow - 当在此之前添加 Reshuffle() 时,BatchElements() 适用于 DirectRunner,但不适用于 DataflowRunner
问题描述
在 Apache Beam 中,BatchElements()
使用 DirectRunner 运行时,将元素分组为指定大小为 100 的批次。但 DataflowRunner 上的相同代码将元素分组为 1 个批次。我Reshuffle()
之前有BatchElements()
.
没有Reshuffle()
它,它在两个跑步者上都能按预期工作。
p
| "Read from Pub/Sub" >> io.ReadFromPubSub(subscription=subscription)
| "Parse as List" >> Map(lambda element: json.loads(element))
| "Flatten" >> FlatMap(lambda elements: elements)
| Reshuffle()
| "Typed Element" >> ParDo(TypedElement())
| "Batch Typed Element"
>> BatchElements(
min_batch_size=50, max_batch_size=50, target_batch_duration_secs=None
)
有没有人遇到过类似的问题?任何建议将不胜感激!几天来我一直在努力解决这个问题。
解决方案
推荐阅读
- docker - Docker 绑定挂载在 Windows 上托管但不在 linux 上处理 odbc.ini 文件
- r - 需要帮助在 R 中将“[some word][space][more words]”替换为 [some word]
- python - 尝试在 keras 中拟合 CNN 模型时发生“InvalidArgumentError”?
- python - Accelerate 和 NumPy 对 FFT 产生不同的结果
- entity-framework - 防止实体框架代码首先生成无关的外键,而不使用流利?
- javascript - 如何在 React 中渲染多个嵌套数组对象?
- c# - 一种泛型字典
- php - 用 vue 替换 laravel 刀片
- python - 用子节点创建多个同名节点
- python - 无法在 Python 中获得 pubnub.time() 的结果