Skip to content

Commit e193b4d

Browse files
committed
test(cube): Fix test failures broken by number->boolean coercion change
1 parent 7b95f1d commit e193b4d

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

datafusion/expr-common/src/type_coercion/binary.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,7 +1607,16 @@ mod tests {
16071607
let result_type =
16081608
BinaryTypeCoercer::new(&input_decimal, &Operator::Eq, &DataType::Boolean)
16091609
.get_input_types();
1610+
// Cube: Actually we pass this one with number->bool conversion
1611+
// assert!(result_type.is_err());
1612+
assert!(result_type.is_ok());
1613+
1614+
// Cube: Here's a failing one
1615+
let result_type =
1616+
BinaryTypeCoercer::new(&input_decimal, &Operator::Eq, &DataType::Binary)
1617+
.get_input_types();
16101618
assert!(result_type.is_err());
1619+
16111620
Ok(())
16121621
}
16131622

datafusion/physical-expr/src/expressions/case.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,9 @@ mod tests {
10771077
None,
10781078
schema.as_ref(),
10791079
);
1080-
assert!(expr.is_err());
1080+
// Cube: expr is not err because of number to boolean conversion
1081+
// assert!(expr.is_err());
1082+
assert!(!expr.is_err());
10811083

10821084
// then 1 is int32
10831085
// then 2 is int64

datafusion/sqllogictest/test_files/scalar.slt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1536,8 +1536,12 @@ SELECT not(true), not(false)
15361536
----
15371537
false true
15381538

1539-
query error type_coercion\ncaused by\nError during planning: Cannot infer common argument type for comparison operation Int64 IS DISTINCT FROM Boolean
1539+
# Cube: We added number->bool conversion
1540+
# query error type_coercion\ncaused by\nError during planning: Cannot infer common argument type for comparison operation Int64 IS DISTINCT FROM Boolean
1541+
query BB
15401542
SELECT not(1), not(0)
1543+
----
1544+
false true
15411545

15421546
query ?B
15431547
SELECT null, not(null)

0 commit comments

Comments
 (0)