use of org.apache.parquet.column.values.delta.DeltaBinaryPackingValuesReader in project parquet-mr by apache.
the class TestDeltaLengthByteArray method testLengths.
@Test
public void testLengths() throws IOException {
DeltaLengthByteArrayValuesWriter writer = getDeltaLengthByteArrayValuesWriter();
ValuesReader reader = new DeltaBinaryPackingValuesReader();
Utils.writeData(writer, values);
int[] bin = Utils.readInts(reader, writer.getBytes().toInputStream(), values.length);
for (int i = 0; i < bin.length; i++) {
Assert.assertEquals(values[i].length(), bin[i]);
}
}
use of org.apache.parquet.column.values.delta.DeltaBinaryPackingValuesReader in project parquet-mr by apache.
the class TestDeltaByteArray method testLengths.
@Test
public void testLengths() throws IOException {
DeltaByteArrayWriter writer = new DeltaByteArrayWriter(64 * 1024, 64 * 1024, new DirectByteBufferAllocator());
ValuesReader reader = new DeltaBinaryPackingValuesReader();
Utils.writeData(writer, values);
ByteBufferInputStream data = writer.getBytes().toInputStream();
int[] bin = Utils.readInts(reader, data, values.length);
// test prefix lengths
Assert.assertEquals(0, bin[0]);
Assert.assertEquals(7, bin[1]);
Assert.assertEquals(7, bin[2]);
reader = new DeltaBinaryPackingValuesReader();
bin = Utils.readInts(reader, data, values.length);
// test suffix lengths
Assert.assertEquals(10, bin[0]);
Assert.assertEquals(0, bin[1]);
Assert.assertEquals(7, bin[2]);
}
use of org.apache.parquet.column.values.delta.DeltaBinaryPackingValuesReader in project parquet-mr by apache.
the class BenchmarkReadingRandomIntegers method readingDelta.
@BenchmarkOptions(benchmarkRounds = 20, warmupRounds = 10)
@Test
public void readingDelta() throws IOException {
for (int j = 0; j < 10; j++) {
DeltaBinaryPackingValuesReader reader = new DeltaBinaryPackingValuesReader();
readData(reader, deltaBytes);
}
}
Aggregations