File tree Expand file tree Collapse file tree 2 files changed +28
-8
lines changed
Expand file tree Collapse file tree 2 files changed +28
-8
lines changed Original file line number Diff line number Diff line change @@ -287,7 +287,14 @@ impl Catalog for MutableCatalog {
287287 req : UpdateTableMetaReq ,
288288 ) -> Result < UpdateTableMetaReply > {
289289 match table_info. db_type . clone ( ) {
290- DatabaseType :: NormalDB => Ok ( self . ctx . meta . update_table_meta ( req) . await ?) ,
290+ DatabaseType :: NormalDB => {
291+ info ! (
292+ "updating table meta. table desc: [{}], has copied files: [{}]?" ,
293+ table_info. desc,
294+ req. copied_files. is_some( )
295+ ) ;
296+ Ok ( self . ctx . meta . update_table_meta ( req) . await ?)
297+ }
291298 DatabaseType :: ShareDB ( share_ident) => {
292299 let db = self
293300 . get_database ( & share_ident. tenant , & share_ident. share_name )
Original file line number Diff line number Diff line change @@ -260,6 +260,10 @@ impl CopyInterpreter {
260260 info ! ( "end to list files: got {} files" , num_all_files) ;
261261
262262 let need_copy_file_infos = if force {
263+ info ! (
264+ "force mode, ignore file filtering. ({}.{})" ,
265+ database_name, table_name
266+ ) ;
263267 all_source_file_infos
264268 } else {
265269 // Status.
@@ -429,13 +433,22 @@ impl CopyInterpreter {
429433 let table_id = to_table. get_id ( ) ;
430434 let expire_hours = ctx. get_settings ( ) . get_load_file_metadata_expire_hours ( ) ?;
431435
432- let fail_if_duplicated = !force;
433- let upsert_copied_files_request = Self :: upsert_copied_files_request (
434- table_id,
435- expire_hours,
436- copied_file_tree,
437- fail_if_duplicated,
438- ) ;
436+ let upsert_copied_files_request = {
437+ if stage_info. copy_options . purge && force {
438+ // if `purge-after-copy` is enabled, and in `force` copy mode,
439+ // we do not need to upsert copied files into meta server
440+ info ! ( "[purge] and [force] are both enabled, will not update copied-files set. ({})" , & to_table. get_table_info( ) . desc) ;
441+ None
442+ } else {
443+ let fail_if_duplicated = !force;
444+ Self :: upsert_copied_files_request (
445+ table_id,
446+ expire_hours,
447+ copied_file_tree,
448+ fail_if_duplicated,
449+ )
450+ }
451+ } ;
439452
440453 {
441454 let status = format ! ( "begin commit, number of copied files:{}" , num_copied_files) ;
You can’t perform that action at this time.
0 commit comments