Interface ArrayExpansionKernel
- All Known Implementing Classes:
BooleanArrayExpansionKernel
,BoxedBooleanArrayExpansionKernel
,ByteArrayExpansionKernel
,CharArrayExpansionKernel
,DoubleArrayExpansionKernel
,FloatArrayExpansionKernel
,IntArrayExpansionKernel
,LongArrayExpansionKernel
,ObjectArrayExpansionKernel
,ShortArrayExpansionKernel
public interface ArrayExpansionKernel
-
Method Summary
Modifier and TypeMethodDescription<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 ofLongChunk
andChunk<T>
and produces aChunk<T[]>
.<T,
A extends Any>
WritableChunk<A>expand
(ObjectChunk<T, A> source, WritableIntChunk<ChunkPositions> perElementLengthDest) This expands the source from aT[]
per element to a flatT
per element.static ArrayExpansionKernel
makeExpansionKernel
(ChunkType chunkType, Class<?> componentType)
-
Method Details
-
makeExpansionKernel
- Returns:
- a kernel that expands a
Chunk<T[]>
to pair ofLongChunk, Chunk<T>
-
expand
<T,A extends Any> WritableChunk<A> expand(ObjectChunk<T, A> source, WritableIntChunk<ChunkPositions> perElementLengthDest) This expands the source from aT[]
per element to a flatT
per element. The kernel records the number of consecutive elements that belong to a row inperElementLengthDest
. The returned chunk is owned by the caller.- Parameters:
source
- the source chunk of T[] to expandperElementLengthDest
- the destination IntChunk for whichdest.get(i + 1) - dest.get(i)
is equivalent tosource.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 ofLongChunk
andChunk<T>
and produces aChunk<T[]>
. The returned chunk is owned by the caller.- Parameters:
source
- the source chunk of T to contractperElementLengthDest
- the source IntChunk for whichdest.get(i + 1) - dest.get(i)
is equivalent tosource.get(i).length
outChunk
- the returned chunk from an earlier record batchoutOffset
- the offset to start writing intooutChunk
totalRows
- the total known rows for this column; if known (else 0)- Returns:
- a result chunk of T[]
-