File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -168,11 +168,19 @@ impl StorageDir {
168168 let random_string =
169169 rand:: distributions:: Alphanumeric . sample_string ( & mut rand:: thread_rng ( ) , 15 ) ;
170170 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+ }
176184 }
177185 grouped_arrow_file
178186 }
You can’t perform that action at this time.
0 commit comments