當前位置: 首頁>>代碼示例>>Java>>正文


Java OLAPSortRule類代碼示例

本文整理匯總了Java中org.apache.kylin.query.optrule.OLAPSortRule的典型用法代碼示例。如果您正苦於以下問題:Java OLAPSortRule類的具體用法?Java OLAPSortRule怎麽用?Java OLAPSortRule使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


OLAPSortRule類屬於org.apache.kylin.query.optrule包,在下文中一共展示了OLAPSortRule類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: register

import org.apache.kylin.query.optrule.OLAPSortRule; //導入依賴的package包/類
@Override
public void register(RelOptPlanner planner) {
    // force clear the query context before traversal relational operators
    OLAPContext.clearThreadLocalContexts();

    // register OLAP rules
    planner.addRule(OLAPToEnumerableConverterRule.INSTANCE);
    planner.addRule(OLAPFilterRule.INSTANCE);
    planner.addRule(OLAPProjectRule.INSTANCE);
    planner.addRule(OLAPAggregateRule.INSTANCE);
    planner.addRule(OLAPJoinRule.INSTANCE);
    planner.addRule(OLAPLimitRule.INSTANCE);
    planner.addRule(OLAPSortRule.INSTANCE);

    // since join is the entry point, we can't push filter past join
    planner.removeRule(PushFilterPastJoinRule.FILTER_ON_JOIN);
    planner.removeRule(PushFilterPastJoinRule.JOIN);

    // TODO : since we don't have statistic of table, the optimization of join is too cost
    planner.removeRule(SwapJoinRule.INSTANCE);
    planner.removeRule(PushJoinThroughJoinRule.LEFT);
    planner.removeRule(PushJoinThroughJoinRule.RIGHT);

    // for columns in having clause will enable table scan filter rule
    // cause kylin does not depend on MPP
    planner.removeRule(PushFilterPastProjectRule.INSTANCE);
    // distinct count will be split into a separated query that is joined with the left query
    planner.removeRule(RemoveDistinctAggregateRule.INSTANCE);
    
    // see Dec 26th email @ http://mail-archives.apache.org/mod_mbox/calcite-dev/201412.mbox/browser
    planner.removeRule(ExpandConversionRule.INSTANCE);
}
 
開發者ID:KylinOLAP,項目名稱:Kylin,代碼行數:33,代碼來源:OLAPTableScan.java

示例2: register

import org.apache.kylin.query.optrule.OLAPSortRule; //導入依賴的package包/類
@Override
public void register(RelOptPlanner planner) {
    // force clear the query context before traversal relational operators
    OLAPContext.clearThreadLocalContexts();

    // register OLAP rules
    addRules(planner, kylinConfig.getCalciteAddRule());

    planner.addRule(OLAPToEnumerableConverterRule.INSTANCE);
    planner.addRule(OLAPFilterRule.INSTANCE);
    planner.addRule(OLAPProjectRule.INSTANCE);
    planner.addRule(OLAPAggregateRule.INSTANCE);
    planner.addRule(OLAPJoinRule.INSTANCE);
    planner.addRule(OLAPLimitRule.INSTANCE);
    planner.addRule(OLAPSortRule.INSTANCE);
    planner.addRule(OLAPUnionRule.INSTANCE);
    planner.addRule(OLAPWindowRule.INSTANCE);

    // Support translate the grouping aggregate into union of simple aggregates
    planner.addRule(AggregateMultipleExpandRule.INSTANCE);
    planner.addRule(AggregateProjectReduceRule.INSTANCE);

    // CalcitePrepareImpl.CONSTANT_REDUCTION_RULES
    planner.addRule(ReduceExpressionsRule.PROJECT_INSTANCE);
    planner.addRule(ReduceExpressionsRule.FILTER_INSTANCE);
    planner.addRule(ReduceExpressionsRule.CALC_INSTANCE);
    planner.addRule(ReduceExpressionsRule.JOIN_INSTANCE);
    // the ValuesReduceRule breaks query test somehow...
    //        planner.addRule(ValuesReduceRule.FILTER_INSTANCE);
    //        planner.addRule(ValuesReduceRule.PROJECT_FILTER_INSTANCE);
    //        planner.addRule(ValuesReduceRule.PROJECT_INSTANCE);

    removeRules(planner, kylinConfig.getCalciteRemoveRule());

    // since join is the entry point, we can't push filter past join
    planner.removeRule(FilterJoinRule.FILTER_ON_JOIN);
    planner.removeRule(FilterJoinRule.JOIN);

    // since we don't have statistic of table, the optimization of join is too cost
    planner.removeRule(JoinCommuteRule.INSTANCE);
    planner.removeRule(JoinPushThroughJoinRule.LEFT);
    planner.removeRule(JoinPushThroughJoinRule.RIGHT);

    // keep tree structure like filter -> aggregation -> project -> join/table scan, implementOLAP() rely on this tree pattern
    planner.removeRule(AggregateJoinTransposeRule.INSTANCE);
    planner.removeRule(AggregateProjectMergeRule.INSTANCE);
    planner.removeRule(FilterProjectTransposeRule.INSTANCE);
    planner.removeRule(SortJoinTransposeRule.INSTANCE);
    planner.removeRule(JoinPushExpressionsRule.INSTANCE);
    planner.removeRule(SortUnionTransposeRule.INSTANCE);
    planner.removeRule(JoinUnionTransposeRule.LEFT_UNION);
    planner.removeRule(JoinUnionTransposeRule.RIGHT_UNION);
    planner.removeRule(AggregateUnionTransposeRule.INSTANCE);
    planner.removeRule(DateRangeRules.FILTER_INSTANCE);
    planner.removeRule(SemiJoinRule.JOIN);
    planner.removeRule(SemiJoinRule.PROJECT);
    // distinct count will be split into a separated query that is joined with the left query
    planner.removeRule(AggregateExpandDistinctAggregatesRule.INSTANCE);

    // see Dec 26th email @ http://mail-archives.apache.org/mod_mbox/calcite-dev/201412.mbox/browser
    planner.removeRule(ExpandConversionRule.INSTANCE);
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:63,代碼來源:OLAPTableScan.java


注:本文中的org.apache.kylin.query.optrule.OLAPSortRule類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。