本文整理汇总了Java中org.apache.calcite.rel.logical.LogicalFilter.getCluster方法的典型用法代码示例。如果您正苦于以下问题:Java LogicalFilter.getCluster方法的具体用法?Java LogicalFilter.getCluster怎么用?Java LogicalFilter.getCluster使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.calcite.rel.logical.LogicalFilter
的用法示例。
在下文中一共展示了LogicalFilter.getCluster方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onMatch
import org.apache.calcite.rel.logical.LogicalFilter; //导入方法依赖的package包/类
public void onMatch(RelOptRuleCall call) {
final LogicalFilter filter = call.rel(0);
final LogicalProject project = call.rel(1);
final List<RexNode> newProjects = new ArrayList<>(project.getProjects());
newProjects.add(filter.getCondition());
final RelOptCluster cluster = filter.getCluster();
RelDataType newRowType =
cluster.getTypeFactory().builder()
.addAll(project.getRowType().getFieldList())
.add("condition", Util.last(newProjects).getType())
.build();
final RelNode newProject =
project.copy(project.getTraitSet(),
project.getInput(),
newProjects,
newRowType);
final RexInputRef newCondition =
cluster.getRexBuilder().makeInputRef(newProject,
newProjects.size() - 1);
call.transformTo(LogicalFilter.create(newProject, newCondition));
}
示例2: onMatch
import org.apache.calcite.rel.logical.LogicalFilter; //导入方法依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
LogicalFilter filter = call.rel(0);
RelTraitSet origTraitSet = filter.getTraitSet();
RelTraitSet traitSet = origTraitSet.replace(OLAPRel.CONVENTION).simplify();
OLAPFilterRel olapFilter = new OLAPFilterRel(filter.getCluster(), traitSet, convert(filter.getInput(), traitSet), filter.getCondition());
call.transformTo(olapFilter);
}
示例3: convert
import org.apache.calcite.rel.logical.LogicalFilter; //导入方法依赖的package包/类
public RelNode convert(LogicalFilter filter, CassandraTableScan scan) {
final RelTraitSet traitSet = filter.getTraitSet().replace(CassandraRel.CONVENTION);
final Pair<List<String>, List<String>> keyFields = scan.cassandraTable.getKeyFields();
return new CassandraFilter(
filter.getCluster(),
traitSet,
convert(filter.getInput(), CassandraRel.CONVENTION),
filter.getCondition(),
keyFields.left,
keyFields.right,
scan.cassandraTable.getClusteringOrder());
}