Skip to content

Commit

Permalink
hack: don't coerce utf8 view inside dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Feb 10, 2025
1 parent 5239d1a commit 8bb70a2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion datafusion/expr-common/src/type_coercion/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl<'a> BinaryTypeCoercer<'a> {
}
And | Or => if matches!((self.lhs, self.rhs), (Boolean | Null, Boolean | Null)) {
// Logical binary boolean operators can only be evaluated for
// boolean or null arguments.
// boolean or null arguments.
Ok(Signature::uniform(Boolean))
} else {
plan_err!(
Expand Down Expand Up @@ -502,6 +502,14 @@ pub fn type_union_resolution(data_types: &[DataType]) -> Option<DataType> {
}
}

// HACK: DataType::Utf8View is not a meaningful dictionary value type, so
// just pull this out if we dict-encoded it
if let Some(DataType::Dictionary(_, value_type)) = &candidate_type {
if value_type.as_ref() == &DataType::Utf8View {
candidate_type = Some(DataType::Utf8View);
}
}

candidate_type
}

Expand Down

0 comments on commit 8bb70a2

Please sign in to comment.