Skip to content

Commit

Permalink
fix: copy into table collect files twice some times.
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsofun committed Jan 16, 2025
1 parent e9fc0a1 commit 9260cd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/query/sql/src/planner/binder/copy_into_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ impl Binder {
write_mode: CopyIntoTableMode::Copy,
query: None,
enable_distributed: false,
files_collected: false,
})
}

Expand Down Expand Up @@ -403,6 +404,7 @@ impl Binder {

enable_distributed: false,
is_transform: false,
files_collected: true,
};

self.bind_copy_into_table_from_location(bind_context, plan)
Expand Down
6 changes: 6 additions & 0 deletions src/query/sql/src/planner/plans/copy_into_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,16 @@ pub struct CopyIntoTablePlan {
pub is_transform: bool,

pub enable_distributed: bool,

pub files_collected: bool,
}

impl CopyIntoTablePlan {
pub async fn collect_files(&mut self, ctx: &dyn TableContext) -> Result<()> {
if self.files_collected {
return Ok(());
}
self.files_collected = true;
ctx.set_status_info("begin to list files");
let start = Instant::now();

Expand Down

0 comments on commit 9260cd2

Please sign in to comment.