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

array_concat does not work with nested empty arrays #7028

Closed
izveigor opened this issue Jul 19, 2023 · 0 comments · Fixed by #7008
Closed

array_concat does not work with nested empty arrays #7028

izveigor opened this issue Jul 19, 2023 · 0 comments · Fixed by #7008
Labels
bug Something isn't working

Comments

@izveigor
Copy link
Contributor

Describe the bug

The user @parkma99 first implemented the mechanism of operation of the function array_concat with empty arrays. But current implementation does not support nested empty arrays.

To Reproduce

❯ select array_concat(make_array(make_array(1, 2), make_array(3, 4)), make_array(make_array()));
+----------------------------------------------------------------------------------------------------------------+
| array_concat(make_array(make_array(Int64(1),Int64(2)),make_array(Int64(3),Int64(4))),make_array(make_array())) |
+----------------------------------------------------------------------------------------------------------------+
| [[1, 2], [3, 4], []]                                                                                           |
+----------------------------------------------------------------------------------------------------------------+

Expected behavior

❯ select array_concat(make_array(make_array(1, 2), make_array(3, 4)), make_array(make_array()));
+----------------------------------------------------------------------------------------------------------------+
| array_concat(make_array(make_array(Int64(1),Int64(2)),make_array(Int64(3),Int64(4))),make_array(make_array())) |
+----------------------------------------------------------------------------------------------------------------+
| [[1, 2], [3, 4]]                                                                                               |
+----------------------------------------------------------------------------------------------------------------+

The output should be similar to PostgreSQL.
PostgreSQL:

postgres=# select array_cat(array[array[1, 2], array[3, 4]], array[array[]::integer[], array[]::integer[], array[]::integer[]]);
   array_cat   
---------------
 {{1,2},{3,4}}
(1 row)

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant