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
to-many-join-column-query uses array_agg to fetch references with cardinality :many. It returns one row with id and array of referenced ids. Unfortunately some SQL databases does not implement array_agg. [1] [2]
How can the solution look like?
Move GROUP_BY from SQL to clojure group-by
Move to-many into VendorAdapters, use array_agg for adapters which support it and
a. use string_agg in SQL and str/split in Clojure and use attributes to distinguish between numbers and uuids
b. go fancy and use XML paths as suggested in [2]
My personal taste is to prefer simple solution over magic and advanced features. I might be wrong but the overhead of moving group-by to Clojure should not be large. You get the same data, but you have to process more rows in resulting dataset.
2a can be tricky and must rely on attribute definition to distinguish numbers and uuids.
2b is too fancy for me.
to-many-join-column-query
uses array_agg to fetch references with cardinality:many
. It returns one row with id and array of referenced ids. Unfortunately some SQL databases does not implementarray_agg
. [1] [2]How can the solution look like?
GROUP_BY
from SQL to clojuregroup-by
to-many
into VendorAdapters, usearray_agg
for adapters which support it anda. use
string_agg
in SQL and str/split in Clojure and use attributes to distinguish between numbers and uuidsb. go fancy and use XML paths as suggested in [2]
My personal taste is to prefer simple solution over magic and advanced features. I might be wrong but the overhead of moving group-by to Clojure should not be large. You get the same data, but you have to process more rows in resulting dataset.
2a can be tricky and must rely on attribute definition to distinguish numbers and uuids.
2b is too fancy for me.
What kind of patch you would like to see?
[1] https://www.sqlshack.com/implement-array-like-functionality-sql-server/
[2] https://jeremy-dohmann.medium.com/performing-array-aggregations-in-microsoft-sql-server-with-xml-path-9a36a7fe33be
The text was updated successfully, but these errors were encountered: