Skip to content

Commit 8224cc6

Browse files
committed
update
1 parent c8e33f7 commit 8224cc6

39 files changed

+1261
-1500
lines changed

src/query/service/src/interpreters/interpreter_copy_into_table.rs

Lines changed: 135 additions & 295 deletions
Large diffs are not rendered by default.

src/query/service/src/interpreters/interpreter_factory.rs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,18 @@ impl InterpreterFactory {
156156
*graphical,
157157
)?)),
158158

159-
Plan::CopyIntoTable { .. } => todo!(),
160-
// Ok(Arc::new(CopyIntoTableInterpreter::try_create(
161-
// ctx,
162-
// *copy_plan.clone(),
163-
// )?)),
159+
Plan::CopyIntoTable {
160+
s_expr,
161+
metadata,
162+
stage_context,
163+
overwrite,
164+
} => Ok(Arc::new(CopyIntoTableInterpreter::try_create(
165+
ctx,
166+
*s_expr.clone(),
167+
metadata.clone(),
168+
stage_context.clone(),
169+
*overwrite,
170+
)?)),
164171
Plan::CopyIntoLocation(copy_plan) => Ok(Arc::new(
165172
CopyIntoLocationInterpreter::try_create(ctx, copy_plan.clone())?,
166173
)),

src/query/service/src/interpreters/interpreter_insert.rs

Lines changed: 0 additions & 261 deletions
This file was deleted.

src/query/service/src/interpreters/interpreter_replace.rs

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ use parking_lot::RwLock;
5050

5151
use crate::interpreters::common::check_deduplicate_label;
5252
use crate::interpreters::common::dml_build_update_stream_req;
53-
use crate::interpreters::interpreter_copy_into_table::CopyIntoTableInterpreter;
5453
use crate::interpreters::HookOperator;
5554
use crate::interpreters::Interpreter;
5655
use crate::interpreters::InterpreterPtr;
@@ -375,7 +374,7 @@ impl ReplaceInterpreter {
375374
ctx: Arc<QueryContext>,
376375
source: &'a InsertInputSource,
377376
schema: DataSchemaRef,
378-
purge_info: &mut Option<(Vec<StageFileInfo>, StageInfo)>,
377+
_purge_info: &mut Option<(Vec<StageFileInfo>, StageInfo)>,
379378
) -> Result<ReplaceSourceCtx> {
380379
match source {
381380
InsertInputSource::Values(source) => self
@@ -390,27 +389,29 @@ impl ReplaceInterpreter {
390389
InsertInputSource::SelectPlan(plan) => {
391390
self.connect_query_plan_source(ctx.clone(), plan).await
392391
}
393-
InsertInputSource::Stage(plan) => match *plan.clone() {
394-
// Plan::CopyIntoTable(copy_plan) => {
395-
// let interpreter =
396-
// CopyIntoTableInterpreter::try_create(ctx.clone(), *copy_plan.clone())?;
397-
// let (physical_plan, _) = interpreter.build_physical_plan(&copy_plan).await?;
398-
399-
// // TODO optimization: if copy_plan.stage_table_info.files_to_copy is None, there should be a short-cut plan
400-
401-
// *purge_info = Some((
402-
// copy_plan.stage_table_info.files_to_copy.unwrap_or_default(),
403-
// copy_plan.stage_table_info.stage_info.clone(),
404-
// ));
405-
// Ok(ReplaceSourceCtx {
406-
// root: Box::new(physical_plan),
407-
// select_ctx: None,
408-
// update_stream_meta: vec![],
409-
// bind_context: None,
410-
// })
411-
// }
412-
_ => unreachable!("plan in InsertInputSource::Stag must be CopyIntoTable"),
413-
},
392+
_ => todo!(),
393+
// InsertInputSource::Stage(plan) => match *plan.clone() {
394+
// Plan::CopyIntoTable(_copy_plan) => {
395+
// // let interpreter =
396+
// // CopyIntoTableInterpreter::try_create(ctx.clone(), *copy_plan.clone())?;
397+
// // let (physical_plan, _) = interpreter.build_physical_plan(&copy_plan).await?;
398+
399+
// // // TODO optimization: if copy_plan.stage_table_info.files_to_copy is None, there should be a short-cut plan
400+
401+
// // *purge_info = Some((
402+
// // copy_plan.stage_table_info.files_to_copy.unwrap_or_default(),
403+
// // copy_plan.stage_table_info.stage_info.clone(),
404+
// // ));
405+
// // Ok(ReplaceSourceCtx {
406+
// // root: Box::new(physical_plan),
407+
// // select_ctx: None,
408+
// // update_stream_meta: vec![],
409+
// // bind_context: None,
410+
// // })
411+
// todo!()
412+
// }
413+
// _ => unreachable!("plan in InsertInputSource::Stag must be CopyIntoTable"),
414+
// },
414415
}
415416
}
416417

0 commit comments

Comments
 (0)