Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: log the execution plan in a more compact fashion #2906

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions rust/lance-datafusion/src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ use datafusion::{
TaskContext,
},
physical_plan::{
stream::RecordBatchStreamAdapter, streaming::PartitionStream, DisplayAs, DisplayFormatType,
ExecutionPlan, PlanProperties, SendableRecordBatchStream,
display::DisplayableExecutionPlan, stream::RecordBatchStreamAdapter,
streaming::PartitionStream, DisplayAs, DisplayFormatType, ExecutionPlan, PlanProperties,
SendableRecordBatchStream,
},
};
use datafusion_common::{DataFusionError, Statistics};
Expand All @@ -29,7 +30,7 @@ use lazy_static::lazy_static;
use futures::stream;
use lance_arrow::SchemaExt;
use lance_core::Result;
use log::{info, warn};
use log::{debug, info, warn};

/// An source execution node created from an existing stream
///
Expand Down Expand Up @@ -241,6 +242,11 @@ pub fn execute_plan(
plan: Arc<dyn ExecutionPlan>,
options: LanceExecutionOptions,
) -> Result<SendableRecordBatchStream> {
debug!(
"Executing plan:\n{}",
DisplayableExecutionPlan::new(plan.as_ref()).indent(true)
);

let session_ctx = get_session_context(options);

// NOTE: we are only executing the first partition here. Therefore, if
Expand Down
3 changes: 0 additions & 3 deletions rust/lance/src/dataset/scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ use lance_index::{scalar::expression::ScalarIndexExpr, DatasetIndexExt};
use lance_io::stream::RecordBatchStream;
use lance_linalg::distance::MetricType;
use lance_table::format::{Fragment, Index};
use log::debug;
use roaring::RoaringBitmap;
use tracing::{info_span, instrument, Span};

Expand Down Expand Up @@ -1112,8 +1111,6 @@ impl Scanner {
plan = rule.optimize(plan, &options)?;
}

debug!("Execution plan:\n{:?}", plan);

Ok(plan)
}

Expand Down
Loading