Search in sources :

Example 16 with LazyBlock

use of io.trino.spi.block.LazyBlock in project trino by trinodb.

the class LazyRecordPageSource method lazyWrapper.

private Page lazyWrapper(Page page) {
    Block[] lazyBlocks = new Block[page.getChannelCount()];
    for (int i = 0; i < page.getChannelCount(); ++i) {
        Block block = page.getBlock(i);
        lazyBlocks[i] = new LazyBlock(page.getPositionCount(), () -> block);
    }
    return new Page(page.getPositionCount(), lazyBlocks);
}
Also used : LazyBlock(io.trino.spi.block.LazyBlock) LazyBlock(io.trino.spi.block.LazyBlock) Block(io.trino.spi.block.Block) Page(io.trino.spi.Page)

Aggregations

LazyBlock (io.trino.spi.block.LazyBlock)16 Page (io.trino.spi.Page)14 Test (org.testng.annotations.Test)11 Block (io.trino.spi.block.Block)10 DriverYieldSignal (io.trino.operator.DriverYieldSignal)4 RunLengthEncodedBlock (io.trino.spi.block.RunLengthEncodedBlock)4 Type (io.trino.spi.type.Type)4 Optional (java.util.Optional)4 RowBlock (io.trino.spi.block.RowBlock)3 ArrayList (java.util.ArrayList)3 RowPagesBuilder (io.trino.RowPagesBuilder)2 LocalMemoryContext (io.trino.memory.context.LocalMemoryContext)2 DictionaryBlock (io.trino.spi.block.DictionaryBlock)2 LongArrayBlock (io.trino.spi.block.LongArrayBlock)2 PlanNodeId (io.trino.sql.planner.plan.PlanNodeId)2 MaterializedResult (io.trino.testing.MaterializedResult)2 Preconditions.checkState (com.google.common.base.Preconditions.checkState)1 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)1 ImmutableSet (com.google.common.collect.ImmutableSet)1