Skip to content

Arrays with elements other than literal are not supported #7380

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

Closed
jiangzhx opened this issue Aug 23, 2023 · 2 comments
Closed

Arrays with elements other than literal are not supported #7380

jiangzhx opened this issue Aug 23, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@jiangzhx
Copy link
Contributor

Is your feature request related to a problem or challenge?

Using the CASE WHEN statement in ARRAY.

select [case when col1>0 then true else false end,case when col1>0 then true else false end];

Describe the solution you'd like

select [case when col1>0 then true else false end,case when col1>0 then true else false end];

Describe alternatives you've considered

perhaps this is a good place to give it a try.

https://github.com/apache/arrow-datafusion/blob/62816370822cb5e16a46d5050a41f62016af917f/datafusion/sql/src/expr/value.rs#L128-L151

Additional context

No response

@jiangzhx jiangzhx added the enhancement New feature or request label Aug 23, 2023
@jiangzhx
Copy link
Contributor Author

I'm not sure if this feature should be included in the discussion on the following issue:
#6980.

@jiangzhx
Copy link
Contributor Author

I found another way to make this work.

select make_array(case when 1>0 then true else false end,case when 2>0 then true else false end);

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

Successfully merging a pull request may close this issue.

1 participant