Skip to content

Commit b6c3e23

Browse files
committed
Allow any stringle types for concatination
1 parent 39d2324 commit b6c3e23

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • datafusion/expr-common/src/type_coercion

datafusion/expr-common/src/type_coercion/binary.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,14 @@ fn string_concat_coercion(lhs_type: &DataType, rhs_type: &DataType) -> Option<Da
11511151
(Dictionary(_, lhs_value_type), Dictionary(_, rhs_value_type)) => {
11521152
string_coercion(lhs_value_type, rhs_value_type).or(None)
11531153
}
1154-
_ => None,
1154+
_ =>
1155+
if can_cast_types(lhs_type, &Utf8) && can_cast_types(rhs_type, &Utf8) {
1156+
Some(Utf8)
1157+
} else if can_cast_types(lhs_type, &LargeUtf8) && can_cast_types(rhs_type, &LargeUtf8) {
1158+
Some(LargeUtf8)
1159+
} else {
1160+
None
1161+
}
11551162
})
11561163
}
11571164

0 commit comments

Comments
 (0)