rambleraptor commented on code in PR #85:
URL: 
https://github.com/apache/terraform-provider-iceberg/pull/85#discussion_r3723665408


##########
internal/provider/table_schema.go:
##########
@@ -102,6 +102,194 @@ func (s *icebergTableSchema) FromIceberg(icebergSchema 
*iceberg.Schema) error {
        return json.Unmarshal(b, s)
 }
 
+// fieldIDUnset reports an unspecified field ID: null, unknown, or 0 (Iceberg
+// reserves 0 for the table root).
+func fieldIDUnset(id types.Int64) bool {
+       return id.IsNull() || id.IsUnknown() || id.ValueInt64() == 0
+}
+
+// assignFieldIDs fills unset IDs (nested struct/list/map included) with fresh
+// values above startAfter and every existing ID, preserving user-set ones. 
Pass
+// the table's last-column-id on update.

Review Comment:
   The comment is misleading (changed to make that clearer), but that's what we 
already do. I made a comment on the PR to point out where.
   
   Updating `last-column-id` is already done by iceberg-go automatically, so 
that's a really nice bonus.



-- 
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]

Reply via email to