Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upAllow selecting multiple aggregate columns #3
Comments
sgrif
changed the title from
Allow supporting multiple aggregate columns
to
Allow selecting multiple aggregate columns
Oct 1, 2015
This comment has been minimized.
|
@aturon @nikomatsakis Was thinking about this recently, and thought you might be interested as it would have been helped by the lattice rule, but could be aided by other additions to the type system as well. Basically we have an impl that looks like this for every size tuple: impl<T, U> Expression for (T, U) where
T: Expression + NonAggregate,
U: Expression + NonAggregate,
{
// ...
}What we need is to write something along the lines of: impl<T, U> Expression for (T, U) where
T: Expression + !NonAggregate,
U: Expression + !NonAggregate,
{
// ...
}With the lattice rule we could have added an The main goal (in case there's another solution that I'm missing) is to make sure that we do not have an impl for |
This comment has been minimized.
|
Also I know you had asked me to keep you in the loop when I find some concrete examples to point you guys at. Is there a preferred form of communication besides just pinging you on issues like this? |
This comment has been minimized.
nikomatsakis
commented
Mar 14, 2016
|
@sgrif this seems good. The hard part I guess might be finding these examples later -- I'll try to keep a log. For what it's worth, this would probably be addressed by the semi-proposal for negative reasoning I advanced in this comment, which itself is just a variant on rust-lang/rfcs#1148. |
This comment has been minimized.
aturon
commented
Mar 14, 2016
|
@sgrif Thanks for the heads up! In general issue comments like this are fine -- perhaps you could have a meta-issue with links to various examples as they come up, just so there's ultimately one place to track? |
This comment has been minimized.
Pyriphlegethon
commented
Apr 9, 2016
|
This problem could possibly be solved by using a |
added a commit
to mujx/ruma
that referenced
this issue
Dec 27, 2016
added a commit
to mujx/ruma
that referenced
this issue
Dec 27, 2016
added a commit
to mujx/ruma
that referenced
this issue
Dec 27, 2016
sgrif
referenced this issue
Mar 1, 2017
Closed
Cannot select aggregate and non-aggregate fields #772
This comment has been minimized.
|
When supporting multiple aggregate columns we should consider that there could be queries that mix aggregate and non-aggregate fields. See for example the following query: SELECT a.id, count(b::id) FROM a LEFT JOIN b ON a.id = b.a_id GROUP BY a.id; |
sgrif commentedOct 1, 2015
I had hoped that this would just involve adding an
Aggregatemarker trait, and modifying the tuple impls to allow if all members are aggregate. This causes overlap since any type could implement bothNonAggregateandAggregate. I do not think there is a way to express this currently in the type system currently, without negative bounds (or maybe specialization)