()
| 322 | |
| 323 | #[test] |
| 324 | fn test_create_physical_expr_nvl2() { |
| 325 | let batch = &TEST_BATCH; |
| 326 | let df_schema = DFSchema::try_from(batch.schema()).unwrap(); |
| 327 | let ctx = SessionContext::new(); |
| 328 | |
| 329 | let expect_err = |expr| { |
| 330 | let physical_expr = ctx.create_physical_expr(expr, &df_schema).unwrap(); |
| 331 | let err = physical_expr.evaluate(batch).unwrap_err(); |
| 332 | assert!( |
| 333 | err.to_string() |
| 334 | .contains("nvl2 should have been simplified to case"), |
| 335 | "unexpected error: {err:?}" |
| 336 | ); |
| 337 | }; |
| 338 | |
| 339 | expect_err(nvl2(col("i"), lit(1i64), lit(0i64))); |
| 340 | expect_err(nvl2(lit(1i64), col("i"), lit(0i64))); |
| 341 | } |
| 342 | |
| 343 | #[tokio::test] |
| 344 | async fn test_create_physical_expr_coercion() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…