Repository navigation
feat: sign native Iceberg writes with an explicit S3A provider list and translate S3A encryption - #7604
Open
comphead wants to merge 2 commits into
Open
feat: sign native Iceberg writes with an explicit S3A provider list and translate S3A encryption#7604comphead wants to merge 2 commits into
comphead wants to merge 2 commits into
Conversation
…ignores The native Iceberg write gate declined several settings that cannot change what iceberg-java writes, so clusters that set them for every job never got the native writer. - Drop the write.parquet.shred-variants rule. iceberg-java shreds only top-level variant columns, and a variant column at any depth already falls back on its type. - Drop the io-impl table property rule. Iceberg catalogs read io-impl from catalog properties only, and requireRecognizedTableFileIO still checks the FileIO the table uses. - Gate only the parquet.* keys that reach iceberg-java's Parquet bytes (parquet.columnindex.truncate.length and the zstd level and worker count), in table and write properties and in the session and HadoopFileIO Hadoop configurations, and ignore every other parquet.* key. - Ignore S3A connection pool, thread, timeout, retry, buffering, read, listing, delete and committer settings, fs.s3a.impl naming S3AFileSystem and fs.s3a.region, in their global and data-bucket forms. - Ignore S3FileIO multipart, staging, retry, delete batching and preload settings, and s3.delete-enabled=true.
…nd translate S3A encryption For a HadoopFileIO table on S3, iceberg-java's writer signs with exactly the providers fs.s3a.aws.credentials.provider lists, while the native writer used its own credential chain, so the gate declined the key. S3A server-side encryption settings fell back the same way. - When the FileIO's Hadoop configuration names the S3A providers explicitly and the FileIO properties name no Comet credential provider class, the write proto names HadoopS3ACredentialProviderAdapter and forwards the FileIO's explicit fs.s3a.* settings. The adapter runs the same list with S3A's own provider factory on the executor. The gate then admits the provider list and the assumed-role and credential-store settings. Anonymous providers and S3A delegation tokens still fall back. - Translate S3A server-side encryption into iceberg-rust's s3.sse.* settings for SSE-S3, SSE-KMS and SSE-C, with S3A's precedence. DSSE-KMS, client-side encryption, invalid combinations and a configured Hadoop credential store still fall back.
Contributor
Author
|
@snmvaughan cc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Part of #6957: its second part (credentials) and the encryption half of its third part. #6957 stays open for ACLs, storage class, requester pays and DSSE-KMS. The pinned iceberg-rust S3 configuration cannot express those, and its
S3Configis crate-private, so Comet's storage factory cannot set them either.Builds on #7603, which this branch contains. Its first commit is #7603's, so review the second commit here until #7603 merges.
Rationale for this change
For a
HadoopFileIOtable on S3, iceberg-java's writer signs with exactly the providers thatfs.s3a.aws.credentials.providerlists. The native writer uses its own chain instead (Comet's IRSA provider or opendal's default chain), which can resolve a different identity. So the gate declines the key, and every write falls back on clusters that need it, for example IRSA through S3A's web-identity provider, or assumed roles. S3A server-side encryption settings fall back the same way, although iceberg-rust can apply SSE-S3, SSE-KMS and SSE-C.What changes are included in this PR?
usesS3ACredentialAdapterpicks Comet's existingHadoopS3ACredentialProviderAdapterfor the write when two things hold. The FileIO's Hadoop configuration names the providers explicitly (globally, or for the data bucket). The FileIO properties name nos3.comet.credential.provider.classof their own. The write proto then names the adapter ass3.comet.credential.provider.classand forwards the FileIO's explicitfs.s3a.*settings, including cataloghadoop.*overrides.build_s3_accessalready routes a configured provider class through the JVM bridge for writes, and fails the task if the provider cannot initialize. opendal 0.58's custom credential chain replaces static keys and assume-role, so the translateds3.access-key-idcannot override the adapter.s3.rs. Delegating to S3A covers every provider class with S3A's own semantics and leavesiceberg_common.rsalone (feat: ship an S3 credential provider that refreshes Iceberg REST-vended credentials #7363 is reworkingbuild_s3_access). The cost is a JNI call per credential refresh. A provider that reports no expiry is treated as valid for five minutes, and the executor logs a one-time warning. Static-key chains and every provider on the Spark 3.x builds (SDK v1) report no expiry. Such writes also use S3A's web-identity provider rather than Comet's native IRSA provider.hadoopS3EncryptionPropertiestranslates S3A server-side encryption into iceberg-rust'ss3.sse.*:AES256(SSE-S3), SSE-KMS with or without a key, and SSE-C with the key's MD5, which iceberg-rust does not deriveS3AUtils.buildEncryptionSecretsbuildIcebergWriteProtocall the same functions on the same configuration.How are these changes tested?
CometIcebergWriteDetectionSuite:fs.s3a.*settings ands3.sse.*.IcebergReadFromS3Suite(manual MinIO suite): a native write through an explicitSimpleAWSCredentialsProviderlist, set only as a cataloghadoop.*override, is compared with the same rows written by iceberg-java.