smaheshwar-pltr commented on code in PR #19004:
URL: https://github.com/apache/iceberg/pull/19004#discussion_r4644173611


##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveTableOperations.java:
##########
@@ -305,6 +305,12 @@ protected void doCommit(TableMetadata base, TableMetadata 
metadata) {
             !removedProps.contains(TableProperties.ENCRYPTION_TABLE_KEY),
             "Cannot remove key ID from an encrypted table");
 
+        Preconditions.checkArgument(
+            base.properties().containsKey(TableProperties.ENCRYPTION_TABLE_KEY)
+                || 
!metadata.properties().containsKey(TableProperties.ENCRYPTION_TABLE_KEY),
+            "Cannot add key ID to an existing table: set %s when creating the 
table",

Review Comment:
   I persaonally think it does - if you run into this you might have enabled 
encryption later on instead of at creation, so you'll probably then drop and 
recreate the table or create a new one entirely. In both cases, it might be 
useful to get an error message saying "set X when creating".



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