Skip to content

Commit

Permalink
fix: CopyIntoTablePlan should in Box. (#13183)
Browse files Browse the repository at this point in the history
Co-authored-by: dantengsky <[email protected]>
  • Loading branch information
youngsofun and dantengsky authored Oct 10, 2023
1 parent 2cd332b commit d8451a1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/query/service/src/interpreters/interpreter_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl InterpreterFactory {

Plan::CopyIntoTable(copy_plan) => Ok(Arc::new(CopyIntoTableInterpreter::try_create(
ctx,
copy_plan.clone(),
*copy_plan.clone(),
)?)),
Plan::CopyIntoLocation(copy_plan) => Ok(Arc::new(
CopyIntoLocationInterpreter::try_create(ctx, copy_plan.clone())?,
Expand Down
2 changes: 1 addition & 1 deletion src/query/service/src/interpreters/interpreter_replace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ impl ReplaceInterpreter {
InsertInputSource::Stage(plan) => match *plan.clone() {
Plan::CopyIntoTable(copy_plan) => {
let interpreter =
CopyIntoTableInterpreter::try_create(ctx.clone(), copy_plan.clone())?;
CopyIntoTableInterpreter::try_create(ctx.clone(), *copy_plan.clone())?;
let (physical_plan, files) =
interpreter.build_physical_plan(&copy_plan).await?;
*purge_info = Some((files, copy_plan.stage_table_info.stage_info.clone()));
Expand Down
6 changes: 3 additions & 3 deletions src/query/sql/src/planner/binder/copy_into_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ impl<'a> Binder {
self.bind_copy_from_query_into_table(bind_ctx, plan, &select_list, &None)
.await
} else {
Ok(Plan::CopyIntoTable(plan))
Ok(Plan::CopyIntoTable(Box::new(plan)))
}
}

Expand Down Expand Up @@ -326,7 +326,7 @@ impl<'a> Binder {

if need_copy_file_infos.is_empty() {
plan.no_file_to_copy = true;
return Ok(Plan::CopyIntoTable(plan));
return Ok(Plan::CopyIntoTable(Box::new(plan)));
}
plan.stage_table_info.files_to_copy = Some(need_copy_file_infos.clone());

Expand Down Expand Up @@ -371,7 +371,7 @@ impl<'a> Binder {
ignore_result: false,
formatted_ast: None,
}));
Ok(Plan::CopyIntoTable(plan))
Ok(Plan::CopyIntoTable(Box::new(plan)))
}

#[async_backtrace::framed]
Expand Down
2 changes: 1 addition & 1 deletion src/query/sql/src/planner/plans/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub enum Plan {
plan: Box<Plan>,
},

CopyIntoTable(CopyIntoTablePlan),
CopyIntoTable(Box<CopyIntoTablePlan>),
CopyIntoLocation(CopyIntoLocationPlan),

// Call is rewrite into Query
Expand Down

1 comment on commit d8451a1

@vercel
Copy link

@vercel vercel bot commented on d8451a1 Oct 10, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.