Package com.facebook.presto.block.rle

Examples of com.facebook.presto.block.rle.RunLengthBlockEncoding


    {
        checkNotNull(block, "block is null");
        checkState(!finished, "already finished");

        if (encoding == null) {
            encoding = new RunLengthBlockEncoding(block.getEncoding());
        }

        for (int position = 0; position < block.getPositionCount(); position++) {
            if (lastValue == null) {
                lastValue = block.getSingleValueBlock(position);
View Full Code Here


                .build();

        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

    {
        checkNotNull(block, "block is null");
        checkState(!finished, "already finished");

        if (encoding == null) {
            encoding = new RunLengthBlockEncoding(block.getEncoding());
        }

        BlockCursor cursor = block.cursor();
        while (cursor.advanceNextPosition()) {
            if (lastValue == null) {
View Full Code Here

    {
        checkNotNull(block, "block is null");
        checkState(!finished, "already finished");

        if (encoding == null) {
            encoding = new RunLengthBlockEncoding(block.getEncoding());
        }

        BlockCursor cursor = block.cursor();
        while (cursor.advanceNextPosition()) {
            if (lastValue == null) {
View Full Code Here

        Block value = blockBuilder.build();

        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

                .toRandomAccessBlock();

        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

    {
        checkNotNull(block, "block is null");
        checkState(!finished, "already finished");

        if (encoding == null) {
            encoding = new RunLengthBlockEncoding(block.getEncoding());
        }

        for (int position = 0; position < block.getPositionCount(); position++) {
            if (lastValue == null) {
                lastValue = block.getSingleValueBlock(position);
View Full Code Here

TOP

Related Classes of com.facebook.presto.block.rle.RunLengthBlockEncoding

Copyright © 2018 www.massapicom. 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.