org.apache.kylin.metadata.filter.CaseTupleFilter Java Examples

The following examples show how to use org.apache.kylin.metadata.filter.CaseTupleFilter. 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: FilterBaseTest.java    From kylin-on-parquet-v2 with Apache License 2.0 5 votes vote down vote up
protected CaseTupleFilter buildCaseFilter(List<TblColRef> groups) {
    CaseTupleFilter caseFilter = new CaseTupleFilter();

    TupleFilter when0 = buildAndFilter(groups);
    caseFilter.addChild(when0);
    TupleFilter then0 = new ConstantTupleFilter("0");
    caseFilter.addChild(then0);

    TupleFilter when1 = buildEQCompareFilter(groups, 0);
    caseFilter.addChild(when1);
    TupleFilter then1 = new ConstantTupleFilter("1");
    caseFilter.addChild(then1);

    TupleFilter when2 = buildEQCompareFilter(groups, 1);
    caseFilter.addChild(when2);
    TupleFilter then2 = new ConstantTupleFilter("2");
    caseFilter.addChild(then2);

    TupleFilter when3 = buildOrFilter(groups);
    caseFilter.addChild(when3);
    TupleFilter then3 = new ConstantTupleFilter("3");
    caseFilter.addChild(then3);

    TupleFilter else4 = new ConstantTupleFilter("4");
    caseFilter.addChild(else4);

    return caseFilter;
}
 
Example #2
Source File: FilterBaseTest.java    From kylin-on-parquet-v2 with Apache License 2.0 5 votes vote down vote up
protected CompareTupleFilter buildCompareCaseFilter(List<TblColRef> groups, String constValue) {
    CompareTupleFilter compareFilter = new CompareTupleFilter(FilterOperatorEnum.EQ);
    CaseTupleFilter caseFilter = buildCaseFilter(groups);
    compareFilter.addChild(caseFilter);
    ConstantTupleFilter constantFilter = new ConstantTupleFilter(constValue);
    compareFilter.addChild(constantFilter);
    return compareFilter;
}
 
Example #3
Source File: FilterBaseTest.java    From kylin with Apache License 2.0 5 votes vote down vote up
protected CaseTupleFilter buildCaseFilter(List<TblColRef> groups) {
    CaseTupleFilter caseFilter = new CaseTupleFilter();

    TupleFilter when0 = buildAndFilter(groups);
    caseFilter.addChild(when0);
    TupleFilter then0 = new ConstantTupleFilter("0");
    caseFilter.addChild(then0);

    TupleFilter when1 = buildEQCompareFilter(groups, 0);
    caseFilter.addChild(when1);
    TupleFilter then1 = new ConstantTupleFilter("1");
    caseFilter.addChild(then1);

    TupleFilter when2 = buildEQCompareFilter(groups, 1);
    caseFilter.addChild(when2);
    TupleFilter then2 = new ConstantTupleFilter("2");
    caseFilter.addChild(then2);

    TupleFilter when3 = buildOrFilter(groups);
    caseFilter.addChild(when3);
    TupleFilter then3 = new ConstantTupleFilter("3");
    caseFilter.addChild(then3);

    TupleFilter else4 = new ConstantTupleFilter("4");
    caseFilter.addChild(else4);

    return caseFilter;
}
 
Example #4
Source File: FilterBaseTest.java    From kylin with Apache License 2.0 5 votes vote down vote up
protected CompareTupleFilter buildCompareCaseFilter(List<TblColRef> groups, String constValue) {
    CompareTupleFilter compareFilter = new CompareTupleFilter(FilterOperatorEnum.EQ);
    CaseTupleFilter caseFilter = buildCaseFilter(groups);
    compareFilter.addChild(caseFilter);
    ConstantTupleFilter constantFilter = new ConstantTupleFilter(constValue);
    compareFilter.addChild(constantFilter);
    return compareFilter;
}