goldmedal commented on code in PR #13260:
URL: https://github.com/apache/datafusion/pull/13260#discussion_r1831061785


##########
datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs:
##########
@@ -3633,32 +3697,123 @@ mod tests {
 
     #[test]
     fn test_like_and_ilke() {
-        // LIKE '%'
-        let expr = like(col("c1"), "%");
+        let null = lit(ScalarValue::Utf8(None));
+
+        // expr [NOT] [I]LIKE NULL
+        let expr = like(col("c1"), null.clone());

Review Comment:
   ```suggestion
           let expr = col("c1").like(null.clone());
   ```
   As @alamb's comment 
(https://github.com/apache/datafusion/pull/13260#discussion_r1830873028), we 
can do some refactor like this.



##########
datafusion/sqllogictest/test_files/string/string_view.slt:
##########
@@ -396,8 +396,9 @@ EXPLAIN SELECT
 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]
+01)Projection: __common_expr_1 AS like, __common_expr_1 AS ilike

Review Comment:
   Agreed. I did some tests. I think they still use the native StringView 
implementation for pattern matching.
   ```
   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]
   ```



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to