Interface ArrayExpansionKernel

All Known Implementing Classes:
BooleanArrayExpansionKernel, BoxedBooleanArrayExpansionKernel, ByteArrayExpansionKernel, CharArrayExpansionKernel, DoubleArrayExpansionKernel, FloatArrayExpansionKernel, IntArrayExpansionKernel, LongArrayExpansionKernel, ObjectArrayExpansionKernel, ShortArrayExpansionKernel

public interface ArrayExpansionKernel
  • Method Details

    • makeExpansionKernel

      static ArrayExpansionKernel makeExpansionKernel(ChunkType chunkType, Class<?> componentType)
      Returns:
      a kernel that expands a Chunk<T[]> to pair of LongChunk, Chunk<T>
    • expand

      <T, A extends Any> WritableChunk<A> expand(ObjectChunk<T,A> source, WritableIntChunk<ChunkPositions> perElementLengthDest)
      This expands the source from a T[] per element to a flat T per element. The kernel records the number of consecutive elements that belong to a row in perElementLengthDest. The returned chunk is owned by the caller.
      Parameters:
      source - the source chunk of T[] to expand
      perElementLengthDest - the destination IntChunk for which dest.get(i + 1) - dest.get(i) is equivalent to source.get(i).length
      Returns:
      an unrolled/flattened chunk of T
    • contract

      <T, A extends Any> WritableObjectChunk<T,A> contract(Chunk<A> source, IntChunk<ChunkPositions> perElementLengthDest, WritableChunk<A> outChunk, int outOffset, int totalRows)
      This contracts the source from a pair of LongChunk and Chunk<T> and produces a Chunk<T[]>. The returned chunk is owned by the caller.
      Parameters:
      source - the source chunk of T to contract
      perElementLengthDest - the source IntChunk for which dest.get(i + 1) - dest.get(i) is equivalent to source.get(i).length
      outChunk - the returned chunk from an earlier record batch
      outOffset - the offset to start writing into outChunk
      totalRows - the total known rows for this column; if known (else 0)
      Returns:
      a result chunk of T[]