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 constructor #3591

Closed
big-andy-coates opened this issue Oct 16, 2019 · 1 comment · Fixed by #3612
Closed

Support Array constructor #3591

big-andy-coates opened this issue Oct 16, 2019 · 1 comment · Fixed by #3612

Comments

@big-andy-coates
Copy link
Contributor

We do not currently have support for creating instances of ARRAYs. Our SQL grammar does have rules for this: ARRAY[1,2,3] should create an array.

We should support arrays being created with literals, e.g. ARRAY[1,2,3] and with expressions, e.g. ARRAY[col1, 1 + 2, col3 / col4, max(col5, col6)].

We should support constructed arrays being used in:

  • INSERT VALUES statements - it's currently not possible to insert an array into an existing source.
  • SELECT expressions, e.g. SELECT ARRAY[col0, col1] FROM ...
  • WHERE/HAVING expressions, e.g. WHERE col0 = ARRAY[0,2]
  • GROUP BY, e.g. GROUP BY ARRAY[col0, col1]
  • etc
@agavra
Copy link
Contributor

agavra commented Oct 16, 2019

As a workaround (does not work in INSERT VALUES) I introduced the AS_ARRAY UDF. I think a valuable improvement would be to also allow INSERT VALUES to use UDFs.

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

Successfully merging a pull request may close this issue.

2 participants