zeroshade commented on code in PR #401:
URL: https://github.com/apache/iceberg-go/pull/401#discussion_r2096028620
##########
table/metadata.go:
##########
@@ -187,14 +187,14 @@ func MetadataBuilderFromBase(metadata Metadata)
(*MetadataBuilder, error) {
b.loc = metadata.Location()
b.lastUpdatedMS = metadata.LastUpdatedMillis()
b.lastColumnId = metadata.LastColumnID()
- b.schemaList = metadata.Schemas()
+ b.schemaList = slices.Clone(metadata.Schemas())
b.currentSchemaID = metadata.CurrentSchema().ID
- b.specs = metadata.PartitionSpecs()
+ b.specs = slices.Clone(metadata.PartitionSpecs())
b.defaultSpecID = metadata.DefaultPartitionSpec()
b.lastPartitionID = metadata.LastPartitionSpecID()
- b.props = metadata.Properties()
- b.snapshotList = metadata.Snapshots()
- b.sortOrderList = metadata.SortOrders()
+ b.props = maps.Clone(metadata.Properties())
+ b.snapshotList = slices.Clone(metadata.Snapshots())
+ b.sortOrderList = slices.Clone(metadata.SortOrders())
Review Comment:
I wonder if there's a way we could lazily do this cloning? Avoid performing
the copies until we actually need to?
--
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]