Skip to content

Commit 000ad58

Browse files
authored
chore: fix copy/spill log message (#15482)
* chore: fix copy/spill log message * fix query plan output, to avoid breakline * add line by line log for physical log
1 parent 9332a35 commit 000ad58

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

src/query/service/src/interpreters/interpreter_select.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,14 +255,12 @@ impl Interpreter for SelectInterpreter {
255255

256256
// 0. Need to build physical plan first to get the partitions.
257257
let physical_plan = self.build_physical_plan().await?;
258+
258259
let query_plan = physical_plan
259260
.format(self.metadata.clone(), Default::default())?
260261
.format_pretty()?;
261-
info!(
262-
"Query id: {}, query plan: {}",
263-
self.ctx.get_id(),
264-
query_plan
265-
);
262+
263+
info!("Query physical plan: \n{}", query_plan);
266264

267265
if self.ctx.get_settings().get_enable_query_result_cache()? && self.ctx.get_cacheable() {
268266
let key = gen_result_cache_key(self.formatted_ast.as_ref().unwrap());

src/query/service/src/pipelines/processors/transforms/hash_join/build_spill/transform_build_spill.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,10 @@ impl BuildSpillHandler {
158158
return Ok(HashJoinBuildStep::Spill);
159159
}
160160
if build_state.join_type() != JoinType::Cross {
161-
info!(
162-
"Processor: {}, spill info: {}",
163-
processor_id,
164-
self.spill_state().spiller.format_spill_info()
165-
);
161+
let spill_info = self.spill_state().spiller.format_spill_info();
162+
if !spill_info.is_empty() {
163+
info!("Processor: {}, spill info: {}", processor_id, spill_info);
164+
}
166165
}
167166
if !spilled_partition_set.is_empty() {
168167
build_state

src/query/sql/src/planner/plans/copy_into_table.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,15 +228,15 @@ impl CopyIntoTablePlan {
228228
(files_to_copy, duplicated_files)
229229
};
230230

231-
let len = need_copy_file_infos.len();
232-
let sum: u64 = need_copy_file_infos.iter().map(|i| i.size).sum();
231+
let num_copied_files = need_copy_file_infos.len();
232+
let copied_bytes: u64 = need_copy_file_infos.iter().map(|i| i.size).sum();
233233

234234
info!(
235235
"collect files with max_files={:?} finished, need to copy {} files, {} bytes; skip {} duplicated files, time used:{:?}",
236236
max_files,
237237
need_copy_file_infos.len(),
238-
num_all_files - len,
239-
sum,
238+
copied_bytes,
239+
num_all_files - num_copied_files,
240240
start.elapsed()
241241
);
242242

0 commit comments

Comments
 (0)