MCPcopy Create free account
hub / github.com/apache/datafusion / create_simplified_expr_test

Function create_simplified_expr_test

datafusion/core/tests/expr_api/mod.rs:425–436  ·  view source on GitHub ↗

Creates the physical expression from Expr and runs the expr simplifier

(expr: Expr, expected_expr: &str)

Source from the content-addressed store, hash-verified

423
424/// Creates the physical expression from Expr and runs the expr simplifier
425fn 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///

Callers 2

Calls 7

newFunction · 0.85
create_expr_testFunction · 0.85
with_max_cyclesMethod · 0.80
schemaMethod · 0.45
buildMethod · 0.45
with_schemaMethod · 0.45
simplifyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…