Skip to content

VarBinArray.ChunkedMode.of rejects an all-null chunk decoded as NullArray #269

Description

@dfa1

Summary

VarBinArray.ChunkedMode.of throws VortexException: chunk is not a VarBinArray: NullArray when one chunk of a chunked Utf8/Binary column is entirely null and decodes to NullArray rather than a VarBinArray. Same family as the already-fixed #246/#211/#247 (NullArray not recognized as a valid all-null representation across the codebase) but this call site was missed.

Root cause

VarBinArray.java (ChunkedMode.of, ~line 458-466) unwraps MaskedArray before checking the chunk type, but has no NullArray arm:

Array data = c instanceof MaskedArray m ? m.inner() : c;
if (data instanceof ChunkedMode nested) {
    ...
} else if (data instanceof VarBinArray vb) {
    typed.add(vb);
} else {
    throw new VortexException("VarBinArray.ChunkedMode: chunk is not a VarBinArray: "
            + data.getClass().getSimpleName());
}

An all-null chunk (e.g. vortex.constant with a null scalar, or a bare vortex.null encoding) decodes to NullArray, which falls into the else and throws.

Repro

Discovered via the Raincloud conformance corpus (#205): mnist has a chunked Utf8/Binary column with an all-null chunk.

io.github.dfa1.vortex.core.error.VortexException: VarBinArray.ChunkedMode: chunk is not a VarBinArray: NullArray
	at io.github.dfa1.vortex.reader.array.VarBinArray$ChunkedMode.of(VarBinArray.java:466)
	at io.github.dfa1.vortex.reader.layout.ChunkedLayoutDecoder.decodeChunkedLayout(ChunkedLayoutDecoder.java:132)

Expected

ChunkedMode.of should treat a NullArray chunk as an all-null run of the expected row count (same treatment as other NullArray call sites fixed in #246/#211/#247), not throw.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions