adriangb commented on code in PR #22887:
URL: https://github.com/apache/datafusion/pull/22887#discussion_r3396994211
##########
datafusion/optimizer/src/analyzer/type_coercion.rs:
##########
@@ -613,6 +613,33 @@ impl TreeNodeRewriter for TypeCoercionRewriter<'_> {
case_insensitive,
))))
}
+ Expr::SimilarTo(Like {
+ negated,
+ expr,
+ pattern,
+ escape_char,
+ case_insensitive,
+ }) => {
+ let left_type = expr.get_type(self.schema)?;
+ let right_type = pattern.get_type(self.schema)?;
+ let coerced_type = regex_coercion(&left_type,
&right_type).ok_or_else(|| {
+ plan_datafusion_err!(
+ "There isn't a common type to coerce {left_type} and
{right_type} in SIMILAR TO expression"
+ )
+ })?;
+ let expr = match left_type {
Review Comment:
good point! i've gone with your second suggestion (add dictionary support to
the array-array regex path) in 8ca1f7e6f6d2235347030bf0ac96f555746ba395
--
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]