Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hack: don't coerce utf8 view inside dictionary #5

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading