@@ -32,7 +32,7 @@ use futures::TryStreamExt;
32
32
use regex:: Regex ;
33
33
34
34
use super :: append2table;
35
- use crate :: interpreters:: interpreter_common:: list_files ;
35
+ use crate :: interpreters:: interpreter_common:: stat_file ;
36
36
use crate :: interpreters:: Interpreter ;
37
37
use crate :: interpreters:: SelectInterpreterV2 ;
38
38
use crate :: pipelines:: PipelineBuildResult ;
@@ -79,12 +79,7 @@ impl CopyInterpreterV2 {
79
79
// if force is false, copy only the files that unmatch to the meta copied files info.
80
80
let resp = catalog. get_table_copied_file_info ( req) . await ?;
81
81
for file in files. iter ( ) {
82
- let stage_file = list_files ( & self . ctx , & table_info. stage_info , file, "" ) . await ?;
83
- if stage_file. is_empty ( ) {
84
- continue ;
85
- }
86
-
87
- let stage_file = & stage_file[ 0 ] ;
82
+ let stage_file = stat_file ( & self . ctx , & table_info. stage_info , file) . await ?;
88
83
89
84
if let Some ( file_info) = resp. file_info . get ( file) {
90
85
match & file_info. etag {
@@ -120,12 +115,8 @@ impl CopyInterpreterV2 {
120
115
} else {
121
116
// if force is true, copy all the file.
122
117
for file in files. iter ( ) {
123
- let stage_file = list_files ( & self . ctx , & table_info. stage_info , file, "" ) . await ?;
124
- if stage_file. is_empty ( ) {
125
- continue ;
126
- }
118
+ let stage_file = stat_file ( & self . ctx , & table_info. stage_info , file) . await ?;
127
119
128
- let stage_file = & stage_file[ 0 ] ;
129
120
file_map. insert ( file. clone ( ) , TableCopiedFileInfo {
130
121
etag : stage_file. etag . clone ( ) ,
131
122
content_length : stage_file. size ,
0 commit comments