refactor(reader): make VarBinArray non-sealed, split its modes out - #332
Merged
Conversation
VarBinArray was the one Array sub-hierarchy still declared sealed with an explicit permits list, unlike its siblings (ByteArray, LongArray, DecimalArray, ...), which reopen the hierarchy via non-sealed and let each representation live as an ordinary top-level class. Nothing in the codebase does an exhaustive switch over VarBinArray's specific modes (grepped: zero matches), so the sealing bought no compiler-enforced exhaustiveness — only coupling the interface's declaration to the full list of its implementations, and forcing every new representation (most recently VarBinConstantArray, #331) to be nested inside VarBinArray.java and added to its permits clause. VarBinArray is now `non-sealed`. Each former nested record is a top-level class in reader.array, renamed to match the sibling families' self-describing naming (MaterializedByteArray, LazyConstantLongArray, ...): - OffsetMode -> VarBinOffsetArray - DictMode -> VarBinDictArray - ChunkedMode -> VarBinChunkedArray - ViewMode -> VarBinViewArray - SlicedMode -> VarBinSlicedArray - ConstantMode -> VarBinConstantArray checkedLength (bounds-check shared by the offset- and dict-backed representations) moved to a new package-private VarBinArrays helper, mirroring the RunEndArrays precedent, since it can no longer be a private interface method reachable from sibling top-level classes. Pure rename/move: no behavior change. All call sites across reader/writer/cli updated; docs/compatibility.md's Notes column updated to the new class names.
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
VarBinArraywas the oneArraysub-hierarchy still declaredsealedwith an explicitpermitslist, unlike its siblings (ByteArray,LongArray,DecimalArray, ...) which arenon-sealedand let each representation live as an ordinary top-level class.switch/pattern-matching overVarBinArray's specific modes — zero matches (only oneinstanceof VarBinArray.OffsetModecheck). So the sealing bought no compiler-enforced exhaustiveness, only coupling the interface's declaration to the full list of its implementations, and forcing every new representation to be nested insideVarBinArray.javaand added to itspermitsclause (asConstantModewas in fix(reader): make constant Utf8/Binary decode lazy #331).VarBinArrayis nownon-sealed. Each former nested record is promoted to a top-level class inreader.array, renamed to match the sibling families' self-describing naming:OffsetMode→VarBinOffsetArrayDictMode→VarBinDictArrayChunkedMode→VarBinChunkedArrayViewMode→VarBinViewArraySlicedMode→VarBinSlicedArrayConstantMode→VarBinConstantArraycheckedLength(bounds-check shared by the offset- and dict-backed representations) moved to a new package-privateVarBinArrayshelper, mirroring theRunEndArraysprecedent.docs/compatibility.mdandCHANGELOG.mdupdated.Breaking for any code referencing the old nested type names (
VarBinArray.OffsetModeetc.) directly.Test plan
./mvnw verify -DskipITs(whole repo)./mvnw -pl integration -am verify -Dit.test=DocsConsistencyTest -Dvortex.it.excludedGroups=🤖 Generated with Claude Code