singhpk234 commented on code in PR #18798:
URL: https://github.com/apache/iceberg/pull/18798#discussion_r4545435260
##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveTableOperations.java:
##########
@@ -542,6 +542,12 @@ private static boolean hiveLockEnabled(TableMetadata
metadata, Configuration con
}
private void encryptionPropsFromMetadata(Map<String, String>
tableProperties) {
+ // Encryption properties of an existing table come from HMS. Uncommitted
metadata only
Review Comment:
why is these props stored in HMS and not in table metadata ?
##########
spark/v4.0/spark/src/test/java/org/apache/iceberg/spark/sql/TestTableEncryption.java:
##########
@@ -305,6 +312,63 @@ public void testKeyAlter() {
.hasMessage("Unsupported table change: Cannot modify key ID of an
encrypted table");
}
+ @TestTemplate
+ public void testRejectedKeyIdOnUnencryptedTable() {
+ String unencryptedTable = tableName(UNENCRYPTED_TABLE);
+ sql(
+ "CREATE TABLE %s (id bigint) USING iceberg TBLPROPERTIES
('format-version'='3')",
+ unencryptedTable);
+
+ assertThatThrownBy(
+ () ->
+ sql(
+ "ALTER TABLE %s SET TBLPROPERTIES
('encryption.key-id'='%s')",
+ unencryptedTable, UnitestKMS.MASTER_KEY_NAME1))
+ .isInstanceOf(SparkException.class)
+ .hasMessage("Unsupported table change: Cannot modify key ID of an
encrypted table");
Review Comment:
why would setting an encryption id on any an un-encrypted table fail with
`Cannot modify key ID of an encrypted 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]