Closed bachdavi closed 5 years ago
Interesting! Yeah we'll have to think about maybe extending Aggregate
to support multiple different aggregations on the same relation? Because both semantics can be useful at times (maybe not for Datalog, but in general).
An example would be:
:find ?team (count ?score) (avg ?score) (median ?score)
...
I think datomic implements it.
Quoting myself:
We can look at something like (->Aggregation [fn vars ...] [fn vars ...] ...+)
. Should also allow for the most efficient implementations (e.g. re-use the same grouping and compute multiple aggregates per group).
Currently we nest multiple aggregations in the same
:find
-clause. This leads to problems in the backend, as already aggregated results are input-collections to the higher aggregations operators.