当前位置: 首页>>代码示例>>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;未经允许,请勿转载。