You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem or challenge?
I would like to take a string like "a / b / c" and return [a, b, c] as an array.
Describe the solution you'd like
A function like the Postgres string_to_array function. E.g.:
select 'a / b / c' as original, string_to_array('a / b / c', ' / ') as array
+-----------+-----------+
| original | array |
+-----------+-----------+
| a / b / c | [a, b, c] |
+-----------+-----------+
More generally:
string_to_array(string, delimiter [, null_value])
Describe alternatives you've considered
split_part can split a string and return a single part based on the position, but if the number of delimiters in the string isn't known in advance, this doesn't work well.
I haven't seen any other functions that would allow this, but I may have overlooked something.
Additional context
I am preparing a PR for this, but wanted to create an issue first. For example, it would be good to know:
is the postgres function string_to_array a good one to model this off, or if a different SQL flavour is preferred.
would this be better created as a string function or an array function. I think string function, but I'm not sure
if I've totally overlooked something that solves this problem already, or if someone else is working on something similar
whether this will be a welcome addition, or if there is a plan for something different
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem or challenge?
I would like to take a string like "a / b / c" and return [a, b, c] as an array.
Describe the solution you'd like
A function like the Postgres
string_to_array
function. E.g.:More generally:
Describe alternatives you've considered
split_part
can split a string and return a single part based on the position, but if the number of delimiters in the string isn't known in advance, this doesn't work well.I haven't seen any other functions that would allow this, but I may have overlooked something.
Additional context
I am preparing a PR for this, but wanted to create an issue first. For example, it would be good to know:
The text was updated successfully, but these errors were encountered: