-
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
Add the array_agg aggregator #5
base: master
Are you sure you want to change the base?
Conversation
You should not use That said, I feel a bit reluctant to add partial support for arrays in this way. If we want to make a jump to support arrays, we should probably provide more stuff (such as array access and construction). I would rather support |
I've rebased my PR with only string_array_agg (+ the string array type) |
Do you think it's a good solution ? (see the last commit) EDIT: Rebased because of a typo in the commit message EDIT2: Oups, sorry. There is a bug. I'll make a fix right a way. |
Fixed ! :) |
I am still not convinced that this is the right solution. In particular, I doubt this approach could be extended to handle "really polymorphic" arrays. I may try to experiment with other things (e.g. the idea of separating the caml-type from the sql-type of a sql value), but this requires design work and you should not expect arrays to be upstream soon. On the other hand, I would have nothing against other aggregate functions such as My advice would be to try using one of these simpler aggregators for your workflow. I know it's not as nice conceptually, but elegance requires more work. |
What is « "really polymorphic" arrays » ? Where do you want them ? |
Updated against the latest pgocaml. |
Is there a change for this PR to be merged ? Otherwise I've to backport c43b07b to be compatible with pgocaml 2.0. |
cc @gasche |
What I think Macaque would need to properly support arrays is to move from a type As long as we only had non-parametric type, we didn't need this distinction. However, representing the SQL type of arrays of Unfortunately, that is an invasive change that does require some work, and I obviously haven't have time to work on this on the past few months. So there is a choice to make, which is:
In the second case, I would need to understand the upgrade path from there. What happens, if we finally implement proper polymorphic arrays, to the old code using the old interface? In any case, I suspect that doing the change might break compatibility (it may be possible to do that in a compatible way, though), so maybe expecting users having to change their array-manipulating code is also fine. |
…l in e2d0b1c (pgocaml commit hash)
I don't understand. It's already possible to fetch the type
So we just have to decompose this object into |
I've rebased and added a commit which simplifies/cleans a bit the types. |
Hm, it's my turn to be confused: if the proposed |
Removed. Simply because I worked on this by several separated steps and |
@gasche Do you have ideas of how to do this ? |
19cc6de
to
a92e91c
Compare
Do you think it can work like that ? I guess no, but I don't know.