Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
better comments for string coercion
  • Loading branch information
XiangpengHao committed Jun 20, 2024
commit 39356a6292941e7752a10cf297f4629a1698ca68
12 changes: 6 additions & 6 deletions datafusion/expr/src/type_coercion/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -930,13 +930,13 @@ fn string_concat_internal_coercion(
fn string_coercion(lhs_type: &DataType, rhs_type: &DataType) -> Option<DataType> {
use arrow::datatypes::DataType::*;
match (lhs_type, rhs_type) {
// If Utf8View is in any side, we coerce to Utf8View.
(Utf8View, Utf8View | Utf8 | LargeUtf8) | (Utf8 | LargeUtf8, Utf8View) => {
Some(Utf8View)
}
// Then, if LargeUtf8 is in any side, we coerce to LargeUtf8.
(LargeUtf8, Utf8 | LargeUtf8) | (Utf8, LargeUtf8) => Some(LargeUtf8),
(Utf8, Utf8) => Some(Utf8),
(LargeUtf8, Utf8) | (Utf8, LargeUtf8) | (LargeUtf8, LargeUtf8) => Some(LargeUtf8),
(Utf8View, Utf8View)
| (Utf8View, Utf8)
| (Utf8, Utf8View)
| (LargeUtf8, Utf8View)
| (Utf8View, LargeUtf8) => Some(Utf8View),
_ => None,
}
}
Expand Down