xanderbailey commented on code in PR #3057:
URL: https://github.com/apache/iceberg-rust/pull/3057#discussion_r4518252064
##########
crates/iceberg/src/spec/table_metadata_builder.rs:
##########
@@ -1235,6 +1316,32 @@ impl TableMetadataBuilder {
.collect()
}
+ /// Gives each field of `spec` the highest id an equivalent field has in
the table's specs, or
+ /// the next id above `last_partition_id`.
+ fn reassign_partition_field_ids(&self, spec: PartitionSpec) ->
Result<UnboundPartitionSpec> {
+ let mut field_ids = Self::highest_equivalent_field_ids(
+ self.metadata
+ .partition_specs
+ .values()
+ .flat_map(|spec| spec.fields()),
+ );
+ let mut last_partition_id = self.metadata.last_partition_id;
+
+ let fields = spec.fields().iter().map(|field| {
+ let field_id = *field_ids
+ .entry((vec![field.source_id], field.transform))
+ .or_insert_with(|| {
+ last_partition_id += 1;
Review Comment:
[f3ca60b](https://github.com/apache/iceberg-rust/pull/3057/commits/f3ca60b5412cde1a81380466833c4b8eb2bd395b)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]