use of io.trino.orc.writer.SliceDictionaryColumnWriter in project trino by trinodb.
the class TestSliceDictionaryColumnWriter method testDirectConversion.
@Test
public void testDirectConversion() {
SliceDictionaryColumnWriter writer = new SliceDictionaryColumnWriter(ROOT_COLUMN, VARCHAR, CompressionKind.NONE, toIntExact(DEFAULT_MAX_COMPRESSION_BUFFER_SIZE.toBytes()), () -> new StringStatisticsBuilder(toIntExact(DEFAULT_MAX_STRING_STATISTICS_LIMIT.toBytes()), new NoOpBloomFilterBuilder()));
// a single row group exceeds 2G after direct conversion
byte[] value = new byte[megabytes(1)];
ThreadLocalRandom.current().nextBytes(value);
Block data = RunLengthEncodedBlock.create(VARCHAR, Slices.wrappedBuffer(value), 3000);
writer.beginRowGroup();
writer.writeBlock(data);
writer.finishRowGroup();
assertFalse(writer.tryConvertToDirect(megabytes(64)).isPresent());
}
Aggregations