Java Code Examples for it.uniroma3.mat.extendedset.intset.ConciseSet#addAll()

The following examples show how to use it.uniroma3.mat.extendedset.intset.ConciseSet#addAll() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BitMapContainer.java    From Kylin with Apache License 2.0 6 votes vote down vote up
@Override
public ConciseSet getBitMap(Integer startId, Integer endId) {
    if (startId == null && endId == null) {
        return sets[this.nValues];
    }

    int start = 0;
    int end = this.nValues - 1;
    if (startId != null) {
        start = startId;
    }
    if (endId != null) {
        end = endId;
    }

    ConciseSet ret = new ConciseSet();
    for (int i = start; i <= end; ++i) {
        ConciseSet temp = getBitMap(i);
        ret.addAll(temp);
    }
    return ret;
}
 
Example 2
Source File: BitMapFilterEvaluator.java    From Kylin with Apache License 2.0 5 votes vote down vote up
private ConciseSet evalCompareIn(CompareTupleFilter filter) {
    ConciseSet set = new ConciseSet();
    for (String value : filter.getValues()) {
        int id = Dictionary.stringToDictId(value);
        ConciseSet bitMap = provider.getBitMap(filter.getColumn(), id, id);
        if (bitMap == null)
            return null;
        set.addAll(bitMap);
    }
    return set;
}
 
Example 3
Source File: BitMapFilterEvaluator.java    From Kylin with Apache License 2.0 5 votes vote down vote up
private ConciseSet evalLogicalOr(List<? extends TupleFilter> children) {
    ConciseSet set = new ConciseSet();

    for (TupleFilter c : children) {
        ConciseSet t = evaluate(c);
        if (t == null)
            return null; // because it's OR

        set.addAll(t);
    }
    return set;
}
 
Example 4
Source File: BitMapFilterEvaluatorTest.java    From Kylin with Apache License 2.0 5 votes vote down vote up
@Override
public ConciseSet getBitMap(TblColRef col, Integer startId, Integer endId) {
    if (!col.equals(colA))
        return null;

    // i-th record has value ID i, and last record has value null
    if (startId == null && endId == null) {
        //entry for getting null value
        ConciseSet s = new ConciseSet();
        s.add(getRecordCount() - 1);
        return s;
    }

    int start = 0;
    int end = MAX_ID;
    if (startId != null) {
        start = startId;
    }
    if (endId != null) {
        end = endId;
    }

    ConciseSet ret = new ConciseSet();
    for (int i = start; i <= end; ++i) {
        ConciseSet temp = getBitMap(col, i);
        ret.addAll(temp);
    }
    return ret;
}
 
Example 5
Source File: BitMapFilterEvaluatorTest.java    From Kylin with Apache License 2.0 5 votes vote down vote up
@Test
public void testLogicalOr() {
    for (int i = 0; i < basicFilters.size(); i++) {
        for (int j = 0; j < basicFilters.size(); j++) {
            LogicalTupleFilter f = logical(FilterOperatorEnum.OR, basicFilters.get(i), basicFilters.get(j));
            ConciseSet r = basicResults.get(i).clone();
            r.addAll(basicResults.get(j));
            assertEquals(r, eval.evaluate(f));
        }
    }
}