-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQL Server does not support array_agg #15
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: