Search in sources :

Example 6 with SortedRangeSet

use of io.prestosql.spi.predicate.SortedRangeSet in project hetu-core by openlookeng.

the class TestLogicalPart method getBloomFilterEqualityResult.

private List<Page> getBloomFilterEqualityResult(LogicalPart logicalPart, Long domainValue, boolean bloomFilterReturn) {
    Domain domain = Domain.create(ValueSet.ofRanges(equal(IntegerType.INTEGER, domainValue)), false);
    Map<Integer, BloomFilter> bloomIdx = new HashMap<>();
    bloomIdx.put(0, mock(BloomFilter.class));
    ReflectionTestUtils.setField(logicalPart, "bloomIdx", bloomIdx);
    LogicalPart spyLogicalPart = spy(logicalPart);
    doReturn(bloomFilterReturn).when(spyLogicalPart).testFilter(Mockito.any(BloomFilter.class), eq(domainValue));
    return spyLogicalPart.getPages(Collections.emptyMap(), ImmutableMap.of(0, ((SortedRangeSet) domain.getValues()).getOrderedRanges()), Collections.emptyMap());
}
Also used : SortedRangeSet(io.prestosql.spi.predicate.SortedRangeSet) HashMap(java.util.HashMap) Domain(io.prestosql.spi.predicate.Domain) BloomFilter(io.prestosql.spi.util.BloomFilter)

Example 7 with SortedRangeSet

use of io.prestosql.spi.predicate.SortedRangeSet in project hetu-core by openlookeng.

the class TestLogicalPart method getSparseFilterLessResult.

private List<Page> getSparseFilterLessResult(LogicalPart logicalPart, Long domainValue) {
    Domain domain = Domain.create(ValueSet.ofRanges(lessThan(IntegerType.INTEGER, domainValue)), false);
    List<Page> sparseResult = logicalPart.getPages(Collections.emptyMap(), Collections.emptyMap(), ImmutableMap.of(0, ((SortedRangeSet) domain.getValues()).getOrderedRanges()));
    return sparseResult;
}
Also used : SortedRangeSet(io.prestosql.spi.predicate.SortedRangeSet) Page(io.prestosql.spi.Page) Domain(io.prestosql.spi.predicate.Domain)

Aggregations

SortedRangeSet (io.prestosql.spi.predicate.SortedRangeSet)7 Domain (io.prestosql.spi.predicate.Domain)4 Range (io.prestosql.spi.predicate.Range)4 ArrayList (java.util.ArrayList)4 Type (io.prestosql.spi.type.Type)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 ImmutableList (com.google.common.collect.ImmutableList)1 Page (io.prestosql.spi.Page)1 ColumnHandle (io.prestosql.spi.connector.ColumnHandle)1 ConnectorSplit (io.prestosql.spi.connector.ConnectorSplit)1 FixedSplitSource (io.prestosql.spi.connector.FixedSplitSource)1 ValueSet (io.prestosql.spi.predicate.ValueSet)1 RowExpression (io.prestosql.spi.relation.RowExpression)1 CharType (io.prestosql.spi.type.CharType)1 DecimalType (io.prestosql.spi.type.DecimalType)1 VarbinaryType.isVarbinaryType (io.prestosql.spi.type.VarbinaryType.isVarbinaryType)1 Varchars.isVarcharType (io.prestosql.spi.type.Varchars.isVarcharType)1 BloomFilter (io.prestosql.spi.util.BloomFilter)1 LiteralEncoder.toRowExpression (io.prestosql.sql.planner.LiteralEncoder.toRowExpression)1