Skip to content

Commit

Permalink
fix and add more test cases related to string_split
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisiou committed Sep 23, 2024
1 parent 26d379e commit d47d814
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/sql/function/list/list_reverse.test
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ statement ok
INSERT INTO palindromes VALUES ('racecar'), ('civic'), ('defied'), ('repaper'), ('kayak'), ('rotator'), ('tattarrattat'), ('saippuakivikauppias'), ('malayalam');

query I
SELECT list_aggr(${f}(str_split(s, '')), 'string_agg', '') FROM palindromes ORDER BY s;
SELECT list_aggr(${f}(string_split_regex(s, '')), 'string_agg', '') FROM palindromes ORDER BY s;
----
civic
deifed
Expand Down
12 changes: 11 additions & 1 deletion test/sql/function/string/test_split_part.test
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,17 @@ select split_part('','',1)
query T
select split_part('a,b,c','',3)
----
b
(empty)

query T
select split_part('abc','',1)
----
abc

query T
select split_part('abc','',2)
----
(empty)

query T
select split_part('',',',1)
Expand Down
4 changes: 2 additions & 2 deletions test/sql/function/string/test_string_split.test
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,9 @@ SELECT string_split_regex('a', '')
[a]

query T
SELECT string_split_regex('abc', '')
SELECT string_split_regex('abcde', '')
----
[a, b, c]
[a, b, c, d, e]


query T
Expand Down
4 changes: 2 additions & 2 deletions test/sql/storage/compression/string/big_strings.test
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ statement ok
checkpoint

query III
SELECT list_aggr(str_split(a,''),'min'), list_aggr(str_split(a,''),'min'), strlen(a) from normal_string
SELECT list_aggr(string_split_regex(a,''),'min'), list_aggr(string_split_regex(a,''),'min'), strlen(a) from normal_string
----
a a 3900
b b 3900
Expand Down Expand Up @@ -61,7 +61,7 @@ statement ok
checkpoint

query III
SELECT list_aggr(str_split(a,''),'min'), list_aggr(str_split(a,''),'min'), strlen(a) from big_string
SELECT list_aggr(string_split_regex(a,''),'min'), list_aggr(string_split_regex(a,''),'min'), strlen(a) from big_string
----
a a 8000
b b 8000
Expand Down

0 comments on commit d47d814

Please sign in to comment.