Examples of writeBlock()


Examples of com.facebook.presto.block.rle.RunLengthBlockEncoding.writeBlock()

        RunLengthEncodedBlock expectedBlock = new RunLengthEncodedBlock(value, 11);

        DynamicSliceOutput sliceOutput = new DynamicSliceOutput(1024);
        RunLengthBlockEncoding blockEncoding = new RunLengthBlockEncoding(new VariableWidthBlockEncoding(VARCHAR));
        blockEncoding.writeBlock(sliceOutput, expectedBlock);
        RunLengthEncodedBlock actualBlock = blockEncoding.readBlock(sliceOutput.slice().getInput());
        assertTrue(actualBlock.equalTo(0, expectedBlock, 0));
        BlockAssertions.assertBlockEquals(actualBlock, expectedBlock);
    }
View Full Code Here

Examples of com.facebook.presto.block.rle.RunLengthBlockEncoding.writeBlock()

        RunLengthEncodedBlock expectedBlock = new RunLengthEncodedBlock(value, 11);

        DynamicSliceOutput sliceOutput = new DynamicSliceOutput(1024);
        RunLengthBlockEncoding blockEncoding = new RunLengthBlockEncoding(new VariableWidthBlockEncoding());
        blockEncoding.writeBlock(sliceOutput, expectedBlock);
        RunLengthEncodedBlock actualBlock = blockEncoding.readBlock(sliceOutput.slice().getInput());
        assertTrue(positionEqualsPosition(VARCHAR, actualBlock, 0, expectedBlock, 0));
        BlockAssertions.assertBlockEquals(VARCHAR, actualBlock, expectedBlock);
    }
View Full Code Here

Examples of com.facebook.presto.block.rle.RunLengthBlockEncoding.writeBlock()

        RunLengthEncodedBlock expectedBlock = new RunLengthEncodedBlock(value, 11);

        DynamicSliceOutput sliceOutput = new DynamicSliceOutput(1024);
        RunLengthBlockEncoding blockEncoding = new RunLengthBlockEncoding(new VariableWidthBlockEncoding(VARCHAR));
        blockEncoding.writeBlock(sliceOutput, expectedBlock);
        RunLengthEncodedBlock actualBlock = blockEncoding.readBlock(sliceOutput.slice().getInput());
        assertTrue(actualBlock.equalTo(0, expectedBlock, 0));
        BlockAssertions.assertBlockEquals(actualBlock, expectedBlock);
    }
View Full Code Here

Examples of com.facebook.presto.spi.block.BlockEncoding.writeBlock()

                .appendSlice(Slices.utf8Slice("dave"))
                .build();

        DynamicSliceOutput sliceOutput = new DynamicSliceOutput(1024);
        BlockEncoding blockEncoding = new VariableWidthBlockEncoding(VARCHAR);
        blockEncoding.writeBlock(sliceOutput, expectedBlock);
        Block actualBlock = blockEncoding.readBlock(sliceOutput.slice().getInput());
        BlockAssertions.assertBlockEquals(actualBlock, expectedBlock);
    }

    @Test
View Full Code Here

Examples of com.facebook.presto.spi.block.BlockEncoding.writeBlock()

        public void writeEncoding(BlockEncodingSerde serde, SliceOutput output, DictionaryBlockEncoding blockEncoding)
        {
            // write the dictionary
            BlockEncoding dictionaryBlockEncoding = blockEncoding.dictionary.getEncoding();
            serde.writeBlockEncoding(output, dictionaryBlockEncoding);
            dictionaryBlockEncoding.writeBlock(output, blockEncoding.dictionary);

            // write the id block encoding
            serde.writeBlockEncoding(output, blockEncoding.idBlockEncoding);
        }
    }
View Full Code Here

Examples of com.facebook.presto.spi.block.BlockEncoding.writeBlock()

        public void writeEncoding(BlockEncodingSerde serde, SliceOutput output, DictionaryBlockEncoding blockEncoding)
        {
            // write the dictionary
            BlockEncoding dictionaryBlockEncoding = blockEncoding.dictionary.getEncoding();
            serde.writeBlockEncoding(output, dictionaryBlockEncoding);
            dictionaryBlockEncoding.writeBlock(output, blockEncoding.dictionary);

            // write the id block encoding
            serde.writeBlockEncoding(output, blockEncoding.idBlockEncoding);
        }
    }
View Full Code Here

Examples of com.facebook.presto.spi.block.BlockEncoding.writeBlock()

        VARCHAR.writeString(expectedBlockBuilder, "dave");
        Block expectedBlock = expectedBlockBuilder.build();

        DynamicSliceOutput sliceOutput = new DynamicSliceOutput(1024);
        BlockEncoding blockEncoding = new VariableWidthBlockEncoding();
        blockEncoding.writeBlock(sliceOutput, expectedBlock);
        Block actualBlock = blockEncoding.readBlock(sliceOutput.slice().getInput());
        BlockAssertions.assertBlockEquals(VARCHAR, actualBlock, expectedBlock);
    }

    @Test
View Full Code Here

Examples of com.facebook.presto.spi.block.BlockEncoding.writeBlock()

    private static Block copyBlock(Block block)
    {
        DynamicSliceOutput sliceOutput = new DynamicSliceOutput(1024);
        BlockEncoding blockEncoding = block.getEncoding();
        blockEncoding.writeBlock(sliceOutput, block);
        return blockEncoding.readBlock(sliceOutput.slice().getInput());
    }

    private static Block toSingeValuedBlock(Slice expectedValue)
    {
View Full Code Here

Examples of com.facebook.presto.spi.block.BlockEncoding.writeBlock()

        public void writeEncoding(BlockEncodingSerde serde, SliceOutput output, DictionaryBlockEncoding blockEncoding)
        {
            // write the dictionary
            BlockEncoding dictionaryBlockEncoding = blockEncoding.dictionary.getEncoding();
            serde.writeBlockEncoding(output, dictionaryBlockEncoding);
            dictionaryBlockEncoding.writeBlock(output, blockEncoding.dictionary);

            // write the id block encoding
            serde.writeBlockEncoding(output, blockEncoding.idBlockEncoding);
        }
    }
View Full Code Here

Examples of com.facebook.presto.spi.block.BlockEncoding.writeBlock()

    {
        Block block = createTestBlock();

        DynamicSliceOutput sliceOutput = new DynamicSliceOutput(1024);
        BlockEncoding blockEncoding = block.getEncoding();
        blockEncoding.writeBlock(sliceOutput, block);
        Block actualBlock = blockEncoding.readBlock(sliceOutput.slice().getInput());
        BlockAssertions.assertBlockEquals(actualBlock, block);
    }

    protected void assertPositionEquals(Block block, int position, Object value)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.