use of com.facebook.presto.common.block.DictionaryBlock in project urban-eureka by errir503.
the class TestDictionaryAwarePageFilter method testDictionaryBlockProcessingWithUnusedFailure.
@Test
public void testDictionaryBlockProcessingWithUnusedFailure() {
// match some
testFilter(createDictionaryBlockWithUnusedEntries(20, 100), DictionaryBlock.class);
// match none
testFilter(createDictionaryBlockWithUnusedEntries(20, 0), DictionaryBlock.class);
// match all
testFilter(new DictionaryBlock(createLongsBlock(4, 5, -1), new int[100]), DictionaryBlock.class);
}
use of com.facebook.presto.common.block.DictionaryBlock in project urban-eureka by errir503.
the class TestDictionaryAwarePageProjection method createDictionaryBlock.
private static DictionaryBlock createDictionaryBlock(int dictionarySize, int blockSize) {
Block dictionary = createLongSequenceBlock(0, dictionarySize);
int[] ids = new int[blockSize];
Arrays.setAll(ids, index -> index % dictionarySize);
return new DictionaryBlock(dictionary, ids);
}
use of com.facebook.presto.common.block.DictionaryBlock in project urban-eureka by errir503.
the class TestDictionaryAwarePageProjection method testDictionaryProcessingEnableDisable.
@Test(dataProvider = "forceYield")
public void testDictionaryProcessingEnableDisable(boolean forceYield) {
DictionaryAwarePageProjection projection = createProjection();
// function will always processes the first dictionary
DictionaryBlock ineffectiveBlock = createDictionaryBlock(100, 20);
testProjectRange(ineffectiveBlock, DictionaryBlock.class, projection, forceYield);
testProjectFastReturnIgnoreYield(ineffectiveBlock, projection);
// dictionary processing can reuse the last dictionary
// in this case, we don't even check yield signal; make yieldForce to false
testProjectList(ineffectiveBlock, DictionaryBlock.class, projection, false);
// last dictionary not effective, so dictionary processing is disabled
DictionaryBlock effectiveBlock = createDictionaryBlock(10, 100);
testProjectRange(effectiveBlock, LongArrayBlock.class, projection, forceYield);
testProjectList(effectiveBlock, LongArrayBlock.class, projection, forceYield);
// last dictionary effective, so dictionary processing is enabled again
testProjectRange(ineffectiveBlock, DictionaryBlock.class, projection, forceYield);
testProjectFastReturnIgnoreYield(ineffectiveBlock, projection);
// dictionary processing can reuse the last dictionary
// in this case, we don't even check yield signal; make yieldForce to false
testProjectList(ineffectiveBlock, DictionaryBlock.class, projection, false);
// last dictionary not effective, so dictionary processing is disabled again
testProjectRange(effectiveBlock, LongArrayBlock.class, projection, forceYield);
testProjectList(effectiveBlock, LongArrayBlock.class, projection, forceYield);
}
use of com.facebook.presto.common.block.DictionaryBlock in project urban-eureka by errir503.
the class TestDictionaryAwarePageProjection method createDictionaryBlockWithFailure.
private static DictionaryBlock createDictionaryBlockWithFailure(int dictionarySize, int blockSize) {
Block dictionary = createLongSequenceBlock(-10, dictionarySize - 10);
int[] ids = new int[blockSize];
Arrays.setAll(ids, index -> index % dictionarySize);
return new DictionaryBlock(dictionary, ids);
}
use of com.facebook.presto.common.block.DictionaryBlock in project urban-eureka by errir503.
the class TestDictionaryAwarePageProjection method testDictionaryBlock.
@Test(dataProvider = "forceYield")
public void testDictionaryBlock(boolean forceYield) {
DictionaryBlock block = createDictionaryBlock(10, 100);
testProject(block, DictionaryBlock.class, forceYield);
}
Aggregations