Skip to content
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

Fix issue #989: Impossible to create array with > 100 items #1001

Merged
merged 1 commit into from
Jun 21, 2023

Conversation

jrgemignani
Copy link
Contributor

Fixed issue 989: Impossible to create an object with an array field of more than 100 elements.

This issue is due to the function agtype_build_list taking elements as arguments. As the elements can be anything, expressions too, they need to be processed by the transform phase and resolved in the execution phase. As PG has a limitation of 100 function arguments, this restricts the size of arrays built through agtype_build_list.

The fix was to break up large lists into segments of 100 items or less and then use the concatenation operator to join them in the execution phase.

Added regression tests.

Copy link
Member

@dehowef dehowef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creative solution. Looks good to me

Copy link
Member

@MuhammadTahaNaveed MuhammadTahaNaveed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it with SET and nested cases as well. Looks good to me 👍🏻 .

@jrgemignani
Copy link
Contributor Author

jrgemignani commented Jun 21, 2023

@MuhammadTahaNaveed Could you provide me (email) with some of those tests? I will add them to the PR.

@MuhammadTahaNaveed
Copy link
Member

@MuhammadTahaNaveed Could you provide me (email) with some of those tests? I will add them to the PR.

Yeah sure.

Fixed issue 989: Impossible to create an object with an array field
of more than 100 elements.

This issue is due to the function agtype_build_list taking elements
as arguments. As the elements can be anything, expressions too,
they need to be processed by the transform phase and resolved in
the execution phase. As PG has a limitation of 100 function
arguments, this restricts the size of arrays built through
agtype_build_list.

The fix was to break up large lists into segments of 100 items or
less and then use the concatenation operator to join them in the
execution phase.

Added regression tests (thanks Taha!).
@jrgemignani
Copy link
Contributor Author

Added Taha's additional regression tests.

@dehowef
Copy link
Member

dehowef commented Jun 21, 2023

Additional tests look good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants