Skip to content

Rolling Aggregations #313

@Max-Meldrum

Description

@Max-Meldrum

While it is possible to implement by hand, provide a way to express rolling aggregations in the API.

#[arcon::proto]
#[derive(Arcon, Copy, Clone)]
#[arcon(unsafe_ser_id = 12, reliable_ser_id = 13, version = 1)]
pub struct Event {
    pub id: u64,
    pub data: u64,
}

let mut app = Application::default()
   .iterator((0..1000000).map(|x| Event { id: x, data: 1.5 }), |conf| {
         conf.set_timestamp_extractor(|x: &Event| x.id);
   })
  .key_by(|event: &Event| &event.id)
  .sum(|event: Event|  event.data) // output: (key, current_sum)
  .build();

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions