Closed harold closed 1 year ago
My workaround for the moment:
> (->> (ds/group-by-column (ds/->dataset [{:a 1 :b 1} {:a 2 :b 2}]) :a)
(into {})
ffirst)
1
also (def fkey (comp key first))
as a work-around
I get it - the java.util.LinkedHashMap$Entry
isn't a clojure.lang.AMapEntry
.
Your workaround is a lot better because it uses less memory.
This is fine for now, will keep any eye out for other cases where it might be helpful to treat the map entries as two element vectors. If those arise can re-think if this is a good idea and how to implement.
In converting some code that was previously dealing w/ sequences of maps to use a dataset, I hit the following (verily simplified here):
My expectation was that the item returned by
group-by
would be a map from values to datasets filtered on that value. Some downstream code was destructuring them as such and exploded.Would it be possible to make the value returned by
group-by-column
behave more like a clojure map in this way?