You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/07/14 16:27:41 UTC

[GitHub] [arrow-datafusion] andygrove commented on a diff in pull request #2909: Optimizer should skip failing rules

andygrove commented on code in PR #2909:
URL: https://github.com/apache/arrow-datafusion/pull/2909#discussion_r921346443


##########
datafusion/optimizer/src/optimizer.rs:
##########
@@ -97,13 +106,85 @@ impl Optimizer {
         debug!("Input logical plan:\n{}\n", plan.display_indent());
         trace!("Full input logical plan:\n{:?}", plan);
         for rule in &self.rules {
-            new_plan = rule.optimize(&new_plan, optimizer_config)?;
-            observer(&new_plan, rule.as_ref());
-            debug!("After apply {} rule:\n", rule.name());
-            debug!("Optimized logical plan:\n{}\n", new_plan.display_indent());
+            let result = rule.optimize(&new_plan, optimizer_config);
+            match result {
+                Ok(plan) => {
+                    new_plan = plan;
+                    observer(&new_plan, rule.as_ref());
+                    debug!("After apply {} rule:\n", rule.name());
+                    debug!("Optimized logical plan:\n{}\n", new_plan.display_indent());
+                }
+                Err(ref e) => {
+                    if optimizer_config.skip_failing_rules {

Review Comment:
   This is the main change here - we now have the option to ignore optimization rules that fail



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org