Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: polish log for copy.
Browse files Browse the repository at this point in the history
youngsofun committed May 10, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 9e2cf95 commit b235269
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/query/sql/src/planner/binder/binder.rs
Original file line number Diff line number Diff line change
@@ -36,7 +36,6 @@ use databend_common_expression::Expr;
use databend_common_functions::BUILTIN_FUNCTIONS;
use databend_common_meta_app::principal::StageFileFormatType;
use indexmap::IndexMap;
use log::info;
use log::warn;

use super::Finder;
@@ -136,7 +135,10 @@ impl<'a> Binder {
let mut init_bind_context = BindContext::new();
let plan = self.bind_statement(&mut init_bind_context, stmt).await?;
self.bind_query_index(&mut init_bind_context, &plan).await?;
info!("bind stmt to plan, time used: {:?}", start.elapsed());
self.ctx.set_status_info(&format!(
"bind stmt to plan done, time used: {:?}",
start.elapsed()
));
Ok(plan)
}

8 changes: 6 additions & 2 deletions src/query/sql/src/planner/plans/copy_into_table.rs
Original file line number Diff line number Diff line change
@@ -227,12 +227,16 @@ impl CopyIntoTablePlan {
(files_to_copy, duplicated_files)
};

let len = need_copy_file_infos.len();
let sum: u64 = need_copy_file_infos.iter().map(|i| i.size).sum();

info!(
"{}: read files with max_files={:?} finished, all:{}, need copy:{}, elapsed:{:?}",
"{}: collect files with max_files={:?} finished, need to copy {} files, {} bytes; skip {} duplicated files, time used:{:?}",
ctx.get_id(),
max_files,
num_all_files,
need_copy_file_infos.len(),
num_all_files - len,
sum,
start.elapsed()
);

0 comments on commit b235269

Please sign in to comment.