本文整理汇总了Java中com.taobao.tddl.optimizer.core.ast.query.JoinNode.having方法的典型用法代码示例。如果您正苦于以下问题:Java JoinNode.having方法的具体用法?Java JoinNode.having怎么用?Java JoinNode.having使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.taobao.tddl.optimizer.core.ast.query.JoinNode
的用法示例。
在下文中一共展示了JoinNode.having方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: TableNode
import com.taobao.tddl.optimizer.core.ast.query.JoinNode; //导入方法依赖的package包/类
@Test
public void test_两表join_orderby_groupby_limit条件() {
TableNode table = new TableNode("TABLE1");
JoinNode join = table.join("TABLE2", "ID", "ID");
join.select(OptimizerUtils.createColumnFromString("TABLE1.ID AS JID"),
OptimizerUtils.createColumnFromString("CONCAT(TABLE1.NAME,TABLE1.SCHOOL) AS JNAME"));
join.orderBy("JID");
join.groupBy("JNAME");
join.having("COUNT(JID) > 0");
IQueryTree qc = (IQueryTree) optimizer.optimizeAndAssignment(join, null, extraCmd);
Assert.assertTrue(qc instanceof IMerge);
Assert.assertEquals(QUERY_CONCURRENCY.CONCURRENT, ((IMerge) qc).getQueryConcurrency());// 串行
}