STRTOK_SPLIT_TO_TABLE
functionsupportedCore SQL functionsTokenizes a string with the given set of delimiters and flattens the results into rows.
Syntax
supportedpartialnot supportednot scored
STRTOK_SPLIT_TO_TABLE(<string> [,<delimiter_list>])
Parameters
| Name | Required | Description |
|---|---|---|
string | required | Text to be tokenized. |
delimiter_list | optional | Optional set of delimiters. The default value is a single space character. |
Usage notes
- If string is an empty string, NULL, or contains only delimiter characters, the function returns no rows. This behavior differs from SPLIT_TO_TABLE, which returns one row for an empty string.
- Because the function returns no rows for these inputs, the corresponding input rows are omitted from the result of a lateral join, even when you specify LEFT JOIN LATERAL. To keep every input row, use STRTOK_TO_ARRAY with FLATTEN and specify OUTER => TRUE. For an example, see Keep input rows that produce no tokens.
Output
This function returns the following columns: Column name | Data type | Description SEQ | NUMBER | A unique sequence number associated with the input record. The sequence is not guaranteed to be gap-free or ordered. in any particular way. INDEX | NUMBER | The one-based index of the element. VALUE | VARCHAR | The value of the element of the flattened array. Note The query can also access the columns of the original (correlated) table that served as the source of data for this function. If a single row from the original table resulted in multiple rows in the flattened view, the values in this input row are replicated to match the number of rows produced by this function.