zeroshade commented on code in PR #330:
URL: https://github.com/apache/iceberg-go/pull/330#discussion_r1998959249


##########
table/table.go:
##########
@@ -72,6 +76,64 @@ func (t Table) LocationProvider() (LocationProvider, error) {
        return LoadLocationProvider(t.metadataLocation, t.metadata.Properties())
 }
 
+func (t Table) NewTransaction() *Transaction {
+       meta, _ := MetadataBuilderFromBase(t.metadata)
+
+       return &Transaction{
+               tbl:  &t,
+               meta: meta,
+               reqs: []Requirement{},

Review Comment:
   in this case `meta` is a builder which holds all of the updates that were 
made to the base metadata that it was created using. This avoids GC churn that 
would happen if we constantly re-construct new metadata objects rather than 
just maintaining the current state. 
   
   If the table is refreshed and metadata is updated then we can easily pull 
the slice of updates from the metadata builder to apply them on the new 
metadata. I guess the only scenario I can think of where it might be a problem 
is if an update to the builder was ignored because it didn't actually cause any 
change, then we refresh the metadata and that update might actually be relevant 
now. I think I'll just revisit this when we get to the point of adding in 
retries etc.



-- 
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-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to