Interface VectorExpansionKernel
- All Known Implementing Classes:
ByteVectorExpansionKernel
,CharVectorExpansionKernel
,DoubleVectorExpansionKernel
,FloatVectorExpansionKernel
,IntVectorExpansionKernel
,LongVectorExpansionKernel
,ObjectVectorExpansionKernel
,ShortVectorExpansionKernel
public interface VectorExpansionKernel
-
Method Summary
Modifier and TypeMethodDescription<A extends Any>
WritableObjectChunk<Vector<?>,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[]>
.<A extends Any>
WritableChunk<A>expand
(ObjectChunk<Vector<?>, A> source, WritableIntChunk<ChunkPositions> perElementLengthDest) This expands the source from aTVector
per element to a flatT
per element.static Class<?>
getComponentType
(Class<?> type, Class<?> componentType) static <T> VectorExpansionKernel
makeExpansionKernel
(ChunkType chunkType, Class<T> componentType)
-
Method Details
-
getComponentType
-
makeExpansionKernel
- Returns:
- a kernel that expands a
Chunk<VectorT>
to pair ofLongChunk, Chunk<T>
-
expand
<A extends Any> WritableChunk<A> expand(ObjectChunk<Vector<?>, A> source, WritableIntChunk<ChunkPositions> perElementLengthDest) This expands the source from aTVector
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 TVector 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
<A extends Any> WritableObjectChunk<Vector<?>,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[]
-