@@ -154,6 +154,7 @@ impl StorageDir {
154
154
pub fn arrow_files_grouped_exclude_time (
155
155
& self ,
156
156
exclude : NaiveDateTime ,
157
+ stream : & str ,
157
158
) -> HashMap < PathBuf , Vec < PathBuf > > {
158
159
let mut grouped_arrow_file: HashMap < PathBuf , Vec < PathBuf > > = HashMap :: new ( ) ;
159
160
let mut arrow_files = self . arrow_files ( ) ;
@@ -170,8 +171,9 @@ impl StorageDir {
170
171
for arrow_file_path in arrow_files {
171
172
if arrow_file_path. metadata ( ) . unwrap ( ) . len ( ) == 0 {
172
173
log:: error!(
173
- "Invalid arrow file detected, removing it: {:?}" ,
174
- arrow_file_path
174
+ "Invalid arrow file {:?} detected for stream {}, removing it" ,
175
+ & arrow_file_path,
176
+ stream
175
177
) ;
176
178
fs:: remove_file ( & arrow_file_path) . unwrap ( ) ;
177
179
} else {
@@ -225,7 +227,7 @@ pub fn convert_disk_files_to_parquet(
225
227
let mut schemas = Vec :: new ( ) ;
226
228
227
229
let time = chrono:: Utc :: now ( ) . naive_utc ( ) ;
228
- let staging_files = dir. arrow_files_grouped_exclude_time ( time) ;
230
+ let staging_files = dir. arrow_files_grouped_exclude_time ( time, stream ) ;
229
231
if staging_files. is_empty ( ) {
230
232
metrics:: STAGING_FILES . with_label_values ( & [ stream] ) . set ( 0 ) ;
231
233
metrics:: STORAGE_SIZE
@@ -279,7 +281,11 @@ pub fn convert_disk_files_to_parquet(
279
281
280
282
writer. close ( ) ?;
281
283
if parquet_file. metadata ( ) . unwrap ( ) . len ( ) == 0 {
282
- log:: error!( "Invalid parquet file detected, removing it" ) ;
284
+ log:: error!(
285
+ "Invalid parquet file {:?} detected for stream {}, removing it" ,
286
+ & parquet_path,
287
+ stream
288
+ ) ;
283
289
fs:: remove_file ( parquet_path) . unwrap ( ) ;
284
290
} else {
285
291
for file in files {
0 commit comments