()
| 4363 | |
| 4364 | #[test] |
| 4365 | fn prune_cast_scalar() { |
| 4366 | // The data type of column i is INT32 |
| 4367 | let (schema, statistics) = int32_setup(); |
| 4368 | let expected_ret = &[true, true, false, true, true]; |
| 4369 | |
| 4370 | prune_with_expr( |
| 4371 | // i > int64(0) |
| 4372 | col("i").gt(cast(lit(ScalarValue::Int64(Some(0))), DataType::Int32)), |
| 4373 | &schema, |
| 4374 | &statistics, |
| 4375 | expected_ret, |
| 4376 | ); |
| 4377 | |
| 4378 | prune_with_expr( |
| 4379 | // cast(i as int64) > int64(0) |
| 4380 | cast(col("i"), DataType::Int64).gt(lit(ScalarValue::Int64(Some(0)))), |
| 4381 | &schema, |
| 4382 | &statistics, |
| 4383 | expected_ret, |
| 4384 | ); |
| 4385 | |
| 4386 | prune_with_expr( |
| 4387 | // try_cast(i as int64) > int64(0) |
| 4388 | try_cast(col("i"), DataType::Int64).gt(lit(ScalarValue::Int64(Some(0)))), |
| 4389 | &schema, |
| 4390 | &statistics, |
| 4391 | expected_ret, |
| 4392 | ); |
| 4393 | |
| 4394 | prune_with_expr( |
| 4395 | // `-cast(i as int64) < 0` convert to `cast(i as int64) > -0` |
| 4396 | Expr::Negative(Box::new(cast(col("i"), DataType::Int64))) |
| 4397 | .lt(lit(ScalarValue::Int64(Some(0)))), |
| 4398 | &schema, |
| 4399 | &statistics, |
| 4400 | expected_ret, |
| 4401 | ); |
| 4402 | } |
| 4403 | |
| 4404 | #[test] |
| 4405 | fn test_increment_utf8() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…