Skip to content

Commit 200bb85

Browse files
authored
Merge pull request #10530 from BohuTANG/dev-copy-more-status
chore(copy): refine the copy status info
2 parents 417a4a9 + c08c851 commit 200bb85

File tree

1 file changed

+24
-34
lines changed

1 file changed

+24
-34
lines changed

src/query/service/src/interpreters/interpreter_copy.rs

Lines changed: 24 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,7 @@ impl CopyInterpreter {
291291
let mut stage_table_info = stage_table_info.clone();
292292
let mut all_source_file_infos = StageTable::list_files(&stage_table_info).await?;
293293

294-
// Status.
295-
{
296-
let status = format!("end to list files: {}", all_source_file_infos.len());
297-
ctx.set_status_info(&status);
298-
info!(status);
299-
}
294+
info!("end to list files: {}", all_source_file_infos.len());
300295

301296
if !force {
302297
// Status.
@@ -315,12 +310,7 @@ impl CopyInterpreter {
315310
)
316311
.await?;
317312

318-
// Status.
319-
{
320-
let status = format!("end to color copied files: {}", all_source_file_infos.len());
321-
ctx.set_status_info(&status);
322-
info!(status);
323-
}
313+
info!("end to color copied files: {}", all_source_file_infos.len());
324314
}
325315

326316
let mut need_copied_file_infos = vec![];
@@ -344,7 +334,7 @@ impl CopyInterpreter {
344334

345335
// Status.
346336
{
347-
let status = "begin to read stage table plan";
337+
let status = "begin to read stage source plan";
348338
ctx.set_status_info(status);
349339
info!(status);
350340
}
@@ -359,8 +349,11 @@ impl CopyInterpreter {
359349

360350
// Status.
361351
{
362-
let status = "begin to read stage table data";
363-
ctx.set_status_info(status);
352+
let status = format!(
353+
"begin to read stage table data, parts:{}",
354+
read_source_plan.parts.len()
355+
);
356+
ctx.set_status_info(&status);
364357
info!(status);
365358
}
366359

@@ -436,6 +429,13 @@ impl CopyInterpreter {
436429
.await?;
437430

438431
// 2. Upsert files(status with NeedCopy) info to meta.
432+
// Status.
433+
{
434+
let status = format!("begin to upsert copied files:{}", copied_files.len());
435+
ctx.set_status_info(&status);
436+
info!(status);
437+
}
438+
439439
CopyInterpreter::upsert_copied_files_info_to_meta(
440440
&ctx,
441441
tenant,
@@ -446,6 +446,8 @@ impl CopyInterpreter {
446446
)
447447
.await?;
448448

449+
info!("end to upsert copied files");
450+
449451
// 3. log on_error mode errors.
450452
// todo(ariesdevil): persist errors with query_id
451453
if let Some(error_map) = ctx.get_on_error_map() {
@@ -466,8 +468,7 @@ impl CopyInterpreter {
466468

467469
// Status.
468470
{
469-
let status =
470-
format!("begin to purge files:{}", all_source_files.len(),);
471+
let status = format!("begin to purge files:{}", all_source_files.len());
471472
ctx.set_status_info(&status);
472473
info!(status);
473474
}
@@ -479,25 +480,14 @@ impl CopyInterpreter {
479480
)
480481
.await;
481482

482-
// Status.
483-
{
484-
let status = format!(
485-
"end to purge files:{}, elapsed:{}",
486-
all_source_files.len(),
487-
purge_start.elapsed().as_secs()
488-
);
489-
ctx.set_status_info(&status);
490-
info!(status);
491-
}
483+
info!(
484+
"end to purge files:{}, elapsed:{}",
485+
all_source_files.len(),
486+
purge_start.elapsed().as_secs()
487+
);
492488
}
493489

494-
// Status.
495-
{
496-
let status =
497-
format!("all copy finished, elapsed:{}", start.elapsed().as_secs());
498-
ctx.set_status_info(&status);
499-
info!(status);
500-
}
490+
info!("all copy finished, elapsed:{}", start.elapsed().as_secs());
501491

502492
Ok(())
503493
});

0 commit comments

Comments
 (0)