Skip to content

Commit 2b6600b

Browse files
committed
fix
1 parent 2af7d26 commit 2b6600b

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/query/sql/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ databend-common-pipeline-transforms = { workspace = true }
3232
databend-common-settings = { workspace = true }
3333
databend-common-storage = { workspace = true }
3434
databend-common-storages-result-cache = { workspace = true }
35+
databend-common-storages-stage = { workspace = true }
3536
databend-common-storages-view = { workspace = true }
3637
databend-common-users = { workspace = true }
3738
databend-enterprise-data-mask-feature = { workspace = true }

src/query/sql/src/planner/binder/copy_into_table.rs

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ use databend_common_ast::ast::TypeName;
3636
use databend_common_ast::parser::parse_values_with_placeholder;
3737
use databend_common_ast::parser::tokenize_sql;
3838
use databend_common_ast::Span;
39+
use databend_common_catalog::catalog::CATALOG_DEFAULT;
3940
use databend_common_catalog::plan::list_stage_files;
4041
use databend_common_catalog::plan::StageTableInfo;
4142
use databend_common_catalog::table_context::StageAttachment;
@@ -57,6 +58,7 @@ use databend_common_meta_app::principal::NullAs;
5758
use databend_common_meta_app::principal::StageInfo;
5859
use databend_common_meta_app::principal::COPY_MAX_FILES_PER_COMMIT;
5960
use databend_common_storage::StageFilesInfo;
61+
use databend_common_storages_stage::StageTable;
6062
use databend_common_users::UserApiProvider;
6163
use derive_visitor::Drive;
6264
use log::debug;
@@ -321,17 +323,20 @@ impl<'a> Binder {
321323
)
322324
.await
323325
} else {
324-
let (scan, bind_context) = self
325-
.bind_stage_table(
326-
self.ctx.clone(),
327-
bind_ctx,
328-
stage_table_info.stage_info.clone(),
329-
stage_table_info.files_info.clone(),
330-
&None,
331-
stage_table_info.files_to_copy.clone(),
332-
case_sensitive,
333-
)
334-
.await?;
326+
let table = StageTable::try_create(stage_table_info.clone())?;
327+
let table_index = self.metadata.write().add_table(
328+
CATALOG_DEFAULT.to_string(),
329+
"system".to_string(),
330+
table.clone(),
331+
None,
332+
false,
333+
false,
334+
true,
335+
false,
336+
);
337+
338+
let (scan, bind_context) =
339+
self.bind_base_table(bind_ctx, "system", table_index, None, &None)?;
335340
copy_into_table_plan.project_columns = Some(bind_context.columns.clone());
336341

337342
let copy_into =

0 commit comments

Comments
 (0)