Skip to content

Commit

Permalink
fix(query): fix copy into table with disable distributed copy into (#โ€ฆ
Browse files Browse the repository at this point in the history
โ€ฆ16529)

* fix(query): fix copy into table with diable distributed copy into

* fix(query): fix copy into table with diable distributed copy into
  • Loading branch information
zhang2014 authored Sep 27, 2024
1 parent 6f10276 commit 9f9e508
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/query/sql/src/executor/physical_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,6 @@ impl PhysicalPlan {
| PhysicalPlan::CacheScan(_)
| PhysicalPlan::ExchangeSource(_)
| PhysicalPlan::CompactSource(_)
| PhysicalPlan::CopyIntoTable(_)
| PhysicalPlan::ReplaceAsyncSourcer(_)
| PhysicalPlan::Recluster(_)
| PhysicalPlan::RecursiveCteScan(_) => Box::new(std::iter::empty()),
Expand Down Expand Up @@ -652,6 +651,10 @@ impl PhysicalPlan {
PhysicalPlan::ChunkAppendData(plan) => Box::new(std::iter::once(plan.input.as_ref())),
PhysicalPlan::ChunkMerge(plan) => Box::new(std::iter::once(plan.input.as_ref())),
PhysicalPlan::ChunkCommitInsert(plan) => Box::new(std::iter::once(plan.input.as_ref())),
PhysicalPlan::CopyIntoTable(v) => match &v.source {
CopyIntoTableSource::Query(v) => Box::new(std::iter::once(v.as_ref())),
CopyIntoTableSource::Stage(v) => Box::new(std::iter::once(v.as_ref())),
},
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
statement ok
DROP STAGE IF EXISTS stage_t4;

statement ok
DROP TABLE IF EXISTS t4;

statement ok
CREATE STAGE stage_t4;

statement ok
CREATE TABLE t4(str string);

statement ok
set enable_distributed_copy_into = 0;

statement ok
copy into @stage_t4 from (SELECT to_string(number) as str from numbers(10));

statement ok
COPY INTO t4 from @stage_t4 pattern='.*' FILE_FORMAT = (TYPE = 'parquet') PURGE=true FORCE=true max_files=10000;

statement ok
DROP STAGE IF EXISTS stage_t4;

statement ok
DROP TABLE IF EXISTS t4;

0 comments on commit 9f9e508

Please sign in to comment.