mingmwang commented on code in PR #6084:
URL: https://github.com/apache/arrow-datafusion/pull/6084#discussion_r1177490594
##########
datafusion/optimizer/src/test/mod.rs:
##########
@@ -171,6 +190,23 @@ pub fn assert_optimized_plan_eq_display_indent(
assert_eq!(formatted_plan, expected);
}
+pub fn assert_multi_rules_optimized_plan_eq_display_indent(
+ rules: Vec<Arc<dyn OptimizerRule + Send + Sync>>,
+ plan: &LogicalPlan,
+ expected: &str,
+) {
+ let optimizer = Optimizer::with_rules(rules);
+ let mut optimized_plan = plan.clone();
+ for rule in &optimizer.rules {
+ optimized_plan = optimizer
+ .optimize_recursively(rule, &optimized_plan,
&OptimizerContext::new())
+ .expect("failed to optimize plan")
+ .unwrap_or_else(|| optimized_plan.clone());
+ }
+ let formatted_plan = format!("{}", optimized_plan.display_indent_schema());
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]