diff --git a/datafusion/expr-common/src/type_coercion/binary.rs b/datafusion/expr-common/src/type_coercion/binary.rs index fdee00f81b1e6..3f9429bff71d2 100644 --- a/datafusion/expr-common/src/type_coercion/binary.rs +++ b/datafusion/expr-common/src/type_coercion/binary.rs @@ -1151,7 +1151,17 @@ fn string_concat_coercion(lhs_type: &DataType, rhs_type: &DataType) -> Option { string_coercion(lhs_value_type, rhs_value_type).or(None) } - _ => None, + _ => { + if can_cast_types(lhs_type, &Utf8) && can_cast_types(rhs_type, &Utf8) { + Some(Utf8) + } else if can_cast_types(lhs_type, &LargeUtf8) + && can_cast_types(rhs_type, &LargeUtf8) + { + Some(LargeUtf8) + } else { + None + } + } }) }