Export VarBin to Arrow without canonicalizing the encoding first - #9370
Open
robert3005 wants to merge 1 commit into
Open
Export VarBin to Arrow without canonicalizing the encoding first#9370robert3005 wants to merge 1 commit into
robert3005 wants to merge 1 commit into
Conversation
robert3005
force-pushed
the
rk/arrowvarbinnoexecute
branch
from
August 11, 2026 23:23
875083a to
82f37ac
Compare
Merging this PR will improve performance by 15.45%
Performance Changes
Tip Curious why this is faster? Comment Comparing Footnotes
|
`to_arrow_byte_array` used a private `ArrowByteExportable` matcher listing `VarBin`, `Chunked` and `Constant`. That list is closed, so an encoding such as FSST or Zstd was executed all the way to a canonical `VarBinView` and the builder then had to re-lay out every value the encoding could have written directly. Stop at `dyn VarBinExportable` instead, so operators like Filter and Slice still run and push down while the encoding underneath keeps its specialized `append_to_builder`. Also reinterpret unsigned `VarBin` offsets instead of casting them, checking only the last offset, since offsets are non-decreasing. UTF-8 validation now covers null slots too: Arrow's `value(i)` reinterprets a null slot's bytes just like any other slot's, so bytes spanned by the offsets have to be valid even where the slot is null. Signed-off-by: Robert Kruszewski <github@robertk.io>
robert3005
force-pushed
the
rk/arrowvarbinnoexecute
branch
from
August 11, 2026 23:38
82f37ac to
a39053c
Compare
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.
to_arrow_byte_arrayused a privateArrowByteExportablematcher listingVarBin,ChunkedandConstant. That list is closed, so an encoding such as FSST, OnPair or Zstd was executed all the way to a canonicalVarBinView, and the builder then had to re-lay out every value the encoding could have written directly.It now stops at
dyn VarBinExportable, so operators like Filter and Slice still run (and push down) while the encoding underneath them keeps its specializedappend_to_builder, and out-of-crate encodings participate by claiming the capability.Alongside the dynamic export target we fix the validation of null values (required by arrow) and redundant casting of offsets