adriangb commented on code in PR #25352:
URL: https://github.com/apache/datafusion/pull/25352#discussion_r4031469542


##########
datafusion/sqllogictest/test_files/regexp/regexp_like.slt:
##########
@@ -454,3 +454,21 @@ NULL
 
 statement ok
 DROP TABLE t_invalid_pattern;
+
+# The kernel gives NULL for a row whose value is NULL and never compiles that
+# row's pattern, so the diagnosis names the pattern that made the kernel fail,
+# not the one of a row the kernel skipped.
+statement ok
+CREATE TABLE t_null_value(str varchar, pattern varchar) AS VALUES (NULL, 
'a(b'), ('abc', 'c[d');
+
+query error DataFusion error: Execution error: Regular expression did not 
compile: regex parse error[\s\S]*unclosed character class
+SELECT str ~ pattern FROM t_null_value;
+
+query error DataFusion error: Execution error: Regular expression did not 
compile: regex parse error[\s\S]*unclosed character class
+SELECT regexp_like(str, pattern) FROM t_null_value;
+
+query error DataFusion error: Execution error: Regular expression did not 
compile: regex parse error[\s\S]*unclosed character class
+SELECT regexp_like(str, pattern, 'm') FROM t_null_value;

Review Comment:
   Can we add a control:
   
   ```sql
   SELECT str ~ pattern FROM t_null_value WHERE str IS NULL;
   ```
   
   Worth also testing when pattern is null?



-- 
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