singhpk234 commented on code in PR #18647:
URL: https://github.com/apache/iceberg/pull/18647#discussion_r4374295048


##########
core/src/main/java/org/apache/iceberg/TableMetadata.java:
##########
@@ -60,6 +60,7 @@ public class TableMetadata implements Serializable {
   static final int MIN_FORMAT_VERSION_PARQUET_MANIFESTS = 4;
   static final int MIN_FORMAT_VERSION_OPTIONAL_LOCATION = 4;
   static final int MIN_FORMAT_VERSION_MONOTONIC_TIMESTAMPS = 4;
+  static final int MIN_FORMAT_VERSION_ENCRYPTION_KEYS = 3;

Review Comment:
   can we move this next to `MIN_FORMAT_VERSION_ROW_LINEAGE` ?



##########
core/src/main/java/org/apache/iceberg/TableMetadata.java:
##########
@@ -1509,6 +1510,13 @@ public Builder setLocation(String newLocation) {
     }
 
     public Builder addEncryptionKey(EncryptedKey key) {
+      Preconditions.checkArgument(
+          formatVersion >= MIN_FORMAT_VERSION_ENCRYPTION_KEYS,
+          "Cannot add encryption key %s to v%s table: encryption keys are not 
supported until v%s",

Review Comment:
   ```suggestion
             "Cannot add encryption key %s to v%s table: encryption is 
supported for v%s and above",
   ```



##########
core/src/main/java/org/apache/iceberg/TableMetadata.java:
##########


Review Comment:
   should we add here the assertion too just for sanity otherwise its just a 
no-op as keyById would just be empty



-- 
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]

Reply via email to