Class SingleElementListHeaderReader<READ_CHUNK_TYPE extends WritableChunk<Values>>

java.lang.Object
io.deephaven.extensions.barrage.chunk.BaseChunkReader<READ_CHUNK_TYPE>
io.deephaven.extensions.barrage.chunk.SingleElementListHeaderReader<READ_CHUNK_TYPE>
Type Parameters:
READ_CHUNK_TYPE - The type of chunk being read, extending WritableChunk with Values.
All Implemented Interfaces:
ChunkReader<READ_CHUNK_TYPE>

public class SingleElementListHeaderReader<READ_CHUNK_TYPE extends WritableChunk<Values>> extends BaseChunkReader<READ_CHUNK_TYPE>
The SingleElementListHeaderReader is a specialized BaseChunkReader used to handle singleton list-wrapped columns in Apache Arrow record batches. This implementation ensures compatibility with Apache Arrow's requirement that top-level column vectors must have the same number of rows, even when some columns in a record batch contain varying numbers of modified rows.

This reader works by skipping the validity and offset buffers for the singleton list and delegating the reading of the underlying data to a ChunkReader for the wrapped component type. This approach ensures that Arrow payloads remain compatible with official Arrow implementations while supporting Deephaven's semantics for record batches with varying column modifications.

This is used only when BarrageOptions.columnsAsList() is enabled.

  • Constructor Details

  • Method Details

    • readChunk

      public READ_CHUNK_TYPE readChunk(@NotNull @NotNull Iterator<ChunkWriter.FieldNodeInfo> fieldNodeIter, @NotNull PrimitiveIterator.OfLong bufferInfoIter, @NotNull @NotNull DataInput is, @Nullable @Nullable WritableChunk<Values> outChunk, int outOffset, int totalRows) throws IOException
      Description copied from interface: ChunkReader
      Reads the given DataInput to extract the next Arrow buffer as a Deephaven Chunk.
      Parameters:
      fieldNodeIter - iterator to read fields from the stream
      bufferInfoIter - iterator to read buffers from the stream
      is - input stream containing buffers to be read
      outChunk - chunk to write to
      outOffset - offset within the outChunk to begin writing
      totalRows - total rows to write to the outChunk
      Returns:
      a Chunk containing the data from the stream
      Throws:
      IOException - if an error occurred while reading the stream