Repository navigation
Add finish-time metadata and schema-less batches to the JNI writer - #11455
Open
robert3005 wants to merge 2 commits into
Open
robert3005 wants to merge 2 commits into
robert3005 wants to merge 2 commits into
Conversation
Java writers can now add file metadata segments when they finish the file. A caller can then write values that it knows only after the last batch, for example a bloom filter of the written keys. The writer reads these segments after the input ends and merges them with the create-time segments. A late key replaces the create-time key. The metadata limits apply to the merged set, and a violation is an error from finish. VortexWriter#writeBatch(long) writes a batch with no schema argument. Native code imports the array with the schema of the writer, so a caller does not export and release a schema for each batch. Native code checks the buffer and child counts of the array before the import. BREAKING: NativeWriter.finish(long) is now finish(long, Map). Signed-off-by: Robert Kruszewski <github@robertk.io>
…ch APIs Signed-off-by: Robert Kruszewski <github@robertk.io>
This branch has not been deployed
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.
Summary
Apache Hudi knows its footer values (bloom filter, min and max keys) only after the last row, but vortex-jni accepts metadata segments only at create time. The Rust writer serializes these segments only with the footer, so this PR lets a caller add them at finish.
It also adds a batch write with no schema argument.
writeBatch(long, long)releases the schema on each call, so a caller that reuses one exported schema crashes on the second batch.Changes
VortexWriteOptions::deferred_metadata()returns aDeferredMetadatahandle. The write reads it after the input ends and merges it with the create-time segments. A late key replaces the earlier key, and the limits apply to the merged set.Writer::finish_with_metadataandBlockingWriter::finish_with_metadatause it.NativeWriter.finishtakes a nullable metadata map. NewNativeWriter.writeArrayimports the array with the writer's schema and checks buffer, child and dictionary counts first. It cannot find a mismatch in value width.VortexWriter#finish(Map<String, byte[]>)andVortexWriter#writeBatch(long). The existingfinish(),close()andwriteBatch(long, long)do not change.API Changes
Breaking:
dev.vortex.jni.NativeWriter.finish(long)is nowfinish(long, Map<String, byte[]>). Its only caller in the repo isVortexWriter.🤖 Generated with Claude Code