create or replace function tokenize(s) as ( regexp_split_to_array(s, ' *, *') ); select tokenize('Hello,How,Are,You,Today') as tokens;