本文整理汇总了Java中org.apache.calcite.rel.core.Sort.getTraitSet方法的典型用法代码示例。如果您正苦于以下问题:Java Sort.getTraitSet方法的具体用法?Java Sort.getTraitSet怎么用?Java Sort.getTraitSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.calcite.rel.core.Sort
的用法示例。
在下文中一共展示了Sort.getTraitSet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onMatch
import org.apache.calcite.rel.core.Sort; //导入方法依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
final Sort sort = call.rel(0);
if (sort.offset == null && sort.fetch == null) {
return;
}
RelTraitSet origTraitSet = sort.getTraitSet();
RelTraitSet traitSet = origTraitSet.replace(OLAPRel.CONVENTION).simplify();
RelNode input = sort.getInput();
if (!sort.getCollation().getFieldCollations().isEmpty()) {
// Create a sort with the same sort key, but no offset or fetch.
input = sort.copy(sort.getTraitSet(), input, sort.getCollation(), null, null);
}
RelNode x = convert(input, input.getTraitSet().replace(OLAPRel.CONVENTION));
call.transformTo(new OLAPLimitRel(sort.getCluster(), traitSet, x, sort.offset, sort.fetch));
}
示例2: onMatch
import org.apache.calcite.rel.core.Sort; //导入方法依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
final Sort incomingSort = call.rel(0);
final RelTraitSet incomingTraits = incomingSort.getTraitSet();
RelNode input = incomingSort.getInput();
// if the Optiq sort rel includes a collation and a limit, we need to create a copy the sort rel that excludes the
// limit information.
if (!incomingSort.getCollation().getFieldCollations().isEmpty()) {
input = incomingSort.copy(incomingTraits, input, incomingSort.getCollation(), null, null);
}
RelNode convertedInput = convert(input, input.getTraitSet().plus(DrillRel.DRILL_LOGICAL));
call.transformTo(new DrillLimitRel(incomingSort.getCluster(), convertedInput.getTraitSet().plus(DrillRel.DRILL_LOGICAL), convertedInput, incomingSort.offset, incomingSort.fetch));
}
示例3: onMatch
import org.apache.calcite.rel.core.Sort; //导入方法依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
final Sort incomingSort = call.rel(0);
final RelTraitSet incomingTraits = incomingSort.getTraitSet();
RelNode input = incomingSort.getInput();
// if the calcite sort rel includes a collation and a limit, we need to create a copy the sort rel that excludes the
// limit information.
if (!incomingSort.getCollation().getFieldCollations().isEmpty()) {
input = incomingSort.copy(incomingTraits, input, incomingSort.getCollation(), null, null);
}
RelNode convertedInput = convert(input, input.getTraitSet().plus(Rel.LOGICAL).simplify());
call.transformTo(new LimitRel(incomingSort.getCluster(), convertedInput.getTraitSet().plus(Rel.LOGICAL), convertedInput, incomingSort.offset, incomingSort.fetch));
}