Class DictionaryChunkReader

java.lang.Object
io.deephaven.extensions.barrage.chunk.BaseChunkReader<WritableChunk<Values>>
io.deephaven.extensions.barrage.chunk.DictionaryChunkReader
All Implemented Interfaces:
ChunkReader<WritableChunk<Values>>

public class DictionaryChunkReader extends BaseChunkReader<WritableChunk<Values>>
Reads an Arrow Dictionary-Encoded column from the wire into a flat Deephaven chunk.

The RecordBatch column contains an integer-index array (Int16/Int32/Int64) mapping each row to a position in the dictionary. The dictionary values were received in earlier DictionaryBatch messages and are tracked in the DictionaryReaderRegistry.

This reader consumes one ChunkWriter.FieldNodeInfo (the index column's node) and the corresponding buffers (validity + index values), then expands the indices to the logical value type using the registry.

  • Constructor Details

  • Method Details

    • readChunk

      public WritableChunk<Values> 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