Repository navigation
refactor(vector): move Unicode text validation out of Vector - #33115
Merged
fengttt merged 19 commits intoNov 24, 2026
Merged
Conversation
Vector validated native Unicode (utf8mb4/utf8mb3 unicode_ci) text on every append and copy, and disabled several copy fast paths for Unicode columns to keep that check. Copies re-validated values their source vector had already admitted. Remove the check from AppendBytesWithWriter, BuildVarlenaFromByteSlice and BuildVarlenaFromVarlena, and re-enable the inline/empty-area union paths, TryUnionFlatFixedRows and raw-byte list pregrow for Unicode columns. Validate where text values are produced instead: - FunctionResult byte writers (AppendBytes, AppendMultiBytes, AppendMustBytesValue, AppendBytesWithWriter): every function and cast result, including non-assignment casts. - LOAD DATA / external text fields (appendFieldText). - Parquet strings (appendParquetVarlenValue), now also enforcing the utf8mb3 repertoire and covering TEXT. Tests: delete vector's collation_metadata_test.go and collation_value_test.go. The wire-format metadata round trip moves to vector_test.go; the rejection rules become TestValidateCollationValue in types; new TestFunctionResultValidatesUnicodeText and TestFileInputValidatesUnicodeText cover the new boundaries. The function test framework's rollback subtest now fails construction with a capped pool. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Code must behave the same with and without -race; a real race is a bug to
fix, not something to switch on.
Remove race-only switches:
- vector: compile_config_race.go, compile_config_no_race.go,
compile_config_no_race_typecheck.go and their two debug checks
(typed-slice type check, sorted Shrink selection), plus
typed_read_typecheck_test.go.
- readutil: compile_config_{race,no_race}.go and the sorted-rowid assert.
- common/util: build_type_{debug,release}.go (Debug, RaceDetectorEnabled).
- group: sanityCheck, which only ran when util.Debug (race builds) was set.
Drop every !race build tag and race skip from tests. -race reports no data
race in the affected packages. Tests whose counts the race runtime perturbs
(it drops some sync.Pool puts on purpose) now assert what holds in both
modes:
- fulltext2: count wand buffers taken vs. returned through
getWandBuf/putWandBuf instead of inferring release from pool reuse.
- catalog: subtract objectListSeekKeyPool refills from allocation counts.
- aggexec matmul length test: allow a small pool-refill tolerance.
vector_matmul: the parse bound missed sonic's pooled optdec parser (~2.1 MB),
which the first vecblock-JSON decode after a GC allocates. A cold one-query
parse allocated 2,104,984 bytes against a 30,900-byte bound. Add
vectorMatmulJSONDecoderScratch for JSON-format queries, and rewrite
TestVectorMatmulParseBoundCoversParse to check what production relies on:
bound >= committed config + score scratch + one decoder parser, and a truly
cold parse (second GC empties the pool's victim cache) within the bound,
including a one-query shape.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
It pinned that the checked fixed-column accessor keeps a backed empty slice for a zero-row vector, a behavior added for the dictionary vectors of matrixorigin#32394. That code is gone from vector, and no caller depends on the empty view's capacity or nil-ness; ordinary accessor use is covered elsewhere. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Class 2 was DIST, declared in matrixorigin#8367 but never assigned to a vector, then DICTIONARY (matrixorigin#32394 to matrixorigin#33027), which PrepareMarshalBinary refused to serialize. No encoder ever wrote class byte 2, so the decode-time remap of "legacy row-buffer class 2" to FLAT defended against data that never existed. Remove LegacyRowBufferClass, decodedPhysicalClass and the SetClass panic; UnmarshalBinaryV1 and objectio's legacy column reader now reject any class above CONSTANT, and validateVectorBinary rejects class 2 like any unknown class. Every class actually written decodes as before. legacy_class_test.go is deleted. Its decoder round trip (fixed, varlen, JSON, const, const NULL through UnmarshalBinary, Trusted, WithCopy, V1 and WithReader), unknown-class rejection and the input-bytes-untouched check move to vector_test.go as TestVectorDecodersRoundTrip. The objectio window test drops the legacy case and is renamed TestReadOneBlockAllColumnsWindowClass. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Combine lowprec_const_test.go and lowprec_float_test.go. The tests cover vector code specific to bf16/float16/float8/float4: const-set and union (sharing uint8/uint16 storage widths), GetLowPrecisionFloatAt (used by CDC, ISCP, export and data branch), the decoder type allowlist, and the RowToString helper used by TestRowToString. The marshal round trip now frees its decoded vectors and checks the pool is empty; a comment no longer refers to the removed typecheck build. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Move the galloping prefix-IN tests (CollectOffsetsByPrefixInFactory against the linear and merge references) and their helpers into search_test.go, next to the other search.go tests. search.go stays in vector; its functions back the primary-key block filter in readutil and objectio's cached-vector search. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…odec The selected-rows codec only backs query-scoped spill (group and aggregate state, materialized sources): the same process writes and reads each record, so data from an older writer cannot exist. Remove the decoder's handling of the retired kind, binary-string and string-source metadata fields, the legacy ROLLUP grouping bit and their trailers. NULL is now the only defined bit; any other header or row-flag bit is rejected. Remove MarshalSelectedFlagsTo, which had no production caller, and the tests that covered only it or older-writer data. The remaining tests check that every undefined header and row-flag bit is rejected. Benchmarks (median of 6-10 runs, arm64): fixed-width encode/decode and sparse encode unchanged; varlena decode unchanged to 12% faster (nullable strings); group spill writer unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merge small test files into the file for the code they test: - union_test.go: union_fixed, union_fixed_rows, unionbatch_fastpath and union_fixed_bench tests. - append_test.go: append_bench_test.go. - marshal_test.go: unmarshal_bench_test.go. - search_test.go: the CollectOffsetsBy* tests from utils_test.go. - functionTools_test.go (renamed to match functionTools.go): function_parameter_conversion_test.go. - vector_test.go: shrink_negate_boundary, area_disjoint, typed_read and vector_narrow tests. Delete BenchmarkUnmarshal and the one-row accessor benchmarks (BenchmarkToTypedSlice, BenchmarkToFixedCol, BenchmarkMustFixedCol); BenchmarkVectorUnmarshalBinary and BenchmarkVectorTypedRead cover them at scale. Every other test and benchmark is kept. Fix stale wording: the union test's "lease" backing is "external", and "borrowed"/"lender"/"proof" comments and labels describe the read-only vectors and computed disjointness they refer to now. TestVarlenaAreaIsDisjointIsComputedFromDescriptors is renamed TestVarlenaAreaIsDisjointEdgeCases. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Contributor
|
This pull request is merged. |
…topic Remove tests from vector_test.go that cover nothing another test does not and assert little beyond "no error": TestLength (asserted a field it had just set), TestConst, TestDup, TestAppend, TestAppendBytes, TestAppendArray, TestUnionOne, TestStrMarshalAndUnMarshal, TestArrayMarshalAndUnMarshal and TestProtoVector. Their paths are value- checked by union_test.go, marshal_test.go, mpool_test.go and TestVectorDecodersRoundTrip. TestSize and TestCapacityForUntypedNull become TestSizeAndCapacity, which checks real fixed and varlena sizes. Move topic tests out of vector_test.go: - union tests and benchmarks -> union_test.go (TestMisc renamed to TestUnionAllFixedSizeTypes) - low-precision float tests -> lowprec_test.go - GetMinMaxValue tests and benchmarks -> new minmax_test.go Package coverage is unchanged apart from blocks reached only by the randomized TestUnion2VectorVarlen. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Delete union tests that cover nothing another test does not: - TestUnionBatchVarlenFastPath: the no-null twin of TestUnionBatchNullFastPath, which checks the same seeded target against the same per-row UnionOne oracle plus nulls. - TestUnionOneEmptyMarkerSets: fixed-width UnionOne copies, checked more thoroughly by TestFixedSourceRowsMatchUnionOne and TestUnionFixedSelection. - TestUnionOneNullDoesNotClearWindowOwnerDescriptor: windows are read-only, so it only checked that appending to one fails, which mpool_test.go already covers. TestUnionBroadcastAndPregrow becomes TestUnionVarlenGatherAndBroadcast: its full-range UnionBatch case duplicated TestUnionBatchNullFastPath and is removed, and its AppendMultiFixed case moves to append_test.go as TestAppendMultiFixedBroadcast. Rename tests and benchmarks named after removed marker sets and metadata: TestUnionOneSourceShapes, TestUnionOneAndMultiMixedSources (dropping a loop over the single value "ordinary"), BenchmarkUnionOne, BenchmarkUnionMulti and BenchmarkUnionBatchVarlenInline. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… marshal_test.go TestUnionSelectionKeepsConstVarlenaAliased repeated the second half of TestUnionOneConstVarlenaCopiesIndependentPayloads (a const selected twice through UnionInt32 shares its payload and marshals canonically), so it is deleted. The marshal, unmarshal and wire-format tests move from vector_test.go to marshal_test.go: TestOwnedVarlenaMarshalKeepsBulkLayout, TestNullableFixedWidthMarshalDoesNotCastAsVarlena, TestMarshalAndUnMarshal, TestMarshalBinarySizeRejectsInvalidVector, the TestUnmarshalBinary* tests, TestVectorWireFormatsKeepCollationMetadata and TestVectorDecodersRoundTrip. Stale comments are fixed: the owned-varlena marshal benchmark no longer calls itself the "non-Arrow control", and a window is described as a read-only reference that marshals only its rows, not an owned copy. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The SCA checkunsafe analyzer allows the unsafe import only in listed files. The reorganization renamed functionTool_test.go (listed) to functionTools_test.go and moved a min/max helper that used unsafe.Sizeof into minmax_test.go (not listed), failing static analysis. Restore the functionTool_test.go name, and drop the unsafe uses: the area-backing check compares &area[0] with require.Same, and the signed minimum is found by shifting 1 up to the sign bit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 task done
1 task done
This branch was successfully 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.
What type of PR is this?
Which issue(s) this PR fixes:
issue #33086
What this PR does / why we need it
Vector validated native Unicode (
utf8mb4_unicode_ci/utf8_unicode_ci) text itself, on every append and every copy, and turned off several copy fast paths for Unicode columns just to keep that check. Copies re-validated values their source vector had already admitted. This PR moves the check to where text values are produced, like the JSON validation removed in #33023.Removed from vector (
vector.go)AppendBytesWithWriter,BuildVarlenaFromByteSlice(used byAppendBytes/AppendStringList) andBuildVarlenaFromVarlena.TryUnionFlatFixedRows, the empty-area/inline branches of union, andcanPregrowRawByteList.Added at the boundaries (an audit showed
AppendByteswas the only guard for these inputs)FunctionResultbyte writers (AppendBytes,AppendMultiBytes,AppendMustBytesValue,AppendBytesWithWriter). All function and cast results go through these, including non-assignment casts (func_castonly validates in assignment mode). No function writes result bytes through vector directly.appendFieldTextinexternal.go.appendParquetVarlenValuealready checked UTF-8 for CHAR/VARCHAR; it now also enforces the utf8mb3 repertoire and covers TEXT.Values read from storage were validated when written, and key encoding (
serial,index_util) validates on its own.Tests
vector/collation_metadata_test.goandvector/collation_value_test.go.vector_test.goasTestVectorWireFormatsKeepCollationMetadata.TestValidateCollationValueinpkg/container/types.TestFunctionResultValidatesUnicodeTextandTestFileInputValidatesUnicodeText. Removing each new check fails every bad case (12 and 6 subtests).Open question for reviewers
Copies now rely on the source vector already having the destination's exact type. A path that unions a legacy-charset vector into a Unicode vector without a cast would no longer be caught. The audit found no such path, and
BuildVarlenaFromVarlenaalready documented the same-type requirement, but this is the main residual risk.FunctionResultstill lives inpkg/container/vector/functionTools.go, so the function-result check is physically in the vector package, though it belongs to the function framework.Validation
mo-cgo-test ./pkg/container/... ./pkg/sql/plan/function/... ./pkg/sql/colexec/... ./pkg/sql/util/... ./pkg/common/collation/...: passmo-cgo-test -run '^TestUnicodeCollation' ./pkg/tests/sqlintegration/(TestUnicodeCollationConsumerContract): passgo build ./pkg/...,go vet,golangci-linton vector, types, external, function: cleanSecond commit: remove race-detector-only code (7bafa42)
Code must behave the same with and without
-race; a real race is a bug to fix.compile_config_*.go(+ its two debug checks andtyped_read_typecheck_test.go), readutilcompile_config_{race,no_race}.go(sorted-rowid assert),common/utilbuild_type_{debug,release}.go(Debug,RaceDetectorEnabled), and groupsanityCheck(only ran underutil.Debug).!racebuild tag and race skip from tests.-racereports no data race in the affected packages. Tests the race runtime perturbs (it drops somesync.Poolputs on purpose) now assert what holds in both modes: fulltext2 counts buffers taken vs. returned; catalog subtracts seek-key pool refills; the matmul length test allows a small pool-refill tolerance.vectorMatmulParseBoundmissed sonic's pooled optdec parser (~2.1 MB) that the first vecblock-JSON decode after a GC allocates. A cold one-query parse allocated 2,104,984 bytes against a 30,900-byte bound. AddedvectorMatmulJSONDecoderScratchfor JSON-format queries;TestVectorMatmulParseBoundCoversParsenow checksbound >= committed config + score scratch + one parserand a truly cold parse, including a one-query shape. JSON-query configurations now reserve ~2.1 MB more during the parse; only the retained configuration stays charged.Validation: changed packages pass in normal and
-raceruns; vector_matmul tests in compile, plan, function and sqlintegration pass;golangci-lintclean.Third commit: delete
fixed_col_test.go(35ed100)It pinned that
MustFixedColWithTypeCheckkeeps a backed empty slice for a zero-row vector, a behavior added for the dictionary vectors of #32394. That code is gone from vector; no caller depends on the empty view's capacity or nil-ness, and ordinary accessor use is covered elsewhere.Fourth commit: remove the never-written legacy class 2 (638b177)
Class 2 was
DIST, declared in #8367 but never assigned to a vector, thenDICTIONARY(#32394 to #33027), whichPrepareMarshalBinaryrefused to serialize. No encoder ever wrote class byte 2, so decoding it as FLAT defended against data that never existed.LegacyRowBufferClass,decodedPhysicalClassand theSetClasspanic.UnmarshalBinaryV1and objectio's legacy column reader reject any class aboveCONSTANT;validateVectorBinaryrejects class 2 like any unknown class. Every class actually written decodes as before.legacy_class_test.gois deleted. Its valuable part moved tovector_test.goasTestVectorDecodersRoundTrip: a round trip of fixed, varlen, JSON, const and const-NULL vectors through all five decoders (includingUnmarshalWithReader, tested nowhere else), unknown-class rejection, and a check that decoding never rewrites the caller's input bytes.TestReadOneBlockAllColumnsWindowClass.Validation: vector and objectio packages pass in normal and
-raceruns;golangci-lintclean.Fifth commit: merge low-precision float tests (4db2a0c)
lowprec_const_test.goandlowprec_float_test.goare combined intolowprec_test.go. The tests stay: they cover vector code specific to bf16/float16/float8/float4 (const-set and union,GetLowPrecisionFloatAtused by CDC, ISCP, export and data branch, the decoder type allowlist, and theRowToStringhelper used byTestRowToString). The marshal round trip now frees its decoded vectors and checks the pool is empty.Sixth commit: combine marshal tests (46f01e8)
marshal_selection_test.goandmarshal_bench_test.goare merged intomarshal_test.go: the tests that checkUnionInt32/UnionOneresults take the right marshal path (bulk for disjoint payloads, canonical for shared const payloads) and decode to the selected rows, plus bothMarshalBinarybenchmarks.TestUnionOneConstDestinationDoesNotAcquireDisjointProofis renamedTestUnionOneConstDestinationStaysConst, since the cached disjoint proof it named was removed in #33033. The two tests that do not marshal (UnionOneinto a read-only window, a refusedUnionOneallocation keeping existing rows) move tounionbatch_fastpath_test.gowith the other union tests.Seventh commit: merge mpool tests into
mpool_test.go(4b6a531)mpool_contract_test.go(a vector allocates only from its own pool; nil-pool vectors are read-only; windows share bytes whileCloneWindowand owned decodes copy) and the accounted-view fixtures frommpool_view_fixtures_test.goare combined intompool_test.go. Leftovers from when vectors carried an account are dropped:newAccountedTestVectorwas onlyNewVec, so its seven call sites callNewVecdirectly, and the never-setclassfield oftestVectorAllocationAccountis replaced byAllocationCapacityClassDefault.Eighth commit: move rollback tests into
vector_test.go(e4eb415)rollback_error_test.gois deleted; its two tests move next toTestAppendCheckpointRollback.TestRollbackAppendRejectsBeforeMutationchecks that an invalid append checkpoint is rejected before any mutation, with an invariant error that callers (parquet reader, vector append paths) never classify as a retryable capacity failure.TestAppendAllocatorLimitReturnsErrorAndKeepsPrefixchecks that an allocator-limit failure keeps its sentinel through the rollback and keeps earlier rows. A stale comment inRollbackAppendabout keeping a "proof" fail-closed (the cached disjoint flag removed in #33033) is dropped.Ninth commit: fold
scan_followup_test.gointovector_test.go(ee64e88)The
GetMinMaxValuetests from #30338 move next toTestBoolMinMaxasTestGetMinMaxValueFixed,TestGetMinMaxValueConstandTestGetMinMaxValueInt64Windows. They cover the int64 kernel for flat, null-free columns of 32+ rows (sizes around its threshold, windows at an offset, every value order), the bool early exit, NULL masks, read-only backing, and that the call does not modify the vector. TheGetMinMaxValuebenchmarks stay (BenchmarkGetMinMaxValue,BenchmarkGetMinMaxValueInt64Distributions); the raw-loop controls, the UTF-8 counting cases (they measurelengthutf8, which has its own benchmark), and the read-only and constant variants are dropped.Tenth commit: unrolled min/max for every integer type and float32/float64 (1d9ad0f)
The 4-accumulator
GetMinMaxValuekernel was int64-only. It now covers every integer-backed type (int8-64, uint8-64, bit, date, year, datetime, time, timestamp, enum) throughIntegerGetMinAndMax, and float32/float64 throughfloatMinMaxNoNull, which uses plain comparisons from ±Inf so NaN is skipped exactly as before (an all-NaN column still reports no comparable value; a +0/-0 tie may report either zero). Both apply to flat, null-free columns of at least 32 rows; the kernels move fromscan_minmax.gotominmax.go.Four accumulators measured best among 1, 2, 4 and 8, and the reslicing loop beat an index loop. Speedup of
GetMinMaxValueon arm64, null-free random columns:TestGetMinMaxValueUnrolledKernelschecks all 17 types against a plain loop (960 subtests); breaking the integer tail, the float "found" flag or the float starting values each fails it.BenchmarkGetMinMaxValueByTypecovers each width.Note for a follow-up: scalar Go is at about 0.46 ns per element at every width. A clang
-O3C kernel via cgo measured ~40x (int8), ~10x (int32) and ~2.5x (int64) faster at 65536 rows, but loses below a few hundred rows and for floats, so it would need a row threshold and explicit float handling.Eleventh commit: merge
search_gallop_test.gointosearch_test.go(382b93f)The galloping prefix-IN tests (
CollectOffsetsByPrefixInFactoryagainst the linear and merge references) and their helpers move intosearch_test.gonext to the othersearch.gotests.search.goitself stays in vector: all of its functions are used by the primary-key block filter inreadutil/pk_filter.goand by objectio's cached-vector search.Twelfth commit: drop older-writer handling from the selected-rows codec (4701fbc)
selection_codec.gostays: it lets group/aggregate spill and materialized sources write selected rows without first copying them into a new vector, so spill can proceed when the memory budget is exhausted. But every record is written and read by the same process within one query, so data from an older writer cannot exist. The decoder's handling of the retired kind, binary-string and string-source metadata fields, the legacy ROLLUP grouping bit and their trailers is removed; NULL is now the only defined bit and any other header or row-flag bit is rejected.MarshalSelectedFlagsTo, which had no production caller, is removed with the tests that covered only it or older-writer data.Benchmarks (median of 6-10 runs, arm64): fixed-width encode/decode and sparse encode unchanged; text decode unchanged to 12% faster (nullable strings); group spill writer unchanged.
Thirteenth commit: reorganize vector test files (7dcdae4)
Small test files are merged into the file for the code they test (24 test files become 15):
union_test.go(fromunion_fixed_test.go)union_fixed_rows,unionbatch_fastpath,union_fixed_benchtestsappend_test.goappend_bench_test.gomarshal_test.gounmarshal_bench_test.gosearch_test.goCollectOffsetsBy*tests fromutils_test.gofunctionTool_test.gofunction_parameter_conversion_test.govector_test.goshrink_negate_boundary,area_disjoint,typed_read,vector_narrowtestsBenchmarkUnmarshaland the one-row accessor benchmarks (BenchmarkToTypedSlice,BenchmarkToFixedCol,BenchmarkMustFixedCol) are deleted;BenchmarkVectorUnmarshalBinaryandBenchmarkVectorTypedReadcover them at scale. All other tests and benchmarks are kept (211 functions before, 207 after: the four benchmarks and one rename). Stale wording is fixed: the union test's "lease" backing is now "external", "borrowed"/"lender"/"proof" comments describe read-only vectors and computed disjointness, andTestVarlenaAreaIsDisjointIsComputedFromDescriptorsis renamedTestVarlenaAreaIsDisjointEdgeCases.bulk_copy_test.goandclone_compact_test.goare reworked on a separate branch and left unchanged here.Fourteenth commit: drop redundant
vector_test.gotests and split it by topic (f1cd8ed)Each package test was run alone with coverage. Tests in
vector_test.gothat cover no code another test does not, and assert little beyond "no error", are deleted:TestLength(it asserted a field it had just set),TestConst,TestDup,TestAppend,TestAppendBytes,TestAppendArray,TestUnionOne,TestStrMarshalAndUnMarshal,TestArrayMarshalAndUnMarshalandTestProtoVector. Their paths are value-checked byunion_test.go(which usesUnionOneas its reference),marshal_test.go,mpool_test.goandTestVectorDecodersRoundTrip(which round-trips through proto).TestSizeandTestCapacityForUntypedNullbecomeTestSizeAndCapacity, which checks real fixed and varlena sizes. Regression tests with no unique coverage but a specific assertion are kept.Topic tests move out of
vector_test.go(5703 lines to 4025):union_test.goTestMiscrenamedTestUnionAllFixedSizeTypeslowprec_test.gominmax_test.go(new)GetMinMaxValuetests, fixtures and benchmarksPackage coverage is unchanged apart from blocks reached only by the randomized
TestUnion2VectorVarlen.Fifteenth commit: drop redundant union tests (a402266)
Same per-test coverage method as the previous commit, applied to
union_test.go. Deleted:TestUnionBatchVarlenFastPath(the no-null twin ofTestUnionBatchNullFastPath, which checks the same seeded target against the same per-rowUnionOneoracle plus nulls),TestUnionOneEmptyMarkerSets(fixed-widthUnionOnecopies, checked more thoroughly byTestFixedSourceRowsMatchUnionOneandTestUnionFixedSelection) andTestUnionOneNullDoesNotClearWindowOwnerDescriptor(windows are read-only, so it only checked that appending to one fails, whichmpool_test.gocovers).TestUnionBroadcastAndPregrowbecomesTestUnionVarlenGatherAndBroadcast: its full-rangeUnionBatchcase duplicated the null fast-path test, and itsAppendMultiFixedcase moves toappend_test.goasTestAppendMultiFixedBroadcast.Tests and benchmarks named after the removed marker sets and metadata are renamed:
TestUnionOneSourceShapes,TestUnionOneAndMultiMixedSources,BenchmarkUnionOne,BenchmarkUnionMulti,BenchmarkUnionBatchVarlenInline. Package coverage is unchanged (apart from the randomizedTestUnion2VectorVarlenblocks noted above).Sixteenth commit: drop a duplicate marshal test, move marshal tests (c2e0d70)
TestUnionSelectionKeepsConstVarlenaAliasedrepeated the second half ofTestUnionOneConstVarlenaCopiesIndependentPayloads(a const selected twice throughUnionInt32shares its payload and marshals canonically) and is deleted. The marshal, unmarshal and wire-format tests move fromvector_test.gotomarshal_test.go:TestOwnedVarlenaMarshalKeepsBulkLayout,TestNullableFixedWidthMarshalDoesNotCastAsVarlena,TestMarshalAndUnMarshal,TestMarshalBinarySizeRejectsInvalidVector, theTestUnmarshalBinary*tests,TestVectorWireFormatsKeepCollationMetadataandTestVectorDecodersRoundTrip. Two stale comments are fixed: the owned-varlena marshal benchmark no longer calls itself the "non-Arrow control", and a window is described as a read-only reference that marshals only its rows.Seventeenth commit: keep
unsafeout of reorganized test files (a60c5b5)SCA's
checkunsafeallows theunsafeimport only in listed files. The reorganization had renamedfunctionTool_test.go(listed) and moved a min/max helper usingunsafe.Sizeofintominmax_test.go(not listed). The original file name is restored, the area-backing check compares&area[0]withrequire.Same, and the signed minimum is found by shifting 1 up to the sign bit, so neither file importsunsafe.🤖 Generated with Claude Code