zeroshade commented on code in PR #710:
URL: https://github.com/apache/iceberg-go/pull/710#discussion_r2771295107
##########
table/transaction.go:
##########
@@ -499,6 +518,25 @@ func (t *Transaction) AddFiles(ctx context.Context, files
[]string, snapshotProp
return t.apply(updates, reqs)
}
+// AddDataFiles adds new data files to a new snapshot.
Review Comment:
If we're going to allow this, then there's a couple things we need to do:
1. We need to validate that the DataFiles being added: they need to have
correct Partition spec IDs, valid partition data (if relevant), etc. anything
we can verify without having to actually open and read the file.
2. Add to the docstring so that it is made *crystal clear* that it is the
responsibility of the caller to ensure that the `DataFile` object being added
is valid and that calling this function incorrectly can make the entire
snapshot invalid. If we're going to allow a user to shoot themselves in the
foot, let's at least warn them that it's a possibility.
--
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]