Skip to content

refactor(reader): make VarBinArray non-sealed, split its modes out - #332

Merged
dfa1 merged 2 commits into
mainfrom
refactor/varbin-array-non-sealed
Aug 6, 2026
Merged

refactor(reader): make VarBinArray non-sealed, split its modes out#332
dfa1 merged 2 commits into
mainfrom
refactor/varbin-array-non-sealed

Conversation

@dfa1

@dfa1 dfa1 commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Follows up on a design question raised while reviewing fix(reader): make constant Utf8/Binary decode lazy #331: VarBinArray was the one Array sub-hierarchy still declared sealed with an explicit permits list, unlike its siblings (ByteArray, LongArray, DecimalArray, ...) which are non-sealed and let each representation live as an ordinary top-level class.
  • Grepped the codebase for exhaustive switch/pattern-matching over VarBinArray's specific modes — zero matches (only one instanceof VarBinArray.OffsetMode check). 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 inside VarBinArray.java and added to its permits clause (as ConstantMode was in fix(reader): make constant Utf8/Binary decode lazy #331).
  • VarBinArray is now non-sealed. Each former nested record is promoted to a top-level class in reader.array, renamed to match the sibling families' self-describing naming:
    • OffsetModeVarBinOffsetArray
    • DictModeVarBinDictArray
    • ChunkedModeVarBinChunkedArray
    • ViewModeVarBinViewArray
    • SlicedModeVarBinSlicedArray
    • ConstantModeVarBinConstantArray
  • checkedLength (bounds-check shared by the offset- and dict-backed representations) moved to a new package-private VarBinArrays helper, mirroring the RunEndArrays precedent.
  • Pure rename/move, no behavior change. docs/compatibility.md and CHANGELOG.md updated.

Breaking for any code referencing the old nested type names (VarBinArray.OffsetMode etc.) directly.

Test plan

  • ./mvnw verify -DskipITs (whole repo)
  • ./mvnw -pl integration -am verify -Dit.test=DocsConsistencyTest -Dvortex.it.excludedGroups=

🤖 Generated with Claude Code

dfa1 added 2 commits August 6, 2026 09:21
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.
@dfa1
dfa1 merged commit 431381d into main Aug 6, 2026
6 checks passed
@dfa1
dfa1 deleted the refactor/varbin-array-non-sealed branch August 6, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant