NGA-TRAN commented on a change in pull request #434:
URL: https://github.com/apache/arrow-datafusion/pull/434#discussion_r641767736



##########
File path: datafusion/src/logical_plan/plan.rs
##########
@@ -438,11 +439,11 @@ impl LogicalPlan {
                 }
                 true
             }
+            LogicalPlan::Explain { plan, .. } => plan.accept(visitor)?,

Review comment:
       This is the fix that enables LogicalPlan's `display_...` functions to 
show all info of the plan. The newly added tests capture this fix.

##########
File path: datafusion/src/logical_plan/plan.rs
##########
@@ -329,11 +329,12 @@ impl LogicalPlan {
             LogicalPlan::Limit { input, .. } => vec![input],
             LogicalPlan::Extension { node } => node.inputs(),
             LogicalPlan::Union { inputs, .. } => inputs.iter().collect(),
+            LogicalPlan::Explain { plan, .. } => vec![plan],

Review comment:
       This is the fix that progpagates the optimization down the plan explain 

##########
File path: datafusion/src/optimizer/filter_push_down.rs
##########
@@ -234,6 +234,10 @@ fn split_members<'a>(predicate: &'a Expr, predicates: &mut 
Vec<&'a Expr>) {
 
 fn optimize(plan: &LogicalPlan, mut state: State) -> Result<LogicalPlan> {
     match plan {
+        LogicalPlan::Explain { .. } => {
+            // push the optimization to the plan of this explain
+            push_down(&state, plan)
+        }

Review comment:
       This is related to the fix to propagate the optimization down




-- 
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.

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


Reply via email to