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

make_array can not form columns with lists #6993

Closed
izveigor opened this issue Jul 17, 2023 · 1 comment · Fixed by #7137
Closed

make_array can not form columns with lists #6993

izveigor opened this issue Jul 17, 2023 · 1 comment · Fixed by #7137
Labels
bug Something isn't working

Comments

@izveigor
Copy link
Contributor

Describe the bug

Follow on to #6384
Follow on to #6804
make_array can not form columns with lists.
When we are working with scalars, that problem does not appear. But the situation changes dramatically when we use columns. With columns make_array function always returns only 1 row.

To Reproduce

❯ select * from arrays_values_without_nulls;
+------------------------------------------+---------+---------+---------+
| column1                                  | column2 | column3 | column4 |
+------------------------------------------+---------+---------+---------+
| [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]          | 1       | 1       | ,       |
| [11, 12, 13, 14, 15, 16, 17, 18, 19, 20] | 12      | 2       | .       |
| [21, 22, 23, 24, 25, 26, 27, 28, 29, 30] | 23      | 3       | -       |
| [31, 32, 33, 34, 35, 26, 37, 38, 39, 40] | 34      | 4       | ok      |
+------------------------------------------+---------+---------+---------+
4 rows in set. Query took 0.015 seconds.
❯ select make_array(column1) from arrays_values_without_nulls;
+-------------------------------------------------+
| make_array(arrays_values_without_nulls.column1) |
+-------------------------------------------------+
| [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]               |
+-------------------------------------------------+
1 row in set. Query took 0.017 seconds.

Expected behavior

❯ select * from arrays_values_without_nulls;
+------------------------------------------+---------+---------+---------+
| column1                                  | column2 | column3 | column4 |
+------------------------------------------+---------+---------+---------+
| [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]          | 1       | 1       | ,       |
| [11, 12, 13, 14, 15, 16, 17, 18, 19, 20] | 12      | 2       | .       |
| [21, 22, 23, 24, 25, 26, 27, 28, 29, 30] | 23      | 3       | -       |
| [31, 32, 33, 34, 35, 26, 37, 38, 39, 40] | 34      | 4       | ok      |
+------------------------------------------+---------+---------+---------+
4 rows in set. Query took 0.015 seconds.
❯ select make_array(column1) from arrays_values_without_nulls;
+-------------------------------------------------+
| make_array(arrays_values_without_nulls.column1) |
+-------------------------------------------------+
| [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]               |
| [[11, 12, 13, 14, 15, 16, 17, 18, 19, 20]]      |
| [[21, 22, 23, 24, 25, 26, 27, 28, 29, 30]]      |
| [[31, 32, 33, 34, 35, 36, 37, 38, 39, 40]]      |
+-------------------------------------------------+
1 row in set. Query took 0.017 seconds.

Additional context

No response

@jayzhan211
Copy link
Contributor

Let me take a look on this issue

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.

2 participants