Skip to content

Commit

Permalink
Workaround hits_partitioned issue
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Sep 13, 2024
1 parent e8f7384 commit 642f137
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions datafusion/expr-common/src/type_coercion/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1034,14 +1034,22 @@ fn binary_to_string_coercion(
) -> Option<DataType> {
use arrow::datatypes::DataType::*;
match (lhs_type, rhs_type) {
// Note: added rules to coerce from BinaryView --> Utf8View
// NEEDS testing (and the Clickbench schema merging for hits_partitioned may need better handling)
// (specifically the columns probably should be resolved as Utf8 rather than Binary so we can
// use the optimized Utf8 readingin parquet)
(Binary, Utf8) => Some(Utf8),
(Binary, LargeUtf8) => Some(LargeUtf8),
(BinaryView, Utf8) => Some(Utf8View),
(BinaryView, LargeUtf8) => Some(LargeUtf8),
(LargeBinary, Utf8) => Some(LargeUtf8),
(LargeBinary, LargeUtf8) => Some(LargeUtf8),
(Utf8, Binary) => Some(Utf8),
(Utf8, LargeBinary) => Some(LargeUtf8),
(Utf8, BinaryView) => Some(Utf8View),
(LargeUtf8, Binary) => Some(LargeUtf8),
(LargeUtf8, LargeBinary) => Some(LargeUtf8),
(LargeUtf8, BinaryView) => Some(Utf8View),
_ => None,
}
}
Expand Down

0 comments on commit 642f137

Please sign in to comment.