Search in sources :

Example 1 with DeltaBinaryPackingValuesWriter

use of org.apache.parquet.column.values.delta.DeltaBinaryPackingValuesWriter in project parquet-mr by apache.

the class BenchmarkIntegerOutputSize method testRandomIntegers.

public void testRandomIntegers(IntFunc func, int bitWidth) {
    DeltaBinaryPackingValuesWriter delta = new DeltaBinaryPackingValuesWriterForInteger(blockSize, miniBlockNum, 100, 20000, new DirectByteBufferAllocator());
    RunLengthBitPackingHybridValuesWriter rle = new RunLengthBitPackingHybridValuesWriter(bitWidth, 100, 20000, new DirectByteBufferAllocator());
    for (int i = 0; i < dataSize; i++) {
        int v = func.getIntValue();
        delta.writeInteger(v);
        rle.writeInteger(v);
    }
    System.out.println("delta size: " + delta.getBytes().size());
    System.out.println("estimated size" + estimatedSize());
    System.out.println("rle size: " + rle.getBytes().size());
}
Also used : DirectByteBufferAllocator(org.apache.parquet.bytes.DirectByteBufferAllocator) DeltaBinaryPackingValuesWriterForInteger(org.apache.parquet.column.values.delta.DeltaBinaryPackingValuesWriterForInteger) RunLengthBitPackingHybridValuesWriter(org.apache.parquet.column.values.rle.RunLengthBitPackingHybridValuesWriter) DeltaBinaryPackingValuesWriter(org.apache.parquet.column.values.delta.DeltaBinaryPackingValuesWriter)

Example 2 with DeltaBinaryPackingValuesWriter

use of org.apache.parquet.column.values.delta.DeltaBinaryPackingValuesWriter in project parquet-mr by apache.

the class RandomWritingBenchmarkTest method writeDeltaPackingTest2.

@BenchmarkOptions(benchmarkRounds = 10, warmupRounds = 2)
@Test
public void writeDeltaPackingTest2() {
    DeltaBinaryPackingValuesWriter writer = new DeltaBinaryPackingValuesWriterForInteger(blockSize, miniBlockNum, 100, 20000, new DirectByteBufferAllocator());
    runWriteTest(writer);
}
Also used : DirectByteBufferAllocator(org.apache.parquet.bytes.DirectByteBufferAllocator) DeltaBinaryPackingValuesWriterForInteger(org.apache.parquet.column.values.delta.DeltaBinaryPackingValuesWriterForInteger) DeltaBinaryPackingValuesWriter(org.apache.parquet.column.values.delta.DeltaBinaryPackingValuesWriter) Test(org.junit.Test) BenchmarkOptions(com.carrotsearch.junitbenchmarks.BenchmarkOptions)

Example 3 with DeltaBinaryPackingValuesWriter

use of org.apache.parquet.column.values.delta.DeltaBinaryPackingValuesWriter in project parquet-mr by apache.

the class RandomWritingBenchmarkTest method writeDeltaPackingTest.

@BenchmarkOptions(benchmarkRounds = 10, warmupRounds = 2)
@Test
public void writeDeltaPackingTest() {
    DeltaBinaryPackingValuesWriter writer = new DeltaBinaryPackingValuesWriterForInteger(blockSize, miniBlockNum, 100, 20000, new DirectByteBufferAllocator());
    runWriteTest(writer);
}
Also used : DirectByteBufferAllocator(org.apache.parquet.bytes.DirectByteBufferAllocator) DeltaBinaryPackingValuesWriterForInteger(org.apache.parquet.column.values.delta.DeltaBinaryPackingValuesWriterForInteger) DeltaBinaryPackingValuesWriter(org.apache.parquet.column.values.delta.DeltaBinaryPackingValuesWriter) Test(org.junit.Test) BenchmarkOptions(com.carrotsearch.junitbenchmarks.BenchmarkOptions)

Aggregations

DirectByteBufferAllocator (org.apache.parquet.bytes.DirectByteBufferAllocator)3 DeltaBinaryPackingValuesWriter (org.apache.parquet.column.values.delta.DeltaBinaryPackingValuesWriter)3 DeltaBinaryPackingValuesWriterForInteger (org.apache.parquet.column.values.delta.DeltaBinaryPackingValuesWriterForInteger)3 BenchmarkOptions (com.carrotsearch.junitbenchmarks.BenchmarkOptions)2 Test (org.junit.Test)2 RunLengthBitPackingHybridValuesWriter (org.apache.parquet.column.values.rle.RunLengthBitPackingHybridValuesWriter)1