alamb commented on code in PR #11753:
URL: https://github.com/apache/datafusion/pull/11753#discussion_r1709879009


##########
datafusion/sqllogictest/test_files/string_view.slt:
##########
@@ -322,6 +322,378 @@ logical_plan
 03)----TableScan: test projection=[column1_utf8, column2_utf8, 
column1_utf8view]
 
 
+# Ensure string functions use native StringView implementation
+# and do not fall back to Utf8 or LargeUtf8
+# Should see no casts to Utf8 in the plans below
+
+## Ensure no casts for LIKE/ILIKE
+query TT
+EXPLAIN SELECT
+  column1_utf8view like 'foo' as "like",
+  column1_utf8view ilike 'foo' as "ilike"
+FROM test;
+----
+logical_plan
+01)Projection: test.column1_utf8view LIKE Utf8View("foo") AS like, 
test.column1_utf8view ILIKE Utf8View("foo") AS ilike
+02)--TableScan: test projection=[column1_utf8view]
+
+
+
+## Ensure no casts for ASCII
+## TODO file ticket
+query TT
+EXPLAIN SELECT
+  ASCII(column1_utf8view) AS l
+FROM test;
+----
+logical_plan
+01)Projection: ascii(CAST(test.column1_utf8view AS Utf8)) AS l
+02)--TableScan: test projection=[column1_utf8view]
+
+
+## Ensure no casts for BTRIM
+## TODO file ticket
+query TT
+EXPLAIN SELECT
+  BTRIM(column1_utf8view, 'foo') AS l
+FROM test;
+----
+logical_plan
+01)Projection: btrim(CAST(test.column1_utf8view AS Utf8), Utf8("foo")) AS l
+02)--TableScan: test projection=[column1_utf8view]
+
+## Ensure no casts for CHARACTER_LENGTH
+## TODO file ticket
+query TT
+EXPLAIN SELECT
+  CHARACTER_LENGTH(column1_utf8view) AS l

Review Comment:
   I debugged and fixed it here: f42aa84e6



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to