本文整理汇总了Java中org.apache.calcite.plan.RelOptUtil.projectMultiJoin方法的典型用法代码示例。如果您正苦于以下问题:Java RelOptUtil.projectMultiJoin方法的具体用法?Java RelOptUtil.projectMultiJoin怎么用?Java RelOptUtil.projectMultiJoin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.calcite.plan.RelOptUtil
的用法示例。
在下文中一共展示了RelOptUtil.projectMultiJoin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getProjectChild
import org.apache.calcite.plan.RelOptUtil; //导入方法依赖的package包/类
protected RelNode getProjectChild(
RelOptRuleCall call,
LogicalProject project,
boolean leftChild) {
// locate the appropriate MultiJoin based on which rule was fired
// and which projection we're dealing with
MultiJoin multiJoin;
if (leftChild) {
multiJoin = call.rel(2);
} else if (call.rels.length == 4) {
multiJoin = call.rel(3);
} else {
multiJoin = call.rel(4);
}
// create a new MultiJoin that reflects the columns in the projection
// above the MultiJoin
return RelOptUtil.projectMultiJoin(multiJoin, project);
}
示例2: onMatch
import org.apache.calcite.plan.RelOptUtil; //导入方法依赖的package包/类
public void onMatch(RelOptRuleCall call) {
LogicalProject project = call.rel(0);
MultiJoin multiJoin = call.rel(1);
// if all inputs have their projFields set, then projection information
// has already been pushed into each input
boolean allSet = true;
for (int i = 0; i < multiJoin.getInputs().size(); i++) {
if (multiJoin.getProjFields().get(i) == null) {
allSet = false;
break;
}
}
if (allSet) {
return;
}
// create a new MultiJoin that reflects the columns in the projection
// above the MultiJoin
final RelBuilder relBuilder = call.builder();
MultiJoin newMultiJoin =
RelOptUtil.projectMultiJoin(multiJoin, project);
relBuilder.push(newMultiJoin)
.project(project.getProjects(), project.getRowType().getFieldNames());
call.transformTo(relBuilder.build());
}