@@ -3469,13 +3469,14 @@ array_sort(array, desc, nulls_first)
34693469Converts each element to its text representation.
34703470
34713471```
3472- array_to_string(array, delimiter)
3472+ array_to_string(array, delimiter[, null_string] )
34733473```
34743474
34753475#### Arguments
34763476
34773477- ** array** : Array expression. Can be a constant, column, or function, and any combination of array operators.
34783478- ** delimiter** : Array element separator.
3479+ - ** null_string** : Optional. String to replace null values in the array. If not provided, nulls will be handled by default behavior.
34793480
34803481#### Example
34813482
@@ -3850,26 +3851,33 @@ range(start, stop, step)
38503851
38513852### ` string_to_array `
38523853
3853- Converts each element to its text representation .
3854+ Splits a string into an array of substrings based on a delimiter. Any substrings matching the optional ` null_str ` argument are replaced with NULL .
38543855
38553856```
3856- array_to_string(array , delimiter)
3857+ string_to_array(str , delimiter[, null_str] )
38573858```
38583859
38593860#### Arguments
38603861
3861- - ** array** : Array expression. Can be a constant, column, or function, and any combination of array operators.
3862- - ** delimiter** : Array element separator.
3862+ - ** str** : String expression to split.
3863+ - ** delimiter** : Delimiter string to split on.
3864+ - ** null_str** : Substring values to be replaced with ` NULL ` .
38633865
38643866#### Example
38653867
38663868``` sql
3867- > select array_to_string([[1 , 2 , 3 , 4 ], [5 , 6 , 7 , 8 ]], ' ,' );
3868- + -- --------------------------------------------------+
3869- | array_to_string(List([1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ]),Utf8(" ," )) |
3870- + -- --------------------------------------------------+
3871- | 1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 |
3872- + -- --------------------------------------------------+
3869+ > select string_to_array(' abc##def' , ' ##' );
3870+ + -- ---------------------------------+
3871+ | string_to_array(Utf8(' abc##def' )) |
3872+ + -- ---------------------------------+
3873+ | [' abc' , ' def' ] |
3874+ + -- ---------------------------------+
3875+ > select string_to_array(' abc def' , ' ' , ' def' );
3876+ + -- -------------------------------------------+
3877+ | string_to_array(Utf8(' abc def' ), Utf8(' ' ), Utf8(' def' )) |
3878+ + -- -------------------------------------------+
3879+ | [' abc' , NULL ] |
3880+ + -- -------------------------------------------+
38733881```
38743882
38753883#### Aliases
0 commit comments