Creates the physical expression from Expr and runs the expr simplifier
(expr: Expr, expected_expr: &str)
| 423 | |
| 424 | /// Creates the physical expression from Expr and runs the expr simplifier |
| 425 | fn create_simplified_expr_test(expr: Expr, expected_expr: &str) { |
| 426 | let batch = &TEST_BATCH; |
| 427 | let df_schema = DFSchema::try_from(batch.schema()).unwrap(); |
| 428 | |
| 429 | // Simplify the expression first |
| 430 | let simplify_context = SimplifyContext::builder() |
| 431 | .with_schema(Arc::new(df_schema)) |
| 432 | .build(); |
| 433 | let simplifier = ExprSimplifier::new(simplify_context).with_max_cycles(10); |
| 434 | let simplified = simplifier.simplify(expr).unwrap(); |
| 435 | create_expr_test(simplified, expected_expr); |
| 436 | } |
| 437 | |
| 438 | /// Returns a Batch with 3 rows and 4 columns: |
| 439 | /// |
no test coverage detected
searching dependent graphs…