Skip to content

Commit c990851

Browse files
committed
Support =, <, <=, >, >=, !=, is distinct from, is not distinct from for BooleanArray
1 parent 2e63ea9 commit c990851

File tree

6 files changed

+592
-27
lines changed

6 files changed

+592
-27
lines changed

datafusion/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ avro = ["avro-rs", "num-traits"]
5252
[dependencies]
5353
ahash = "0.7"
5454
hashbrown = { version = "0.11", features = ["raw"] }
55-
arrow = { version = "6.1.0", features = ["prettyprint"] }
56-
parquet = { version = "6.1.0", features = ["arrow"] }
55+
arrow = { version = "6.2.0", features = ["prettyprint"] }
56+
parquet = { version = "6.2.0", features = ["arrow"] }
5757
sqlparser = "0.12"
5858
paste = "^1.0"
5959
num_cpus = "1.13.0"

datafusion/src/physical_optimizer/pruning.rs

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,36 +1374,24 @@ mod tests {
13741374

13751375
#[test]
13761376
fn prune_bool_column_eq_true() {
1377-
let (schema, statistics, _, _) = bool_setup();
1377+
let (schema, statistics, expected_true, _) = bool_setup();
13781378

13791379
// b1 = true
13801380
let expr = col("b1").eq(lit(true));
13811381
let p = PruningPredicate::try_new(&expr, schema).unwrap();
1382-
let result = p.prune(&statistics).unwrap_err();
1383-
assert!(
1384-
result.to_string().contains(
1385-
"Data type Boolean not supported for scalar operation 'lt_eq' on dyn array"
1386-
),
1387-
"{}",
1388-
result
1389-
)
1382+
let result = p.prune(&statistics).unwrap();
1383+
assert_eq!(result, expected_true);
13901384
}
13911385

13921386
#[test]
13931387
fn prune_bool_not_column_eq_true() {
1394-
let (schema, statistics, _, _) = bool_setup();
1388+
let (schema, statistics, _, expected_false) = bool_setup();
13951389

13961390
// !b1 = true
13971391
let expr = col("b1").not().eq(lit(true));
13981392
let p = PruningPredicate::try_new(&expr, schema).unwrap();
1399-
let result = p.prune(&statistics).unwrap_err();
1400-
assert!(
1401-
result.to_string().contains(
1402-
"Data type Boolean not supported for scalar operation 'lt_eq' on dyn array"
1403-
),
1404-
"{}",
1405-
result
1406-
)
1393+
let result = p.prune(&statistics).unwrap();
1394+
assert_eq!(result, expected_false);
14071395
}
14081396

14091397
/// Creates setup for int32 chunk pruning

0 commit comments

Comments
 (0)