File tree 1 file changed +13
-5
lines changed
1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -168,11 +168,19 @@ impl StorageDir {
168
168
let random_string =
169
169
rand:: distributions:: Alphanumeric . sample_string ( & mut rand:: thread_rng ( ) , 15 ) ;
170
170
for arrow_file_path in arrow_files {
171
- let key = Self :: arrow_path_to_parquet ( & arrow_file_path, random_string. clone ( ) ) ;
172
- grouped_arrow_file
173
- . entry ( key)
174
- . or_default ( )
175
- . push ( arrow_file_path) ;
171
+ if arrow_file_path. metadata ( ) . unwrap ( ) . len ( ) == 0 {
172
+ log:: error!(
173
+ "Invalid arrow file detected, removing it: {:?}" ,
174
+ arrow_file_path
175
+ ) ;
176
+ fs:: remove_file ( & arrow_file_path) . unwrap ( ) ;
177
+ } else {
178
+ let key = Self :: arrow_path_to_parquet ( & arrow_file_path, random_string. clone ( ) ) ;
179
+ grouped_arrow_file
180
+ . entry ( key)
181
+ . or_default ( )
182
+ . push ( arrow_file_path) ;
183
+ }
176
184
}
177
185
grouped_arrow_file
178
186
}
You can’t perform that action at this time.
0 commit comments