Fork me on GitHub
#onyx
<
2016-10-23
>
yonatanel20:10:11

I think the cheat sheet might be wrong regarding :window/session-key. >This key can represent any totally ordered domain, e.g. :event-time but it's supposed to be the key the session belongs to, not the one defining the session size as :window/window-key.

yonatanel20:10:15

BTW, is it possible to get a window per some key (e.g user-id) as in session, but with any windowing strategy? Alternatively, is it possible to have an infinite session, effectively getting a global window per user-id for example?

Travis20:10:59

Wouldn't you set the group-by key on the task?

yonatanel20:10:39

@camechis I searched the cheat sheet to reply and found :group-key which I wasn't aware of. I don't think :group-by-key affects windowing, but seems like :group-key does. Not sure though.

yonatanel20:10:10

It's not in the user guide

Travis20:10:33

I think it organizes the segments by that key

Travis20:10:37

In the window

Travis20:10:00

So when your trigger fires all the segments will be organized by the key

yonatanel20:10:38

Yeah I just now saw it in onyx-examples

yonatanel20:10:23

This is cool. I thought :group-by-key only routed segments to the same peer.

Travis20:10:50

Nope it definitely changes how segments are organized in your window

Travis20:10:06

We used to the same

yonatanel20:10:46

Still, I'd like an actual window per group, triggering them separately etc, but probably not necessary for my case.

michaeldrogalis21:10:00

@yonatanel Re: session-key, yeah. I think that sentence should just be removed from the description. Can you PR to remove that from information_model.cljc?

michaeldrogalis21:10:57

Yes, set :onyx/group-by-key or :onyx/group-fn on the corresponding task that's windowed.

michaeldrogalis21:10:59

You can access the group in the trigger sync function's extent-state parameter under the :group key. I think its the 2nd to the last parameter passed to sync

michaeldrogalis21:10:09

:onyx/group-by-key does both hash routing, and discretization of windows by group. We were considering changing group-by-key to be renamed to hash-route, and having a separate parameter on the window named group-by which automatically does hash routing too, but we punted for now.

michaeldrogalis21:10:16

The backing windows in a grouped window are completely isolated from one another, and have independent triggers.

yonatanel22:10:26

@michaeldrogalis This is a strong feature and I think the docs should show it off more. Thanks!