From ead4a7c48c4789825f9d529e676e4fc169f3efa8 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Thu, 8 Aug 2024 12:20:30 -0400 Subject: [PATCH] Add comment about why it is ok to return boolean with catchall match --- datafusion/functions/src/regex/regexplike.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/datafusion/functions/src/regex/regexplike.rs b/datafusion/functions/src/regex/regexplike.rs index 455d009db778..20029ba005c4 100644 --- a/datafusion/functions/src/regex/regexplike.rs +++ b/datafusion/functions/src/regex/regexplike.rs @@ -76,6 +76,8 @@ impl ScalarUDFImpl for RegexpLikeFunc { Ok(match &arg_types[0] { Null => Null, + // Type coercion is done by DataFusion based on signature, so if we + // get here, the first argument is always a string _ => Boolean, }) }