Search in sources :

Example 1 with RawBlockletColumnChunks

use of org.apache.carbondata.core.scan.processor.RawBlockletColumnChunks in project carbondata by apache.

the class FilterUtilTest method testCreateBitSetGroupWithColumnChunk.

@Test
public void testCreateBitSetGroupWithColumnChunk() {
    BlockletDataRefNode blockletDataRefNode = new MockUp<BlockletDataRefNode>() {

        @Mock
        public int numberOfPages() {
            return 2;
        }

        @Mock
        public int getPageRowCount(int pageNumber) {
            if (pageNumber == 0) {
                return 94;
            } else {
                return 6;
            }
        }
    }.getMockInstance();
    RawBlockletColumnChunks rawBlockletColumnChunks = new MockUp<RawBlockletColumnChunks>() {

        @Mock
        public DataRefNode getDataBlock() {
            return blockletDataRefNode;
        }
    }.getMockInstance();
    BitSetGroup bitSetGroupWithColumnChunk = FilterUtil.createBitSetGroupWithColumnChunk(rawBlockletColumnChunks, true);
    assertTrue(bitSetGroupWithColumnChunk.getNumberOfPages() == 2);
}
Also used : BitSetGroup(org.apache.carbondata.core.util.BitSetGroup) RawBlockletColumnChunks(org.apache.carbondata.core.scan.processor.RawBlockletColumnChunks) BlockletDataRefNode(org.apache.carbondata.core.indexstore.blockletindex.BlockletDataRefNode) DataRefNode(org.apache.carbondata.core.datastore.DataRefNode) Mock(mockit.Mock) BlockletDataRefNode(org.apache.carbondata.core.indexstore.blockletindex.BlockletDataRefNode) Test(org.junit.Test)

Aggregations

Mock (mockit.Mock)1 DataRefNode (org.apache.carbondata.core.datastore.DataRefNode)1 BlockletDataRefNode (org.apache.carbondata.core.indexstore.blockletindex.BlockletDataRefNode)1 RawBlockletColumnChunks (org.apache.carbondata.core.scan.processor.RawBlockletColumnChunks)1 BitSetGroup (org.apache.carbondata.core.util.BitSetGroup)1 Test (org.junit.Test)1