-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a578e09
commit c050def
Showing
4 changed files
with
49 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
**Example** | ||
|
||
The following code example splits the string `stephen70|esimpson|ruthgill|` at each `|` character and returns the resulting array as `nicknames`: | ||
|
||
``` sql | ||
SELECT STRING_TO_ARRAY('stephen70|esimpson|ruthgill|', '|') AS nicknames; | ||
``` | ||
|
||
**Returns** | ||
|
||
| nicknames (ARRAY(TEXT)) | | ||
| :--- | | ||
| {stephen70,esimpson,ruthgill,""} | | ||
|
||
**Example** | ||
|
||
The following code example calls `STRING_TO_ARRAY` with an empty delimiter, producing an array containing a single element which contains the input text: | ||
|
||
``` sql | ||
SELECT STRING_TO_ARRAY('firebolt', '') as size_one_array; | ||
``` | ||
|
||
**Returns** | ||
|
||
| size_one_array (ARRAY(TEXT)) | | ||
| :--- | | ||
| {firebolt} | | ||
|
||
**Example** | ||
|
||
The following example calls `STRING_TO_ARRAY` with `NULL` as the delimiter, splitting the text into individual characters: | ||
|
||
``` sql | ||
SELECT STRING_TO_ARRAY('firebolt', NULL) AS single_characters; | ||
``` | ||
|
||
**Returns** | ||
|
||
| single_characters (ARRAY(TEXT)) | | ||
| :--- | | ||
| {f,i,r,e,b,o,l,t} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ select vector_add([1, 2, 5], [3, 4, -2]) as res | |
|
||
| res (ARRAY(BIGINT)) | | ||
| :--- | | ||
| {4 | 6 | 3} | | ||
| {4,6,3} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters