Skip to content

Commit 907e27e

Browse files
committed
Add more tests
Signed-off-by: Chojan Shang <[email protected]>
1 parent f32c444 commit 907e27e

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

datafusion/sqllogictest/test_files/functions.slt

+26-1
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ SELECT products.* REPLACE (price*2 AS price, product_id+1000 AS product_id) FROM
871871
1003 OldBrand Product 3 79.98
872872
1004 OldBrand Product 4 99.98
873873

874-
#overlay tests
874+
# overlay tests
875875
statement ok
876876
CREATE TABLE over_test(
877877
str TEXT,
@@ -913,6 +913,31 @@ NULL
913913
Thomxas
914914
NULL
915915

916+
# overlay tests with utf8view
917+
query T
918+
SELECT overlay(arrow_cast(str, 'Utf8View') placing arrow_cast(characters, 'Utf8View') from pos for len) from over_test
919+
----
920+
abc
921+
qwertyasdfg
922+
ijkz
923+
Thomas
924+
NULL
925+
NULL
926+
NULL
927+
NULL
928+
929+
query T
930+
SELECT overlay(arrow_cast(str, 'Utf8View') placing arrow_cast(characters, 'Utf8View') from pos) from over_test
931+
----
932+
abc
933+
qwertyasdfg
934+
ijk
935+
Thomxas
936+
NULL
937+
NULL
938+
Thomxas
939+
NULL
940+
916941
query I
917942
SELECT levenshtein('kitten', 'sitting')
918943
----

datafusion/sqllogictest/test_files/string_view.slt

+8-1
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,6 @@ logical_plan
719719
02)--TableScan: test projection=[column1_utf8view]
720720

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

731+
query T
732+
SELECT OVERLAY(column1_utf8view PLACING 'foo' FROM 2 ) as c1 FROM test;
733+
----
734+
Afooew
735+
Xfoogpeng
736+
Rfooael
737+
NULL
738+
732739
## Ensure no casts for REGEXP_LIKE
733740
query TT
734741
EXPLAIN SELECT

0 commit comments

Comments
 (0)