Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
Signed-off-by: Chojan Shang <psiace@apache.org>
  • Loading branch information
PsiACE committed Aug 14, 2024
1 parent f32c444 commit 907e27e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
27 changes: 26 additions & 1 deletion datafusion/sqllogictest/test_files/functions.slt
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ SELECT products.* REPLACE (price*2 AS price, product_id+1000 AS product_id) FROM
1003 OldBrand Product 3 79.98
1004 OldBrand Product 4 99.98

#overlay tests
# overlay tests
statement ok
CREATE TABLE over_test(
str TEXT,
Expand Down Expand Up @@ -913,6 +913,31 @@ NULL
Thomxas
NULL

# overlay tests with utf8view
query T
SELECT overlay(arrow_cast(str, 'Utf8View') placing arrow_cast(characters, 'Utf8View') from pos for len) from over_test
----
abc
qwertyasdfg
ijkz
Thomas
NULL
NULL
NULL
NULL

query T
SELECT overlay(arrow_cast(str, 'Utf8View') placing arrow_cast(characters, 'Utf8View') from pos) from over_test
----
abc
qwertyasdfg
ijk
Thomxas
NULL
NULL
Thomxas
NULL

query I
SELECT levenshtein('kitten', 'sitting')
----
Expand Down
9 changes: 8 additions & 1 deletion datafusion/sqllogictest/test_files/string_view.slt
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,6 @@ logical_plan
02)--TableScan: test projection=[column1_utf8view]

## Ensure no casts for OVERLAY
## TODO file ticket
query TT
EXPLAIN SELECT
OVERLAY(column1_utf8view PLACING 'foo' FROM 2 ) as c1
Expand All @@ -729,6 +728,14 @@ logical_plan
01)Projection: overlay(test.column1_utf8view, Utf8View("foo"), Int64(2)) AS c1
02)--TableScan: test projection=[column1_utf8view]

query T
SELECT OVERLAY(column1_utf8view PLACING 'foo' FROM 2 ) as c1 FROM test;
----
Afooew
Xfoogpeng
Rfooael
NULL

## Ensure no casts for REGEXP_LIKE
query TT
EXPLAIN SELECT
Expand Down

0 comments on commit 907e27e

Please sign in to comment.