use of io.trino.spi.block.AbstractRowBlock in project trino by trinodb.
the class ListaggAggregationStateSerializer method deserialize.
@Override
public void deserialize(Block block, int index, ListaggAggregationState state) {
checkArgument(block instanceof AbstractRowBlock);
ColumnarRow columnarRow = toColumnarRow(block);
Slice separator = VARCHAR.getSlice(columnarRow.getField(0), index);
boolean overflowError = BOOLEAN.getBoolean(columnarRow.getField(1), index);
Slice overflowFiller = VARCHAR.getSlice(columnarRow.getField(2), index);
boolean showOverflowEntryCount = BOOLEAN.getBoolean(columnarRow.getField(3), index);
Block stateBlock = (Block) arrayType.getObject(columnarRow.getField(4), index);
state.reset();
state.setSeparator(separator);
state.setOverflowError(overflowError);
state.setOverflowFiller(overflowFiller);
state.setShowOverflowEntryCount(showOverflowEntryCount);
for (int i = 0; i < stateBlock.getPositionCount(); i++) {
state.add(stateBlock, i);
}
}
Aggregations