File tree Expand file tree Collapse file tree 5 files changed +67
-70
lines changed Expand file tree Collapse file tree 5 files changed +67
-70
lines changed Original file line number Diff line number Diff line change @@ -91,14 +91,18 @@ fn list_log_files(
9191 // NOTE: since engine APIs don't limit listing, we list from start_version and filter
9292 let files = storage
9393 . list_from ( & start_from) ?
94- . map ( |meta| ParsedLogPath :: try_from ( meta?) )
94+ . filter_map ( |meta| match meta {
95+ Ok ( m) => ParsedLogPath :: try_from ( m)
96+ . filter ( |p| p. should_list ( ) )
97+ . map ( Ok ) ,
98+ Err ( e) => Some ( Err ( e) ) ,
99+ } )
95100 // NOTE: this filters out .crc files etc which start with "." - some engines
96101 // produce `.something.parquet.crc` corresponding to `something.parquet`. Kernel
97102 // doesn't care about these files. Critically, note these are _different_ than
98103 // normal `version.crc` files which are listed + captured normally. Additionally
99104 // we likely aren't even 'seeing' these files since lexicographically the string
100105 // "." comes before the string "0".
101- . filter_map_ok ( |path_opt| path_opt. filter ( |p| p. should_list ( ) ) )
102106 . take_while ( move |path_res| match path_res {
103107 // discard any path with too-large version; keep errors
104108 Ok ( path) => path. version <= list_end_version,
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ impl LogPath {
2525 /// valid log path.
2626 pub fn try_new ( file_meta : FileMeta ) -> DeltaResult < Self > {
2727 // TODO: we should avoid the clone
28- let parsed = ParsedLogPath :: try_from ( file_meta. clone ( ) ) ?
28+ let parsed = ParsedLogPath :: try_from ( file_meta. clone ( ) )
2929 . ok_or_else ( || Error :: invalid_log_path ( & file_meta. location ) ) ?;
3030
3131 require ! (
Original file line number Diff line number Diff line change @@ -205,7 +205,6 @@ fn create_log_path(path: &str) -> ParsedLogPath<FileMeta> {
205205 size : 0 ,
206206 } )
207207 . unwrap ( )
208- . unwrap ( )
209208}
210209
211210#[ test]
You can’t perform that action at this time.
0 commit comments