zeroshade commented on code in PR #85:
URL:
https://github.com/apache/terraform-provider-iceberg/pull/85#discussion_r3723261361
##########
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:
shouldn't we use `last-column-id` as the starting point? or at least
validate that `startAfter` is >= to it?
We would also need to update the `last-column-id` on the update. If we're
not using the `last-column-id` as the starting point (or validating startAfter)
then we need to validate that we don't duplicate any field IDs
--
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]