use of com.actiontech.dble.plan.common.item.function.operator.cmpfunc.ItemFuncEqual in project dble by actiontech.
the class JoinNode method genJoinFilter.
private ItemFuncEqual genJoinFilter(String using, String leftJoinNode, String rightJoinNode) {
ItemField column1 = new ItemField(null, leftJoinNode, using);
ItemField column2 = new ItemField(null, rightJoinNode, using);
return new ItemFuncEqual(column1, column2);
}
use of com.actiontech.dble.plan.common.item.function.operator.cmpfunc.ItemFuncEqual in project dble by actiontech.
the class ERJoinChooser method makeJoinNode.
/**
* just makeJoinNode according with wishes
*
* @param units
* @return
*/
private PlanNode makeJoinNode(List<PlanNode> units) {
PlanNode ret = units.get(0);
for (int i = 1; i < units.size(); i++) {
PlanNode tni = units.get(i);
JoinNode joinNode = new JoinNode(ret, tni);
List<ItemFuncEqual> joinFilter = makeJoinFilter(joinNode, ret, tni, true);
joinNode.setJoinFilter(joinFilter);
ret = joinNode;
}
return ret;
}
use of com.actiontech.dble.plan.common.item.function.operator.cmpfunc.ItemFuncEqual in project dble by actiontech.
the class ERJoinChooser method leftJoinOptimizer.
/* ------------------- left join optimizer start -------------------- */
/**
* left join's ER is different from inner join's
* ex:t1,t2 ,if t1 left join t2 on
* t1.id=t2.id can be pushed
* < we cna't change left join's structure>
*
* @return
*/
private JoinNode leftJoinOptimizer() {
PlanNode left = jn.getLeftNode();
PlanNode right = jn.getRightNode();
if (left.type() == PlanNode.PlanNodeType.JOIN) {
left = JoinERProcessor.optimize(left);
jn.setLeftNode(left);
}
if (right.type() == PlanNode.PlanNodeType.JOIN) {
right = JoinERProcessor.optimize(right);
jn.setRightNode(right);
}
for (ItemFuncEqual filter : jn.getJoinFilter()) {
ERTable leftER = getLeftOutJoinChildER(jn, left, filter.arguments().get(0));
ERTable rightER = getLeftOutJoinChildER(jn, right, filter.arguments().get(1));
if (isErRelation(leftER, rightER)) {
jn.getERkeys().add(leftER);
}
}
return jn;
}
use of com.actiontech.dble.plan.common.item.function.operator.cmpfunc.ItemFuncEqual in project dble by actiontech.
the class ERJoinChooser method makeRestFilter.
/**
* the origin filter is join on filter
* ,now join is changed ,and the filter is not join filter any more ,add it to other join on
*
* @return
*/
private Item makeRestFilter() {
Item filter = null;
for (List<JoinKeyInfo> selList : selLists) {
if (selList.size() > 2) {
Item sel0 = selList.get(0).key;
for (int index = 1; index < selList.size(); index++) {
ItemFuncEqual bf = FilterUtils.equal(sel0, selList.get(index).key);
filter = FilterUtils.and(filter, bf);
}
}
}
return filter;
}
Aggregations