在可变长度翻滚或快照窗口中获取有效负载值的总和 [英] Get sum of payload values over a variable length tumbling or snapshot window

查看:79
本文介绍了在可变长度翻滚或快照窗口中获取有效负载值的总和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当事件与不同长度的间隔事件重叠时,我需要总结事件有效负载中的值:



Hi, I need to summarise the values in my event payload when the event overlap with interval events of varying length:

| ---- interval 1 ----- | --- interval 2 ------- | ------...

|----interval 1-----|---interval 2-------|------...

| 1 |     | 2 |   | 3 |       | 4 |         | 5 |     | 6 |   | 7 | ... 

|1|    |2|   |3|       |4|        |5|    |6|   |7| ...  




  - 我需要来自1,2的有效载荷字段的总和&安培; 3和4,5,& 6.

  - 间隔1和间隔2的长度变化

  - 每个间隔期间发生一个或多个事件 



尝试在每个间隔事件上创建一个翻滚窗口,但不能动态设置长度,所以查看快照窗口但是这些在间隔期间每次更改点(1,2,3)时生成窗口我正在尝试总结。

 - I need the sum of a payload fields from 1,2 & 3 and 4,5, & 6.
 - The length of interval 1 and interval 2 changes
 - There are 1 or more events occurring during each interval 

Tried creating a tumbling window over each interval event but cant set the length dynamically, so looked at snapshot windows but these generate windows on each change of points(1,2,3) during the interval i'm trying to summarise.

如何创建一个可变长度的翻滚窗口(这样可以让我轻松地总结窗口中包含的点)或者更改快照以捕获所有一次间隔中的事件,而不是每次更改?

How can I create a variable length tumbling window (this would allow me to easily summarise the points contained in the window) or alter the snapshot to capture all the events in an interval at once instead of on each change?

提前致谢。

 

 

推荐答案

你是正确的翻滚窗口不是动态的。

You are correct that tumbling windows are not dynamic.

在我的头脑中,你需要确定哪些事件应该通过分组来总结。您可以通过加入间隔流和点流来完成此操作。然后我将结果投影到一个新的有效负载类型,它有一些组标识符
就可以了(时间戳或来自间隔事件的唯一标识符)。这个新的流/可流传输将被馈送到用户定义的流运营商(UDSO)。然后,该UDSO将使用相同的组标识符对来自每个有效载荷的值求和。一旦组
标识符发生变化,您将在所需的任何有效负载中产生结果,并将UDSO中的总和重置为零。

Of the top of my head, you need to determine which events should be summed by grouping them. You can do this by joining the interval stream and the point stream. Then I would project the result into a new payload type that has some kind of group identifier on it (timestamp or unique identifier from the interval event maybe). This new stream/streamable would be fed into an User-Defined Stream Operator (UDSO). This UDSO would then sum up the values from each payload with the same group identifier. Once the group identifier changes, you would yield the result in whatever payload you need and reset the sum in the UDSO to zero.


这篇关于在可变长度翻滚或快照窗口中获取有效负载值的总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆