Skip to content

Commit

Permalink
utf8view fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jayzhan211 committed Feb 11, 2025
1 parent d5428b2 commit cac8400
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions datafusion/expr-common/src/type_coercion/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,16 @@ fn type_union_resolution_coercion(
}
(DataType::Dictionary(index_type, value_type), other_type)
| (other_type, DataType::Dictionary(index_type, value_type)) => {
let new_value_type = type_union_resolution_coercion(value_type, other_type);
new_value_type.map(|t| DataType::Dictionary(index_type.clone(), Box::new(t)))
match type_union_resolution_coercion(value_type, other_type) {
// Dict(k, Utf8View) is redundant, Utf8View is good enough
Some(DataType::Utf8View) => {
Some(DataType::Utf8View)
}
Some(new_value_type) => {
Some(DataType::Dictionary(index_type.clone(), Box::new(new_value_type)))
}
None => None,
}
}
(DataType::Struct(lhs), DataType::Struct(rhs)) => {
if lhs.len() != rhs.len() {
Expand Down

0 comments on commit cac8400

Please sign in to comment.