Skip to content

Commit f51159d

Browse files
committed
better naming and add comment
1 parent 1b0f5ee commit f51159d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

crates/iceberg/src/arrow/schema.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,21 +273,21 @@ struct ArrowSchemaConverter {
273273
/// Generates unique placeholder IDs for fields before reassignment.
274274
/// Required because `ReassignFieldIds` builds an old-to-new ID mapping
275275
/// that expects unique input IDs.
276-
temp_field_id_counter: i32,
276+
next_field_id: i32,
277277
}
278278

279279
impl ArrowSchemaConverter {
280280
fn new() -> Self {
281281
Self {
282282
reassign_field_ids_from: None,
283-
temp_field_id_counter: 0,
283+
next_field_id: 0,
284284
}
285285
}
286286

287287
fn new_with_field_ids_from(start_from: i32) -> Self {
288288
Self {
289289
reassign_field_ids_from: Some(start_from),
290-
temp_field_id_counter: 0,
290+
next_field_id: 0,
291291
}
292292
}
293293

@@ -296,10 +296,11 @@ impl ArrowSchemaConverter {
296296
// Field IDs will be reassigned by the schema builder.
297297
// We need unique temporary IDs because ReassignFieldIds builds an
298298
// old->new ID mapping that requires unique input IDs.
299-
let temp_id = self.temp_field_id_counter;
300-
self.temp_field_id_counter += 1;
299+
let temp_id = self.next_field_id;
300+
self.next_field_id += 1;
301301
Ok(temp_id)
302302
} else {
303+
// Get field ID from arrow field metadata
303304
get_field_id_from_metadata(field)
304305
}
305306
}

0 commit comments

Comments
 (0)