SPLIT
Syntax
SPLIT( orig_string [ , delimiter [ , part_index ] ] )
Description
Returns a substring from orig_string
using the delimiter
delimiter character to divide the string into a sequence of part_index
parts. Delimiter is a comma by default. If part_index
is not passed, an array is returned (only for ClickHouse
, PostgreSQL
sources)
Argument types:
orig_string
—String
delimiter
—String
part_index
—Integer
Return type: Depends on argument types
Note
Only constant values are accepted for the arguments (delimiter
).
Examples
SPLIT("192.168.0.1", ".", 1) = "192"
SPLIT("192.168.0.1", ".", -1) = "1"
Data source support
ClickHouse 21.8
, MySQL 5.7
, PostgreSQL 9.3
, YDB
.