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


Java JoinNode.setOtherJoinOnFilter方法代碼示例

本文整理匯總了Java中com.taobao.tddl.optimizer.core.ast.query.JoinNode.setOtherJoinOnFilter方法的典型用法代碼示例。如果您正苦於以下問題:Java JoinNode.setOtherJoinOnFilter方法的具體用法?Java JoinNode.setOtherJoinOnFilter怎麽用?Java JoinNode.setOtherJoinOnFilter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.taobao.tddl.optimizer.core.ast.query.JoinNode的用法示例。


在下文中一共展示了JoinNode.setOtherJoinOnFilter方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addJoinOnColumns

import com.taobao.tddl.optimizer.core.ast.query.JoinNode; //導入方法依賴的package包/類
private void addJoinOnColumns(IFilter ifilter, JoinNode joinNode) {
    if (ifilter instanceof IBooleanFilter) {
        joinNode.addJoinFilter((IBooleanFilter) ifilter);

    } else if (ifilter instanceof ILogicalFilter) {
        ILogicalFilter ilf = (ILogicalFilter) ifilter;
        if (!ilf.getOperation().equals(OPERATION.AND)) {
            // 比如出現 A.id = B.id And ( A.id = 1 or A.name = 3)
            // 這裏的or條件可直接做為other join filter
            // 如果出現 A.id = B.id OR A.name = B.name,那就是一個未知情況了
            joinNode.setOtherJoinOnFilter(ilf);
        } else {
            List<IFilter> subFilter = ilf.getSubFilter();
            if (subFilter != null) {
                for (IFilter one : subFilter) {
                    addJoinOnColumns(one, joinNode);
                }
            } else {
                throw new IllegalStateException("and has no other columns , " + ifilter);
            }
        }
    }
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:24,代碼來源:MySqlExprVisitor.java

示例2: convertPlanToAst

import com.taobao.tddl.optimizer.core.ast.query.JoinNode; //導入方法依賴的package包/類
public static JoinNode convertPlanToAst(IJoin join) {
    JoinNode node = new JoinNode();
    node.setRightNode(convertPlanToAst(join.getRightNode()));
    node.setLeftNode(convertPlanToAst(join.getLeftNode()));
    node.setJoinStrategy(join.getJoinStrategy());
    if (join.getLeftOuter() && join.getRightOuter()) {
        node.setInnerJoin();
    } else if (join.getLeftOuter()) {
        node.setLeftOuterJoin();
    } else if (join.getRightOuter()) {
        node.setRightOuterJoin();
    } else {
        node.setOuterJoin();
    }

    int size = join.getLeftJoinOnColumns().size();
    for (int i = 0; i < size; i++) {
        node.addJoinKeys(join.getLeftJoinOnColumns().get(i), join.getRightJoinOnColumns().get(i));
    }
    node.setOrderBys(join.getOrderBys());
    node.setLimitFrom(join.getLimitFrom());
    node.setLimitTo(join.getLimitTo());
    node.setConsistent(join.getConsistent());
    node.setResultFilter(join.getValueFilter());
    node.having(join.getHavingFilter());
    node.setAlias(join.getAlias());
    node.setGroupBys(join.getGroupBys());
    node.setSubQuery(join.isSubQuery());
    node.setOtherJoinOnFilter(join.getOtherJoinOnFilter());
    node.select((join.getColumns()));
    node.setAllWhereFilter(join.getWhereFilter());
    node.setExistAggregate(join.isExistAggregate());
    node.executeOn(join.getDataNode());
    node.setSubqueryOnFilterId(join.getSubqueryOnFilterId());
    node.setSubqueryFilter(join.getSubqueryFilter());
    node.build();
    node = node.deepCopy();
    return node;
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:40,代碼來源:OptimizerUtils.java

示例3: addOtherJoinFilter

import com.taobao.tddl.optimizer.core.ast.query.JoinNode; //導入方法依賴的package包/類
private void addOtherJoinFilter(JoinNode jn, String filter) {
    IFilter f = FilterUtils.createFilter(filter);
    f = FilterPreProcessor.processFilter(f, true, null);
    List<List<IFilter>> DNFFilters = FilterUtils.toDNFNodesArray(FilterUtils.toDNFAndFlat(f));
    jn.setOtherJoinOnFilter(FilterUtils.DNFToOrLogicTree(DNFFilters));
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:7,代碼來源:FilterPusherTest.java

示例4: addOtherJoinFilter

import com.taobao.tddl.optimizer.core.ast.query.JoinNode; //導入方法依賴的package包/類
private void addOtherJoinFilter(JoinNode jn, String filter) {
    IFilter f = FilterUtils.createFilter(filter);
    List<List<IFilter>> DNFFilters = FilterUtils.toDNFNodesArray(FilterUtils.toDNFAndFlat(f));
    jn.setOtherJoinOnFilter(FilterUtils.DNFToAndLogicTree(DNFFilters.get(0)));
}
 
開發者ID:beebeandwer,項目名稱:TDDL,代碼行數:6,代碼來源:FilterPusherTest.java


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