Search in sources :

Example 6 with RunLengthEncodedBlock

use of io.prestosql.spi.block.RunLengthEncodedBlock in project hetu-core by openlookeng.

the class TestColumnarMap method assertRunLengthEncodedBlock.

private static void assertRunLengthEncodedBlock(Block block, Slice[][][] expectedValues) {
    for (int position = 0; position < block.getPositionCount(); position++) {
        RunLengthEncodedBlock runLengthEncodedBlock = createTestRleBlock(block, position);
        Slice[][][] expectedDictionaryValues = createTestRleExpectedValues(expectedValues, position);
        assertBlock(runLengthEncodedBlock, expectedDictionaryValues);
        assertColumnarMap(runLengthEncodedBlock, expectedDictionaryValues);
    }
}
Also used : Slice(io.airlift.slice.Slice) RunLengthEncodedBlock(io.prestosql.spi.block.RunLengthEncodedBlock)

Example 7 with RunLengthEncodedBlock

use of io.prestosql.spi.block.RunLengthEncodedBlock in project hetu-core by openlookeng.

the class TestColumnarRow method assertRunLengthEncodedBlock.

private static <T> void assertRunLengthEncodedBlock(Block block, T[] expectedValues) {
    for (int position = 0; position < block.getPositionCount(); position++) {
        RunLengthEncodedBlock runLengthEncodedBlock = createTestRleBlock(block, position);
        T[] expectedDictionaryValues = createTestRleExpectedValues(expectedValues, position);
        assertBlock(runLengthEncodedBlock, expectedDictionaryValues);
        assertColumnarRow(runLengthEncodedBlock, expectedDictionaryValues);
    }
}
Also used : RunLengthEncodedBlock(io.prestosql.spi.block.RunLengthEncodedBlock)

Example 8 with RunLengthEncodedBlock

use of io.prestosql.spi.block.RunLengthEncodedBlock in project hetu-core by openlookeng.

the class TestColumnarArray method assertRunLengthEncodedBlock.

private static <T> void assertRunLengthEncodedBlock(Block block, T[] expectedValues) {
    for (int position = 0; position < block.getPositionCount(); position++) {
        RunLengthEncodedBlock runLengthEncodedBlock = createTestRleBlock(block, position);
        T[] expectedDictionaryValues = createTestRleExpectedValues(expectedValues, position);
        assertBlock(runLengthEncodedBlock, expectedDictionaryValues);
        assertColumnarArray(runLengthEncodedBlock, expectedDictionaryValues);
    }
}
Also used : RunLengthEncodedBlock(io.prestosql.spi.block.RunLengthEncodedBlock)

Example 9 with RunLengthEncodedBlock

use of io.prestosql.spi.block.RunLengthEncodedBlock in project hetu-core by openlookeng.

the class TestDictionaryAwarePageFilter method testRleBlockWithFailure.

@Test
public void testRleBlockWithFailure() {
    DictionaryAwarePageFilter filter = createDictionaryAwarePageFilter(true, LongArrayBlock.class);
    RunLengthEncodedBlock fail = new RunLengthEncodedBlock(createLongSequenceBlock(-10, -9), 100);
    assertThrows(NegativeValueException.class, () -> testFilter(filter, fail, true));
}
Also used : RunLengthEncodedBlock(io.prestosql.spi.block.RunLengthEncodedBlock) Test(org.testng.annotations.Test)

Example 10 with RunLengthEncodedBlock

use of io.prestosql.spi.block.RunLengthEncodedBlock in project hetu-core by openlookeng.

the class TestDictionaryAwarePageProjection method testRleBlockWithFailure.

@Test(dataProvider = "forceYield")
public void testRleBlockWithFailure(boolean forceYield) {
    Block value = createLongSequenceBlock(-43, -42);
    RunLengthEncodedBlock block = new RunLengthEncodedBlock(value, 100);
    testProjectFails(block, RunLengthEncodedBlock.class, forceYield);
}
Also used : RunLengthEncodedBlock(io.prestosql.spi.block.RunLengthEncodedBlock) LongArrayBlock(io.prestosql.spi.block.LongArrayBlock) DictionaryBlock(io.prestosql.spi.block.DictionaryBlock) Block(io.prestosql.spi.block.Block) LazyBlock(io.prestosql.spi.block.LazyBlock) BlockAssertions.createLongSequenceBlock(io.prestosql.block.BlockAssertions.createLongSequenceBlock) RunLengthEncodedBlock(io.prestosql.spi.block.RunLengthEncodedBlock) Test(org.testng.annotations.Test)

Aggregations

RunLengthEncodedBlock (io.prestosql.spi.block.RunLengthEncodedBlock)30 Block (io.prestosql.spi.block.Block)18 Page (io.prestosql.spi.Page)10 Test (org.testng.annotations.Test)7 BlockBuilder (io.prestosql.spi.block.BlockBuilder)6 Slice (io.airlift.slice.Slice)5 LongArrayBlock (io.prestosql.spi.block.LongArrayBlock)4 PrestoException (io.prestosql.spi.PrestoException)3 DictionaryBlock (io.prestosql.spi.block.DictionaryBlock)3 LazyBlock (io.prestosql.spi.block.LazyBlock)3 IOException (java.io.IOException)3 BlockAssertions.createLongSequenceBlock (io.prestosql.block.BlockAssertions.createLongSequenceBlock)2 DriverYieldSignal (io.prestosql.operator.DriverYieldSignal)2 PageProcessor (io.prestosql.operator.project.PageProcessor)2 RowBlock (io.prestosql.spi.block.RowBlock)2 RowBlockBuilder (io.prestosql.spi.block.RowBlockBuilder)2 Type (io.prestosql.spi.type.Type)2 UncheckedIOException (java.io.UncheckedIOException)2 SequencePageBuilder.createSequencePage (io.prestosql.SequencePageBuilder.createSequencePage)1 PageSplitterUtil.splitPage (io.prestosql.execution.buffer.PageSplitterUtil.splitPage)1