Skip to content

Core: Add missing encryption keys when commiting snapshot#16525

Open
ebyhr wants to merge 1 commit into
apache:mainfrom
ebyhr:ebi/encryption-test
Open

Core: Add missing encryption keys when commiting snapshot#16525
ebyhr wants to merge 1 commit into
apache:mainfrom
ebyhr:ebi/encryption-test

Conversation

@ebyhr
Copy link
Copy Markdown
Member

@ebyhr ebyhr commented May 22, 2026

The added test fails if we revert the change to SnapshotProducer:

Expecting ArrayList:
  []
to contain:
  ["7Y+WYJxU4ff2Tq1U3mrLBg=="]
but could not find the following element(s):
  ["7Y+WYJxU4ff2Tq1U3mrLBg=="]

	at org.apache.iceberg.TestSnapshotProducerWithEncryption.propagateEncryptionKeysToMetadata(TestSnapshotProducerWithEncryption.java:66)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)

EncryptionUtil.decryptManifestListKeyMetadata throws NPE if we remove the assertion at L66:

  "java.lang.NullPointerException: Cannot invoke "org.apache.iceberg.encryption.EncryptedKey.encryptedKeyMetadata()" because "manifestListKey" is null
	at org.apache.iceberg.encryption.EncryptionUtil.decryptManifestListKeyMetadata(EncryptionUtil.java:153)
	at org.apache.iceberg.BaseManifestListFile.decryptKeyMetadata(BaseManifestListFile.java:47)
	at org.apache.iceberg.encryption.EncryptingFileIO.newInputFile(EncryptingFileIO.java:125)
	at org.apache.iceberg.BaseSnapshot.cacheManifests(BaseSnapshot.java:187)
	at org.apache.iceberg.BaseSnapshot.dataManifests(BaseSnapshot.java:213)
	at org.apache.iceberg.DataTableScan.doPlanFiles(DataTableScan.java:68)
	at org.apache.iceberg.SnapshotScan.planFiles(SnapshotScan.java:162)
	at org.apache.iceberg.TestSnapshotProducerWithEncryption.lambda$propagateEncryptionKeysToMetadata$0(TestSnapshotProducerWithEncryption.java:65)

@github-actions github-actions Bot added the core label May 22, 2026
@ebyhr ebyhr force-pushed the ebi/encryption-test branch from 7e5f11b to 27f7aea Compare May 22, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant