Skip to content

Commit

Permalink
revert the fix for apache#3387
Browse files Browse the repository at this point in the history
  • Loading branch information
liukun4515 committed Sep 16, 2022
1 parent 3013e04 commit cbe943b
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions datafusion/expr/src/binary_rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,13 @@ fn mathematics_numerical_coercion(
return None;
};

// same type => all good
// TODO: remove this
// bug: https://github.com/apache/arrow-datafusion/issues/3387
if lhs_type == rhs_type {
return Some(lhs_type.clone());
}

// these are ordered from most informative to least informative so
// that the coercion removes the least amount of information
match (lhs_type, rhs_type) {
Expand Down Expand Up @@ -895,12 +902,13 @@ mod tests {
DataType::Float64
);
// decimal
test_coercion_binary_rule!(
DataType::Decimal128(10, 2),
DataType::Decimal128(10, 2),
Operator::Plus,
DataType::Decimal128(11, 2)
);
// bug: https://github.com/apache/arrow-datafusion/issues/3387 will be fixed in the next pr
// test_coercion_binary_rule!(
// DataType::Decimal128(10, 2),
// DataType::Decimal128(10, 2),
// Operator::Plus,
// DataType::Decimal128(11, 2)
// );
test_coercion_binary_rule!(
DataType::Int32,
DataType::Decimal128(10, 2),
Expand Down

0 comments on commit cbe943b

Please sign in to comment.