You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "Xuanwo (via GitHub)" <gi...@apache.org> on 2024/09/08 17:07:18 UTC
Re: [PR] feat: Reassign field ids for schema [iceberg-rust]
Xuanwo commented on code in PR #615:
URL: https://github.com/apache/iceberg-rust/pull/615#discussion_r1749297098
##########
crates/iceberg/src/spec/schema.rs:
##########
@@ -86,6 +87,16 @@ impl SchemaBuilder {
self
}
+ /// Reassign all field-ids (nested) on build.
+ /// If `start_from` is provided, it will start reassigning from that id (inclusive).
+ /// If not provided, it will start from 0.
+ ///
+ /// All specified aliases and identifier fields will be updated to the new field-ids.
+ pub fn with_reassigned_field_ids(mut self, start_from: Option<i32>) -> Self {
Review Comment:
Could you please elaborate on the circumstances under which the user wants to set this? I used to think users always need to start with `0`.
##########
crates/iceberg/src/spec/schema.rs:
##########
@@ -86,6 +87,16 @@ impl SchemaBuilder {
self
}
+ /// Reassign all field-ids (nested) on build.
+ /// If `start_from` is provided, it will start reassigning from that id (inclusive).
+ /// If not provided, it will start from 0.
+ ///
+ /// All specified aliases and identifier fields will be updated to the new field-ids.
+ pub fn with_reassigned_field_ids(mut self, start_from: Option<i32>) -> Self {
+ self.reassign_field_ids_from = Some(start_from.unwrap_or(0));
Review Comment:
If we always set `Some(v)` here, how about just using `i32` for `reassign_field_ids_from` with default value `0`?
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org