@@ -485,10 +485,10 @@ impl ArrowReader {
485485 // we need to call next() to update the cache with the newly positioned value.
486486 delete_vector_iter. advance_to ( next_row_group_base_idx) ;
487487 // Only update the cache if the cached value is stale (in the skipped range)
488- if let Some ( cached_idx) = next_deleted_row_idx_opt {
489- if cached_idx < next_row_group_base_idx {
490- next_deleted_row_idx_opt = delete_vector_iter . next ( ) ;
491- }
488+ if let Some ( cached_idx) = next_deleted_row_idx_opt
489+ && cached_idx < next_row_group_base_idx
490+ {
491+ next_deleted_row_idx_opt = delete_vector_iter . next ( ) ;
492492 }
493493
494494 // still increment the current page base index but then skip to the next row group
@@ -842,10 +842,10 @@ impl ArrowReader {
842842 } ;
843843
844844 // If all row groups were filtered out, return an empty RowSelection (select no rows)
845- if let Some ( selected_row_groups) = selected_row_groups {
846- if selected_row_groups. is_empty ( ) {
847- return Ok ( RowSelection :: from ( Vec :: new ( ) ) ) ;
848- }
845+ if let Some ( selected_row_groups) = selected_row_groups
846+ && selected_row_groups. is_empty ( )
847+ {
848+ return Ok ( RowSelection :: from ( Vec :: new ( ) ) ) ;
849849 }
850850
851851 let mut selected_row_groups_idx = 0 ;
@@ -878,10 +878,10 @@ impl ArrowReader {
878878
879879 results. push ( selections_for_page) ;
880880
881- if let Some ( selected_row_groups) = selected_row_groups {
882- if selected_row_groups_idx == selected_row_groups. len ( ) {
883- break ;
884- }
881+ if let Some ( selected_row_groups) = selected_row_groups
882+ && selected_row_groups_idx == selected_row_groups. len ( )
883+ {
884+ break ;
885885 }
886886 }
887887
@@ -1012,13 +1012,13 @@ fn apply_name_mapping_to_arrow_schema(
10121012
10131013 let mut metadata = field. metadata ( ) . clone ( ) ;
10141014
1015- if let Some ( mapped_field) = mapped_field_opt {
1016- if let Some ( field_id) = mapped_field. field_id ( ) {
1017- // Field found in mapping with a field_id → assign it
1018- metadata. insert ( PARQUET_FIELD_ID_META_KEY . to_string ( ) , field_id. to_string ( ) ) ;
1019- }
1020- // If field_id is None, leave the field without an ID (will be filtered by projection)
1015+ if let Some ( mapped_field) = mapped_field_opt
1016+ && let Some ( field_id) = mapped_field. field_id ( )
1017+ {
1018+ // Field found in mapping with a field_id → assign it
1019+ metadata. insert ( PARQUET_FIELD_ID_META_KEY . to_string ( ) , field_id. to_string ( ) ) ;
10211020 }
1021+ // If field_id is None, leave the field without an ID (will be filtered by projection)
10221022 // If field not found in mapping, leave it without an ID (will be filtered by projection)
10231023
10241024 Field :: new ( field. name ( ) , field. data_type ( ) . clone ( ) , field. is_nullable ( ) )
@@ -2712,15 +2712,14 @@ message schema {
27122712 // Step 4: Verify we got 199 rows (not 200)
27132713 let total_rows: usize = result. iter ( ) . map ( |b| b. num_rows ( ) ) . sum ( ) ;
27142714
2715- println ! ( "Total rows read: {}" , total_rows ) ;
2715+ println ! ( "Total rows read: {total_rows}" ) ;
27162716 println ! ( "Expected: 199 rows (deleted row 199 which had id=200)" ) ;
27172717
27182718 // This assertion will FAIL before the fix and PASS after the fix
27192719 assert_eq ! (
27202720 total_rows, 199 ,
2721- "Expected 199 rows after deleting row 199, but got {} rows. \
2722- The bug causes position deletes in later row groups to be ignored.",
2723- total_rows
2721+ "Expected 199 rows after deleting row 199, but got {total_rows} rows. \
2722+ The bug causes position deletes in later row groups to be ignored."
27242723 ) ;
27252724
27262725 // Verify the deleted row (id=200) is not present
@@ -2931,16 +2930,15 @@ message schema {
29312930 // Row group 1 has 100 rows (ids 101-200), minus 1 delete (id=200) = 99 rows
29322931 let total_rows: usize = result. iter ( ) . map ( |b| b. num_rows ( ) ) . sum ( ) ;
29332932
2934- println ! ( "Total rows read from row group 1: {}" , total_rows ) ;
2933+ println ! ( "Total rows read from row group 1: {total_rows}" ) ;
29352934 println ! ( "Expected: 99 rows (row group 1 has 100 rows, 1 delete at position 199)" ) ;
29362935
29372936 // This assertion will FAIL before the fix and PASS after the fix
29382937 assert_eq ! (
29392938 total_rows, 99 ,
2940- "Expected 99 rows from row group 1 after deleting position 199, but got {} rows. \
2939+ "Expected 99 rows from row group 1 after deleting position 199, but got {total_rows } rows. \
29412940 The bug causes position deletes to be lost when advance_to() is followed by next() \
2942- when skipping unselected row groups.",
2943- total_rows
2941+ when skipping unselected row groups."
29442942 ) ;
29452943
29462944 // Verify the deleted row (id=200) is not present
@@ -3222,7 +3220,7 @@ message schema {
32223220 start: 0 ,
32233221 length: 0 ,
32243222 record_count: None ,
3225- data_file_path: format!( "{}/1.parquet" , table_location ) ,
3223+ data_file_path: format!( "{table_location }/1.parquet" ) ,
32263224 data_file_format: DataFileFormat :: Parquet ,
32273225 schema: schema. clone( ) ,
32283226 project_field_ids: vec![ 1 , 2 ] ,
@@ -3319,7 +3317,7 @@ message schema {
33193317 start: 0 ,
33203318 length: 0 ,
33213319 record_count: None ,
3322- data_file_path: format!( "{}/1.parquet" , table_location ) ,
3320+ data_file_path: format!( "{table_location }/1.parquet" ) ,
33233321 data_file_format: DataFileFormat :: Parquet ,
33243322 schema: schema. clone( ) ,
33253323 project_field_ids: vec![ 1 , 3 ] ,
@@ -3405,7 +3403,7 @@ message schema {
34053403 start: 0 ,
34063404 length: 0 ,
34073405 record_count: None ,
3408- data_file_path: format!( "{}/1.parquet" , table_location ) ,
3406+ data_file_path: format!( "{table_location }/1.parquet" ) ,
34093407 data_file_format: DataFileFormat :: Parquet ,
34103408 schema: schema. clone( ) ,
34113409 project_field_ids: vec![ 1 , 2 , 3 ] ,
@@ -3505,7 +3503,7 @@ message schema {
35053503 start: 0 ,
35063504 length: 0 ,
35073505 record_count: None ,
3508- data_file_path: format!( "{}/1.parquet" , table_location ) ,
3506+ data_file_path: format!( "{table_location }/1.parquet" ) ,
35093507 data_file_format: DataFileFormat :: Parquet ,
35103508 schema: schema. clone( ) ,
35113509 project_field_ids: vec![ 1 , 2 ] ,
@@ -3546,7 +3544,7 @@ message schema {
35463544 assert_eq ! ( all_values. len( ) , 6 ) ;
35473545
35483546 for i in 0 ..6 {
3549- assert_eq ! ( all_names[ i] , format!( "name_{}" , i ) ) ;
3547+ assert_eq ! ( all_names[ i] , format!( "name_{i}" ) ) ;
35503548 assert_eq ! ( all_values[ i] , i as i32 ) ;
35513549 }
35523550 }
@@ -3634,7 +3632,7 @@ message schema {
36343632 start: 0 ,
36353633 length: 0 ,
36363634 record_count: None ,
3637- data_file_path: format!( "{}/1.parquet" , table_location ) ,
3635+ data_file_path: format!( "{table_location }/1.parquet" ) ,
36383636 data_file_format: DataFileFormat :: Parquet ,
36393637 schema: schema. clone( ) ,
36403638 project_field_ids: vec![ 1 , 2 ] ,
@@ -3730,7 +3728,7 @@ message schema {
37303728 start: 0 ,
37313729 length: 0 ,
37323730 record_count: None ,
3733- data_file_path: format!( "{}/1.parquet" , table_location ) ,
3731+ data_file_path: format!( "{table_location }/1.parquet" ) ,
37343732 data_file_format: DataFileFormat :: Parquet ,
37353733 schema: schema. clone( ) ,
37363734 project_field_ids: vec![ 1 , 5 , 2 ] ,
@@ -3839,7 +3837,7 @@ message schema {
38393837 start: 0 ,
38403838 length: 0 ,
38413839 record_count: None ,
3842- data_file_path: format!( "{}/1.parquet" , table_location ) ,
3840+ data_file_path: format!( "{table_location }/1.parquet" ) ,
38433841 data_file_format: DataFileFormat :: Parquet ,
38443842 schema: schema. clone( ) ,
38453843 project_field_ids: vec![ 1 , 2 , 3 ] ,
@@ -3978,7 +3976,7 @@ message schema {
39783976 start: 0 ,
39793977 length: 0 ,
39803978 record_count: None ,
3981- data_file_path: format!( "{}/data.parquet" , table_location ) ,
3979+ data_file_path: format!( "{table_location }/data.parquet" ) ,
39823980 data_file_format: DataFileFormat :: Parquet ,
39833981 schema: schema. clone( ) ,
39843982 project_field_ids: vec![ 1 , 2 ] ,
0 commit comments