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

Support array concat with different dimensions #6849

Open
2 tasks
jayzhan211 opened this issue Jul 5, 2023 · 1 comment
Open
2 tasks

Support array concat with different dimensions #6849

jayzhan211 opened this issue Jul 5, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@jayzhan211
Copy link
Contributor

jayzhan211 commented Jul 5, 2023

Is your feature request related to a problem or challenge?

Concatenates the two arrays. Concatenating a null or empty array is a no-op; otherwise the arrays must have the same number of dimensions (as illustrated by the first example) or differ in number of dimensions by one (as illustrated by the
second)
. Ref https://www.postgresql.org/docs/current/functions-array.html

Concat with the same number of dimensions is already supported, but the dimensions differ by one is not.

  • array_concat
  • array concat op (lhs || rhs)

Same dimensions concat

select array_concat(make_array([1,2], [3,4]), make_array([5, 6]))

[[1, 2], [3, 4], [5, 6]]

Diff 1 concat

select array_concat(make_array([1,2], [3,4]), make_array(5, 6))

[[1, 2], [3, 4], [5, 6]]

select array_concat(make_array(5, 6), make_array([1,2], [3,4]))

[[1, 2], [3, 4], [5, 6]]

Three of the result should be the same

Describe the solution you'd like

We can add an additional dimension to the lower dimension array, then contact them

Describe alternatives you've considered

Anything else that works

Additional context

I plan to work on this

@jayzhan211 jayzhan211 added the enhancement New feature or request label Jul 5, 2023
@izveigor
Copy link
Contributor

izveigor commented Jul 6, 2023

As you want to work with array_concat function, can you also add column support for this function (See the ticket: #6804 ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants