Skip to content

ChunkedLayoutDecoder throws ClassCastException on chunked List-dtype columns #268

Description

@dfa1

Summary

ChunkedLayoutDecoder.decodeChunkedLayout crashes with a raw ClassCastException (not VortexException) when a chunked-layout column with more than one flat child has a DType.List dtype. Violates the security contract in CLAUDE.md: every malformed/unsupported input must throw VortexException, never a raw JDK exception.

Root cause

ChunkedLayoutDecoder.java:129-134 special-cases Bool, Utf8/Binary, then falls through to an unconditional (DType.Primitive) dtype cast for everything else:

} else {
    PType ptype = ((DType.Primitive) dtype).ptype();
    data = switch (ptype) { ... };
}

A List-typed column (or Struct) with >1 flat chunk hits this branch and the cast throws ClassCastException instead of a handled VortexException.

Repro

Discovered via the Raincloud conformance corpus (#205): both squad-v2 (list answers.answer_start) and oasst1 (nested list columns) trigger it.

java.lang.ClassCastException: class io.github.dfa1.vortex.core.model.DType$List cannot be cast to class io.github.dfa1.vortex.core.model.DType$Primitive
	at io.github.dfa1.vortex.reader.layout.ChunkedLayoutDecoder.decodeChunkedLayout(ChunkedLayoutDecoder.java:134)
	at io.github.dfa1.vortex.reader.layout.ChunkedLayoutDecoder.decode(ChunkedLayoutDecoder.java:41)

Expected

Either a genuine chunked-List decode path, or (at minimum) a VortexException with a clear "unsupported dtype for chunked layout" message instead of the raw cast failure.

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