Repository navigation
feat(encryption): [14/N] Add EncryptedOutputFile - #4380
Merged
kevinjqliu merged 3 commits intoNov 19, 2026
Merged
Conversation
Writes a file, such as a manifest, as an AGS1 stream and records its key metadata with the written file length.
xanderbailey
marked this pull request as ready for review
November 14, 2026 20:18
Contributor
Author
|
@kevinjqliu this one is ready for a review I think when you have a moment |
Otherwise garbage collection calls close again and retries the write. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kevinjqliu
reviewed
Nov 19, 2026
| """The key metadata to record for the file, including the length of the written file.""" | ||
| if self._file_length is None: | ||
| raise ValueError(f"Cannot get key metadata before the file is written: {self.location}") | ||
| return replace(self._key_metadata, file_length=self._file_length) |
Contributor
There was a problem hiding this comment.
note that we proactively update the _key_metadata's file_length after writing
Comment on lines
+85
to
+88
| return _EncryptingOutputStream(self._output_file.create(overwrite=overwrite), self._key_metadata, self._set_file_length) | ||
|
|
||
| def _set_file_length(self, file_length: int) -> None: | ||
| self._file_length = file_length |
Contributor
There was a problem hiding this comment.
_file_length is a callback, passed to _EncryptingOutputStream
kevinjqliu
approved these changes
Nov 19, 2026
kevinjqliu
enabled auto-merge
November 19, 2026 18:25
Contributor
|
thanks @xanderbailey |
Contributor
Author
|
Awesome stuff, that means I think #3624 is the only blocker now! |
github-merge-queue
Bot
removed this pull request from the merge queue due to Branch Protection failures
Nov 19, 2026
You're not authorized to push to this branch. Visit "About protected branches" for more information.
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 19, 2026
Contributor
|
merge queue is failing because the |
Contributor
|
@xanderbailey i added #4431 to test E2E spark writing encrypted table and pyiceberg reading. Could you take a look when you get a chance? |
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.
Working towards #3222
Rationale for this change
Adds
EncryptedOutputFile, the write-side counterpart ofEncryptedInputFile. It writes a file as an AGS1 stream and exposes its key metadata, including the written file length.Manifests and manifest lists will be written through it once v3 manifest writing (#3624) lands.
Are these changes tested?
Yes, a file written this way reads back through
EncryptedInputFile.Are there any user-facing changes?
No.