You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by al...@apache.org on 2022/02/09 14:34:52 UTC

[arrow-datafusion] branch master updated: Less verbose plans in debug logging (#1787)

This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/master by this push:
     new f6df759  Less verbose plans in debug logging (#1787)
f6df759 is described below

commit f6df7592ee8a6e9b6773ef120615fe45255e1b6c
Author: Andrew Lamb <an...@nerdnetworks.org>
AuthorDate: Wed Feb 9 09:34:45 2022 -0500

    Less verbose plans in debug logging (#1787)
---
 datafusion/src/execution/context.rs     |  8 +++++---
 datafusion/src/physical_plan/planner.rs | 12 ++++++++----
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/datafusion/src/execution/context.rs b/datafusion/src/execution/context.rs
index e3d0ba9..d4f1ca4 100644
--- a/datafusion/src/execution/context.rs
+++ b/datafusion/src/execution/context.rs
@@ -38,7 +38,7 @@ use crate::{
         hash_build_probe_order::HashBuildProbeOrder, optimizer::PhysicalOptimizerRule,
     },
 };
-use log::debug;
+use log::{debug, trace};
 use parking_lot::Mutex;
 use std::collections::{HashMap, HashSet};
 use std::path::Path;
@@ -809,12 +809,14 @@ impl ExecutionContext {
         let execution_props = execution_props.start_execution();
 
         let mut new_plan = plan.clone();
-        debug!("Logical plan:\n {:?}", plan);
+        debug!("Input logical plan:\n{}\n", plan.display_indent());
+        trace!("Full input logical plan:\n{:?}", plan);
         for optimizer in optimizers {
             new_plan = optimizer.optimize(&new_plan, execution_props)?;
             observer(&new_plan, optimizer.as_ref());
         }
-        debug!("Optimized logical plan:\n {:?}", new_plan);
+        debug!("Optimized logical plan:\n{}\n", new_plan.display_indent());
+        trace!("Full Optimized logical plan:\n {:?}", plan);
         Ok(new_plan)
     }
 }
diff --git a/datafusion/src/physical_plan/planner.rs b/datafusion/src/physical_plan/planner.rs
index bf8be3d..838f745 100644
--- a/datafusion/src/physical_plan/planner.rs
+++ b/datafusion/src/physical_plan/planner.rs
@@ -64,7 +64,7 @@ use async_trait::async_trait;
 use expressions::col;
 use futures::future::BoxFuture;
 use futures::{FutureExt, StreamExt, TryStreamExt};
-use log::debug;
+use log::{debug, trace};
 use std::sync::Arc;
 
 fn create_function_physical_name(
@@ -1398,7 +1398,11 @@ impl DefaultPhysicalPlanner {
         F: FnMut(&dyn ExecutionPlan, &dyn PhysicalOptimizerRule),
     {
         let optimizers = &ctx_state.config.physical_optimizers;
-        debug!("Physical plan:\n{:?}", plan);
+        debug!(
+            "Input physical plan:\n{}\n",
+            displayable(plan.as_ref()).indent()
+        );
+        trace!("Detailed input physical plan:\n{:?}", plan);
 
         let mut new_plan = plan;
         for optimizer in optimizers {
@@ -1406,10 +1410,10 @@ impl DefaultPhysicalPlanner {
             observer(new_plan.as_ref(), optimizer.as_ref())
         }
         debug!(
-            "Optimized physical plan short version:\n{}\n",
+            "Optimized physical plan:\n{}\n",
             displayable(new_plan.as_ref()).indent()
         );
-        debug!("Optimized physical plan:\n{:?}", new_plan);
+        trace!("Detailed optimized physical plan:\n{:?}", new_plan);
         Ok(new_plan)
     }
 }