use of io.trino.spi.block.VariableWidthBlock in project trino by trinodb.
the class SliceDictionaryColumnReader method setDictionaryBlockData.
private void setDictionaryBlockData(byte[] dictionaryData, int[] dictionaryOffsets, int positionCount) {
verify(positionCount > 0);
// the engine currently uses identity equality to test if dictionaries are the same
if (currentDictionaryData != dictionaryData) {
boolean[] isNullVector = new boolean[positionCount];
isNullVector[positionCount - 1] = true;
dictionaryOffsets[positionCount] = dictionaryOffsets[positionCount - 1];
dictionaryBlock = new VariableWidthBlock(positionCount, wrappedBuffer(dictionaryData), dictionaryOffsets, Optional.of(isNullVector));
currentDictionaryData = dictionaryData;
memoryContext.setBytes(getRetainedSizeInBytes());
}
}
Aggregations