Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GroupBy #105

Open
sirinath opened this issue Aug 2, 2016 · 13 comments
Open

GroupBy #105

sirinath opened this issue Aug 2, 2016 · 13 comments

Comments

@sirinath
Copy link

sirinath commented Aug 2, 2016

Ability to groupby is very much needed.

@sirinath
Copy link
Author

Writing to follow up on this.

@shashi
Copy link
Member

shashi commented Nov 1, 2016

I don't really know about the groupby you are referring to. PRs and more explanation are welcome.

@JobJob
Copy link
Member

JobJob commented May 7, 2017

@sirinath can you give an example in Julia of what the input and output would be. In particular would we return a Dictionary mapping from the group key(?) to the Signal with the corresponding values on it?

@sirinath
Copy link
Author

sirinath commented May 7, 2017

You can have a GroupedSignal like done in RxJava's GroupedObservable.

@JobJob
Copy link
Member

JobJob commented May 7, 2017

If you can give a vague example in Julia using Reactive Signals and how you would plan to use the results that will make things much easier. e.g.

s = Signal(2)
# group into even (key == true) and odd (key == false) Signals, with each Signal having the relevant values of s
odds_and_evens = GroupBy(sigval->sigval%2==0,  identity, s)

What do you want to be able to do with odds_and_evens from here?

@sirinath
Copy link
Author

sirinath commented May 7, 2017

true_signal = get(odds_and_evens, true)

@JobJob
Copy link
Member

JobJob commented May 7, 2017

ok, any other functions you need e.g. key_signal = keys(odds_and_evens) ?

@shashi
Copy link
Member

shashi commented May 7, 2017

why would filter not be enough? true_signal = filter(identity, odds_and_evens)

@sirinath
Copy link
Author

sirinath commented May 7, 2017

There are many keys. Above is a special case where you can use filter when key is boolean.

@shashi
Copy link
Member

shashi commented May 8, 2017

filter(x->x in many_keys, signal_with_even_more_keys)?

@sirinath
Copy link
Author

sirinath commented May 8, 2017

This should a Fan Out pattern where you start with 1 signal and get n signals corresponding to n keys. You have to use n filters to achieve the same. Say if n = 8000 the overhead of all the filtering maybe more greater.

The code shown above you get 1 signal which has many keys in the stream. Not one signal for each key.

@shashi
Copy link
Member

shashi commented May 9, 2017

Ok, makes sense. Thanks for clarifying!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants