Skip to content

Commit

Permalink
fix(copy): fix copy abort not in history. (#11102)
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
youngsofun and mergify[bot] authored Apr 18, 2023
1 parent 3e8b5ce commit ca768f0
Showing 1 changed file with 42 additions and 28 deletions.
70 changes: 42 additions & 28 deletions src/query/service/src/interpreters/interpreter_copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,22 +205,29 @@ impl CopyInterpreter {
)?;

build_res.main_pipeline.set_on_finished(move |may_error| {
if may_error.is_none() {
CopyInterpreter::commit_copy_into_table(
ctx.clone(),
to_table,
stage_info,
need_copy_file_infos,
force,
)?;
// Status.
{
info!("all copy finished, elapsed:{}", start.elapsed().as_secs());
match may_error {
None => {
CopyInterpreter::commit_copy_into_table(
ctx.clone(),
to_table,
stage_info,
need_copy_file_infos,
force,
)?;
// Status.
{
info!("all copy finished, elapsed:{}", start.elapsed().as_secs());
}
}
Some(error) => {
error!(
"copy failed, elapsed:{}, reason: {}",
start.elapsed().as_secs(),
error
);
}
Ok(())
} else {
Err(may_error.as_ref().unwrap().clone())
}
Ok(())
});

Ok(build_res)
Expand Down Expand Up @@ -382,22 +389,29 @@ impl CopyInterpreter {

let stage_table_info_clone = stage_table_info.clone();
build_res.main_pipeline.set_on_finished(move |may_error| {
if may_error.is_none() {
CopyInterpreter::commit_copy_into_table(
ctx.clone(),
to_table,
stage_table_info_clone.stage_info,
need_copy_file_infos,
force,
)?;
// Status.
{
info!("all copy finished, elapsed:{}", start.elapsed().as_secs());
match may_error {
None => {
CopyInterpreter::commit_copy_into_table(
ctx.clone(),
to_table,
stage_table_info_clone.stage_info,
need_copy_file_infos,
force,
)?;
// Status.
{
info!("all copy finished, elapsed:{}", start.elapsed().as_secs());
}
}
Some(error) => {
error!(
"copy failed, elapsed:{}, reason: {}",
start.elapsed().as_secs(),
error
);
}
Ok(())
} else {
Err(may_error.as_ref().unwrap().clone())
}
Ok(())
});

Ok(build_res)
Expand Down

1 comment on commit ca768f0

@vercel
Copy link

@vercel vercel bot commented on ca768f0 Apr 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

databend – ./

databend-databend.vercel.app
databend.vercel.app
databend-git-main-databend.vercel.app
databend.rs

Please sign in to comment.