You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently our joins completely model SQL joins and return proper cross products. The resulting data can be painful for people to manipulate. However, we have the opportunity to make join operations more nosql-y -- instead of returning a cross product we can give the option to take all the rows from the right table, concat them into an array, and merge the array into the relevant row in the left table. This would be much nicer for users to manipulate.
We don't have to do it soon, so putting it in backlog for now. We can do it along with #1152 when we get around to it.
I'm in favor for adding such method, not that because it's hard (or ugly) to use an inner query but because people will naturally look for eqJoin/innerJoin/outerJoin to do it, and they will end up doing non efficient queries.
One of the problem of using an inner query is that people have to manually coerce to an array, which is not an obvious thing to do.
This has the serious downside that it makes it very easy for people to write queries which work on their test data but fail once they get a larger dataset because they construct oversized arrays. This is arguably a problem in #1096 but I think people generally understand that aggregation can be memory intensive. Common aggregations like word counting already exhibit similar performance. My sense is that people generally expect joins to be scalable (something we highlight heavily in our marketing) and it would be really confusing if joins suddenly started failing in your production environment and you had to rewrite your code to use the other join syntax. I'd just prefer not to have such a fundamental operation be vulnerable to this. Also with the syntax in #1096 this is fairly straightforward to do, you just say:
join.group_by("left", r.rows("right"))
really isn't that bad but I think it makes it a lot more obvious that this could potentially be a memory intensive operation.
Activity
wmrowan commentedon Jul 12, 2013
So this behavior?
neumino commentedon Jul 12, 2013
I'm in favor for adding such method, not that because it's hard (or ugly) to use an inner query but because people will naturally look for eqJoin/innerJoin/outerJoin to do it, and they will end up doing non efficient queries.
One of the problem of using an inner query is that people have to manually coerce to an array, which is not an obvious thing to do.
jdoliner commentedon Jul 12, 2013
This has the serious downside that it makes it very easy for people to write queries which work on their test data but fail once they get a larger dataset because they construct oversized arrays. This is arguably a problem in #1096 but I think people generally understand that aggregation can be memory intensive. Common aggregations like word counting already exhibit similar performance. My sense is that people generally expect joins to be scalable (something we highlight heavily in our marketing) and it would be really confusing if joins suddenly started failing in your production environment and you had to rewrite your code to use the other join syntax. I'd just prefer not to have such a fundamental operation be vulnerable to this. Also with the syntax in #1096 this is fairly straightforward to do, you just say:
really isn't that bad but I think it makes it a lot more obvious that this could potentially be a memory intensive operation.
coffeemug commentedon Jul 18, 2014
Closing in favor of #2720.