@@ -304,7 +304,9 @@ query error does not support zero arguments
304304SELECT * FROM (SELECT 1) WHERE TRY_CAST(STARTS_WITH() AS INT) = 1;
305305
306306###################################################################
307- ## SIMILAR TO type coercion (https://github.com/apache/datafusion/issues/22886)
307+ ## SIMILAR TO type coercion
308+ ## https://github.com/apache/datafusion/issues/22886
309+ ## https://github.com/apache/datafusion/issues/23732
308310###################################################################
309311
310312# NULL pattern is coerced to a typed NULL and evaluates to NULL instead of panicking
@@ -349,8 +351,7 @@ SELECT arrow_cast(t.s, 'Dictionary(Int32, Utf8)') SIMILAR TO p.pat FROM t CROSS
349351----
350352true
351353
352- # non-scalar Utf8View / LargeUtf8 patterns are accepted by the SQL planner and
353- # coerced by the analyzer (https://github.com/apache/datafusion/issues/23732)
354+ # non-scalar string-like patterns are coerced by the analyzer
354355query B
355356SELECT t.s SIMILAR TO arrow_cast(p.pat, 'Utf8View') FROM t CROSS JOIN p;
356357----
@@ -366,8 +367,12 @@ SELECT t.s NOT SIMILAR TO arrow_cast(p.pat, 'Utf8View') FROM t CROSS JOIN p;
366367----
367368false
368369
369- # NULL patterns (literal or Null-typed non-scalar) are accepted by the planner
370- # and evaluate to NULL
370+ query B
371+ SELECT t.s SIMILAR TO arrow_cast(p.pat, 'Dictionary(Int32, Utf8)') FROM t CROSS JOIN p;
372+ ----
373+ true
374+
375+ # NULL patterns (literal or Null-typed non-scalar) evaluate to NULL
371376query B
372377SELECT t.s SIMILAR TO NULL FROM t;
373378----
@@ -394,6 +399,6 @@ DROP TABLE p;
394399query error There isn't a common type to coerce Int64 and Utf8 in SIMILAR TO expression
395400SELECT 1 SIMILAR TO 'a';
396401
397- # a non-string pattern is rejected even earlier, during SQL planning
398- query error Invalid pattern in SIMILAR TO expression
402+ # a non-string pattern is rejected by the analyzer
403+ query error There isn't a common type to coerce Utf8 and Int64 in SIMILAR TO expression
399404SELECT 'a' SIMILAR TO 1;
0 commit comments