Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

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

like image 485
sacherus Avatar asked Mar 01 '26 12:03

sacherus


1 Answers

If anyone is experiencing same problem, I solve this problem insert beam.WindowInto(beam.window.GlobalWindows()) between beam.WindowInto(NONGLOBALWINDOW) | beam.GroupByKey() and other Ptransform that causes problem.

like image 96
Sonins Avatar answered Mar 07 '26 09:03

Sonins