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

The following examples show how to use org.apache.kylin.metadata.filter.ExtractTupleFilter. 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: DictGridTableTest.java    From kylin-on-parquet-v2 with Apache License 2.0 6 votes vote down vote up
@Test
public void verifyScanWithUnevaluatableFilter() throws IOException {
    GTInfo info = table.getInfo();

    CompareTupleFilter fComp = compare(info.colRef(0), FilterOperatorEnum.GT, enc(info, 0, "2015-01-14"));
    ExtractTupleFilter fUnevaluatable = unevaluatable(info.colRef(1));
    LogicalTupleFilter fNotPlusUnevaluatable = not(unevaluatable(info.colRef(1)));
    LogicalTupleFilter filter = and(fComp, fUnevaluatable, fNotPlusUnevaluatable);

    GTScanRequest req = new GTScanRequestBuilder().setInfo(info).setRanges(null).setDimensions(null)
            .setAggrGroupBy(setOf(0)).setAggrMetrics(setOf(3)).setAggrMetricsFuncs(new String[] { "sum" })
            .setFilterPushDown(filter).createGTScanRequest();

    // note the unEvaluatable column 1 in filter is added to group by
    assertEquals(
            "GTScanRequest [range=[[null, null]-[null, null]], columns={0, 1, 3}, filterPushDown=AND [UNKNOWN_MODEL:NULL.GT_MOCKUP_TABLE.0 GT [\\x00\\x00\\x01J\\xE5\\xBD\\x5C\\x00], [], []], aggrGroupBy={0, 1}, aggrMetrics={3}, aggrMetricsFuncs=[sum]]",
            req.toString());

    doScanAndVerify(table, useDeserializedGTScanRequest(req), "[1421280000000, 20, null, 20, null]",
            "[1421280000000, 30, null, 10, null]", "[1421366400000, 20, null, 20, null]",
            "[1421366400000, 30, null, 20, null]", "[1421452800000, 10, null, 10, null]");
}
 
Example #2
Source File: DictGridTableTest.java    From kylin with Apache License 2.0 6 votes vote down vote up
@Test
public void verifyScanWithUnevaluatableFilter() throws IOException {
    GTInfo info = table.getInfo();

    CompareTupleFilter fComp = compare(info.colRef(0), FilterOperatorEnum.GT, enc(info, 0, "2015-01-14"));
    ExtractTupleFilter fUnevaluatable = unevaluatable(info.colRef(1));
    LogicalTupleFilter fNotPlusUnevaluatable = not(unevaluatable(info.colRef(1)));
    LogicalTupleFilter filter = and(fComp, fUnevaluatable, fNotPlusUnevaluatable);

    GTScanRequest req = new GTScanRequestBuilder().setInfo(info).setRanges(null).setDimensions(null)
            .setAggrGroupBy(setOf(0)).setAggrMetrics(setOf(3)).setAggrMetricsFuncs(new String[] { "sum" })
            .setFilterPushDown(filter).createGTScanRequest();

    // note the unEvaluatable column 1 in filter is added to group by
    assertEquals(
            "GTScanRequest [range=[[null, null]-[null, null]], columns={0, 1, 3}, filterPushDown=AND [UNKNOWN_MODEL:NULL.GT_MOCKUP_TABLE.0 GT [\\x00\\x00\\x01J\\xE5\\xBD\\x5C\\x00], [], []], aggrGroupBy={0, 1}, aggrMetrics={3}, aggrMetricsFuncs=[sum]]",
            req.toString());

    doScanAndVerify(table, useDeserializedGTScanRequest(req), "[1421280000000, 20, null, 20, null]",
            "[1421280000000, 30, null, 10, null]", "[1421366400000, 20, null, 20, null]",
            "[1421366400000, 30, null, 20, null]", "[1421452800000, 10, null, 10, null]");
}
 
Example #3
Source File: DictGridTableTest.java    From kylin-on-parquet-v2 with Apache License 2.0 4 votes vote down vote up
public static ExtractTupleFilter unevaluatable(TblColRef col) {
    ExtractTupleFilter r = new ExtractTupleFilter(FilterOperatorEnum.EXTRACT);
    r.addChild(new ColumnTupleFilter(col));
    return r;
}
 
Example #4
Source File: DictGridTableTest.java    From kylin with Apache License 2.0 4 votes vote down vote up
public static ExtractTupleFilter unevaluatable(TblColRef col) {
    ExtractTupleFilter r = new ExtractTupleFilter(FilterOperatorEnum.EXTRACT);
    r.addChild(new ColumnTupleFilter(col));
    return r;
}