feat(table): adopt arrow-go 18.8, fast-path shredded variant extract, restore parquet dict fallback - #2002
Open
nssalian wants to merge 1 commit into
Open
Conversation
Signed-off-by: Neelesh Salian <n_salian@apple.com>
nssalian
marked this pull request as ready for review
September 9, 2026 19:45
nssalian
marked this pull request as draft
September 9, 2026 19:45
nssalian
marked this pull request as ready for review
September 9, 2026 22:37
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.
Rationale for the change
Bumps arrow-go to v18.8, uses its new
compute.VariantGetfor variant extract with a zero-copy fast path for shredded fields, and re-enables the Parquet dictionary cost-fallback that v18.8 disabled for compressed columns.Changes
Arrow-go v18.8
github.com/apache/arrow-go/v18tov18.8.0.arrow.parquet.variantand legacyparquet.variantextension names (arrow_utils.go,internal/parquet_files.go).WithDictionaryCostFallbackForon every leaf so zstd columns drop a dictionary that saves nothing (parquet-mrshouldFallBackparity; v18.8 disabled this for compressed columns) (internal/parquet_files.go).Variant extract
compute.VariantGet(feat(extensions): add VariantGet for path extraction from variant arrays arrow-go#1206), with the per-rowCastVariantLiteralwalk as fallback; addsBoundExtract.VariantPath()(variant_residual.go,variant_extract.go).tryShreddedTypedColumn: when a field is shredded to exactly the target type (no field-level residual), return itstyped_valuecolumn directly - Iceberg's cast is then an identity (mirrors JavaVariantExpressionUtil.castTo). Null rows and absent-object ancestors fold into the validity mask (zero-copy when none, one bitmap-AND per level otherwise); promotions, field-level residual, and unshredded data fall back (variant_residual.go).Performance
BenchmarkVariantExtractmeasures extract-column materialization on a 131,072-row batch (the default read batch size), Apple M4 Max, go1.27. "Production" is the current code (the fast path when the field is shredded to the queried type, otherwise thecompute.VariantGetfallback); "per-row" is the previous walk.$.a.b(fast path)String targets show the same pattern.
typed_valuecolumn directly. This is O(1) in the row count and effectively allocation-free: 47 ns and 1 allocation on a clean batch, versus ~67 ms and 2.36M allocations for the per-row walk. Nullable columns add a single bitmap merge (~5 us); nested paths ~78 ns.compute.VariantGet, ~2x faster than the per-row walk (32.3 ms vs 68.7 ms). Unshredded columns route directly to the per-row walk, matching it (33.6 ms vs 33.5 ms) rather than payingVariantGet.Testing
TestExtractFastPathParity: fast-path output byte-identical to the per-row reference across exact/nested/absent/promotion/residual/null shapes; asserts it is wired in and zero-copy (mutation-checked) under a checked allocator.TestShreddedVariantExtractResidualNoLeak: extract through the real residual filter under a checked allocator (leak check).TestGetWritePropertiesEnablesDictCostFallback: cost fallback enabled per leaf.TestVariantExtractScanEndToEnd/TestVariantExtractResidualAndHeterogeneous: fast path and fallback via the publicScan().WithRowFilter(...).BenchmarkVariantExtract: the numbers above (int64/string x clean/nulls/residual/unshredded/nested).AI Disclosure