rockwotj commented on code in PR #827:
URL: https://github.com/apache/iceberg-go/pull/827#discussion_r3028252380
##########
table/transaction.go:
##########
@@ -149,6 +149,12 @@ func (t *Transaction) SetProperties(props
iceberg.Properties) error {
return nil
}
+// UpgradeFormatVersion upgrades the table to the given format version.
Downgrading
+// is not allowed. If the table is already at the given version, this is a
no-op.
+func (t *Transaction) UpgradeFormatVersion(version int) error {
+ return t.apply([]Update{NewUpgradeFormatVersionUpdate(version)}, nil)
+}
Review Comment:
This is basically what pyiceberg does (we have similar validation to there
later on)
https://github.com/apache/iceberg-python/blob/1e6b347e005e8f9dd204fbeef5d78f448c9ad706/pyiceberg/table/__init__.py#L287-L305
No my reading of the spec (and it would seem from pyiceberg) is that you
don't have to rewrite all the old manifests, and v1 old manifests can co-exist
and gradually rewritten. However today it seems if iceberg-go writes to a v1
table it will write a v2 manifest while the table stays v1 (which is sort of
broken?). I checked and it doesn't look like any SDK automatically upgrades the
table for you, and you need to use this manual API to upgrade the table.
--
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]