I have a page URL column components of which are delimited by /
. I tried to run the SPLIT()
function in BigQuery but it only gives the first value.
in standard sql, you can use the following functions:
array[OFFSET(zero_based_offset)]
array[ORDINAL(one_based_ordinal)]
so
SELECT SPLIT(path, '/')[OFFSET(1)] part2,
SPLIT(path, '/')[ORDINAL(2)] part2_again,
SPLIT(path, '/')[ORDINAL(3)] part3
FROM (SELECT "/a/b/aaaa?c" path)
part2 part2_again part3
a a b
part1
in this case, is empty string (before the first slash)