本文整理汇总了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);
}
}
}
}
示例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;
}
示例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));
}
示例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)));
}