-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
multi-column group by
in e.g. .classify
#501
Comments
Sorry, I'm on vacation without my computer... but isn't it just a case of returning a list os columns from the classify block? |
I thought so too, but no it doesn't work, Enjoy your holiday. |
I'm fixing it, I hadn't enough time yet today, but |
@jonathanstowe could you see if something like this would solve the problem? I still have to add some tests and resolve how Bag and Set should work, |
I'll take a look in the morning 👍 |
I couldn't get it to work, do you have an example? What I'm really trying to do is illustrated by the SQL:
And I can't for the life of me think of a way to express it. |
Now it accepts multiple columns for .classify, but I don't think it will solve your issue... still working on that... |
@jonathanstowe I think that might be closer to what you want now (but not there yet). .classify now accepts a :&reduce (it still needs to use
|
Maybe we could try something like: Model.^all.classify({ MyClassifiableClass.new: .foo, .bar }).Bag (https://glot.io/snippets/gh56566qcg) and create that class specifically for Red. That class could also be used to make map return objects, maybe something like: say “a: { .a }, b: { .b }” for Model.^all.map: { MyNewClass.new: .a, .b } |
I might be missing something quite obvious but it doesn't seen possible to create a
group by
with more than one column using.classify
.It's probably implement
.reduce
as per #61 as.classify
doesn't seem the right place to do this.The text was updated successfully, but these errors were encountered: