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

Implement string_to_array #9283

Closed
Tracked by #8831
lmatz opened this issue Apr 19, 2023 · 5 comments
Closed
Tracked by #8831

Implement string_to_array #9283

lmatz opened this issue Apr 19, 2023 · 5 comments
Assignees
Labels
help wanted Issues that need help from contributors priority/high type/feature user-facing-changes Contains changes that are visible to users
Milestone

Comments

@lmatz
Copy link
Contributor

lmatz commented Apr 19, 2023

aka split, a fundamental operation,
wonder if there is any other workaround?

@github-actions github-actions bot added this to the release-0.19 milestone Apr 19, 2023
@lmatz lmatz added help wanted Issues that need help from contributors type/feature labels Apr 19, 2023
@lmatz
Copy link
Contributor Author

lmatz commented Apr 19, 2023

For POC

@y-wei y-wei self-assigned this Apr 20, 2023
@y-wei
Copy link
Contributor

y-wei commented Apr 20, 2023

string_to_array ( string text, delimiter text [, null_string text ] ) → text[]
Splits the string at occurrences of delimiter and forms the resulting fields into a text array. If delimiter is NULL, each character in the string will become a separate element in the array. If delimiter is an empty string, then the string is treated as a single field. If null_string is supplied and is not NULL, fields matching that string are replaced by NULL. See also array_to_string.
string_to_array('xxyyzz', '~~', 'yy') → {xx,NULL,zz}

Do we need to support all 1, 2, or 3-parameter version?
No hard, tho

@lmatz
Copy link
Contributor Author

lmatz commented Apr 20, 2023

it seems only the last parameter, null string, is optional, not sure if I understand you correctly?

The first two input arguments are necessary. We can first support the basic one without the last parameter if the last one introduces much complexity. It is the most common use case.

@y-wei
Copy link
Contributor

y-wei commented Apr 20, 2023

Yes, my bad. The third parameter isn't a big problem yet I'm trying to solve the case where the second parameter is NULL...

@lmatz lmatz added the user-facing-changes Contains changes that are visible to users label Apr 20, 2023
@y-wei
Copy link
Contributor

y-wei commented Apr 20, 2023

closed by merged #9289

@y-wei y-wei closed this as completed Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issues that need help from contributors priority/high type/feature user-facing-changes Contains changes that are visible to users
Projects
None yet
Development

No branches or pull requests

2 participants