[英]Why in apache-beam I get error: "TypeError: Cannot convert GlobalWindow to _IntervalWindowBase when using SessionWindow?
When I use session window with 1h gap and after processing million of messages I get error in logs, probably just for some rows:当我使用 session window 时,间隔 1 小时,在处理数百万条消息后,我在日志中收到错误,可能只是某些行:
TypeError: Cannot convert GlobalWindow to apache_beam.utils.windowed_value._IntervalWindowBase
Code:代码:
grouped_tis = tracking_informations | beam.WindowInto(window.Sessions(session_window_gap)) | beam.GroupByKey() | beam.ParDo(MergeTI()) | "TI model -> json" >> beam.Map(jsons.dump)
Full stack: https://pastebin.com/pqA5pMay全栈: https://pastebin.com/pqA5pMay
这可能是因为某些代码(例如MergeTI
)正在返回GlobalWindow
元素,而PCollection
具有不同的窗口集: beam.WindowInto(window.Sessions(session_window_gap))
。
If anyone is experiencing same problem, I solve this problem insert beam.WindowInto(beam.window.GlobalWindows())
between beam.WindowInto(NONGLOBALWINDOW) | beam.GroupByKey()
如果有人遇到同样的问题,我解决这个问题在 beam.WindowInto(NONGLOBALWINDOW) | 之间插入beam.WindowInto(beam.window.GlobalWindows())
beam.WindowInto(NONGLOBALWINDOW) | beam.GroupByKey()
beam.WindowInto(NONGLOBALWINDOW) | beam.GroupByKey()
and other Ptransform that causes problem. beam.WindowInto(NONGLOBALWINDOW) | beam.GroupByKey()
和其他导致问题的 Ptransform。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.