使用带有FixedWindows和Duration的ValueProvider

时间:2021-09-17 15:35:25

Moving toward Apache Beam 2.x, I want to use templates as much as possible, and ValueProvider accordingly.

转向Apache Beam 2.x,我想尽可能多地使用模板,并相应地使用ValueProvider。

In my logic, I am using a FixedWindow, but the duration is flexible, so I rather get it from a ValueProvider.

在我的逻辑中,我使用的是FixedWindow,但持续时间很灵活,所以我宁愿从ValueProvider中获取它。

The problem is that FixedWindows.of() only get Duration, and I failed to find a simple way to grab a ValueProvider and make a duration out of it.

问题是FixedWindows.of()只获取持续时间,而我找不到一种简单的方法来获取ValueProvider并从中获取持续时间。

Please advise, Shushu

请告知,舒书

2 个解决方案

#1


2  

Unfortunately this question has a simple answer: this is currently not supported. Feel free to file a JIRA - it seems like a reasonable request.

不幸的是,这个问题有一个简单的答案:目前不支持这个问题。随意提交JIRA - 这似乎是一个合理的要求。

#2


1  

Ran into this exact issue today but with SlidingWindows, we just wrote our own windowing function with a new param that was a ValueProvider instead (similar to https://github.com/apache/beam/pull/3358/files) and this seems to work.

今天进入这个确切的问题,但是使用SlidingWindows,我们只是用一个新的参数编写了我们自己的窗口函数,而这个参数是一个ValueProvider(类似于https://github.com/apache/beam/pull/3358/files),这似乎上班。

#1


2  

Unfortunately this question has a simple answer: this is currently not supported. Feel free to file a JIRA - it seems like a reasonable request.

不幸的是,这个问题有一个简单的答案:目前不支持这个问题。随意提交JIRA - 这似乎是一个合理的要求。

#2


1  

Ran into this exact issue today but with SlidingWindows, we just wrote our own windowing function with a new param that was a ValueProvider instead (similar to https://github.com/apache/beam/pull/3358/files) and this seems to work.

今天进入这个确切的问题,但是使用SlidingWindows,我们只是用一个新的参数编写了我们自己的窗口函数,而这个参数是一个ValueProvider(类似于https://github.com/apache/beam/pull/3358/files),这似乎上班。