3 ms·
If you need to store other info, it doesn't make sense to aggregate. Think of it in SQL: SELECT a, b, SUM(c) FROM table GROUP BY a doesn't even compile. Y
by qsort 5y ago
If you need to store other info, it doesn't make sense to aggregate. Think of it in SQL:
SELECT a, b, SUM(c) FROM table GROUP BY a
doesn't even compile. You either project away `b` or group over both `a` and `b`.
- Denvercoder9 5y agoThat's true, but while in SQL you can easily group by `a` and `b`, here that's difficult (you'll need to key the dict by a tuple of the values, and reassemble the dictionary afterwards, or something like that).
- qsort 5y agoYeah, fair enough. You'd have the same problem with any approach, though. In a sense, that's easy in SQL only because the hash-magic is abstracted away.