SPLIT
All functions > STRING > SPLIT
Returns an array of substrings from a string split by a delimiter.
Signatures
Returns: Array of substrings
SPLIT(string: VARCHAR, delimiter: VARCHAR, [limit: BIGINT]) → ARRAYVARCHAR sql
| Parameter | Type | Required | Description |
|---|---|---|---|
string | VARCHAR | Yes | String to split |
delimiter | VARCHAR | Yes | Delimiter to split on |
limit | BIGINT | No | Maximum number of splits (optional) |
Notes
- If delimiter is not found, returns array with original string
- Empty strings between delimiters are included
- If limit is specified, splits into at most limit parts
- With limit, remainder stays together in last element
Examples
FeatureQL
SELECT
f1 := SPLIT('apple,banana,cherry', ','), -- Basic split
f2 := SPLIT('one-two-three', '-'), -- Dash delimiter
f3 := SPLIT('hello world', ' '), -- Space delimiter
f4 := SPLIT('no delimiter', ',') -- No delimiter found
;Result
| f1 ARRAY | f2 ARRAY | f3 ARRAY | f4 ARRAY |
|---|---|---|---|
| [apple, banana, cherry] | [one, two, three] | [hello, world] | [no delimiter] |
On this page