org.apache.calcite.plan.RelOptUtil.permute()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(80)

本文整理了Java中org.apache.calcite.plan.RelOptUtil.permute方法的一些代码示例,展示了RelOptUtil.permute的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RelOptUtil.permute方法的具体详情如下:
包路径:org.apache.calcite.plan.RelOptUtil
类名称:RelOptUtil
方法名:permute

RelOptUtil.permute介绍

[英]Creates a relational expression which permutes the output fields of a relational expression according to a permutation.

Optimizations:

  • If the relational expression is a org.apache.calcite.rel.logical.LogicalCalc or org.apache.calcite.rel.logical.LogicalProject that is already acting as a permutation, combines the new permutation with the old;
  • If the permutation is the identity, returns the original relational expression.

If a permutation is combined with its inverse, these optimizations would combine to remove them both.
[中]创建一个关系表达式,它根据排列排列关系表达式的输出字段。
优化:
*如果关系表达式是一个组织。阿帕奇。方解石雷尔。必然的LogicalCalc或org。阿帕奇。方解石雷尔。必然的已经作为置换的逻辑项目,将新置换与旧置换相结合;
*如果排列是标识,则返回原始关系表达式。
如果一个置换与它的逆置换相结合,这些优化将结合起来将两者都移除。

代码示例

代码示例来源:origin: apache/drill

/** Equivalent to
 * {@link RelOptUtil#createProject(org.apache.calcite.rel.RelNode, java.util.List)}
 * for {@link MutableRel}. */
public static MutableRel createProject(final MutableRel child,
  final List<Integer> posList) {
 final RelDataType rowType = child.getRowType();
 if (Mappings.isIdentity(posList, rowType.getFieldCount())) {
  return child;
 }
 return MutableProject.of(
   RelOptUtil.permute(child.cluster.getTypeFactory(), rowType,
     Mappings.bijection(posList)),
   child,
   new AbstractList<RexNode>() {
    public int size() {
     return posList.size();
    }
    public RexNode get(int index) {
     final int pos = posList.get(index);
     return RexInputRef.of(pos, rowType);
    }
   });
}

代码示例来源:origin: apache/hive

final RelDataType newRowType = RelOptUtil.permute(join.getCluster().getTypeFactory(),
    join.getRowType(), mapping);
final RelNode newJoin = new HiveMultiJoin(join.getCluster(),

代码示例来源:origin: apache/drill

final RelDataType newRowType = RelOptUtil.permute(join.getCluster().getTypeFactory(),
    join.getRowType(), mapping);
final RelNode newJoin = new HiveMultiJoin(join.getCluster(),

代码示例来源:origin: org.apache.calcite/calcite-core

/** Equivalent to
 * {@link RelOptUtil#createProject(org.apache.calcite.rel.RelNode, java.util.List)}
 * for {@link MutableRel}. */
public static MutableRel createProject(final MutableRel child,
  final List<Integer> posList) {
 final RelDataType rowType = child.rowType;
 if (Mappings.isIdentity(posList, rowType.getFieldCount())) {
  return child;
 }
 return MutableProject.of(
   RelOptUtil.permute(child.cluster.getTypeFactory(), rowType,
     Mappings.bijection(posList)),
   child,
   new AbstractList<RexNode>() {
    public int size() {
     return posList.size();
    }
    public RexNode get(int index) {
     final int pos = posList.get(index);
     return RexInputRef.of(pos, rowType);
    }
   });
}

代码示例来源:origin: Qihoo360/Quicksql

/** Equivalent to
 * {@link RelOptUtil#createProject(org.apache.calcite.rel.RelNode, java.util.List)}
 * for {@link MutableRel}. */
public static MutableRel createProject(final MutableRel child,
  final List<Integer> posList) {
 final RelDataType rowType = child.rowType;
 if (Mappings.isIdentity(posList, rowType.getFieldCount())) {
  return child;
 }
 return MutableProject.of(
   RelOptUtil.permute(child.cluster.getTypeFactory(), rowType,
     Mappings.bijection(posList)),
   child,
   new AbstractList<RexNode>() {
    public int size() {
     return posList.size();
    }
    public RexNode get(int index) {
     final int pos = posList.get(index);
     return RexInputRef.of(pos, rowType);
    }
   });
}

代码示例来源:origin: org.apache.calcite/calcite-core

RelOptUtil.permute(values.getCluster().getTypeFactory(), rowType,
    mapping);
final LogicalValues newValues =

代码示例来源:origin: Qihoo360/Quicksql

RelOptUtil.permute(values.getCluster().getTypeFactory(), rowType,
    mapping);
final LogicalValues newValues =

代码示例来源:origin: Qihoo360/Quicksql

if (permutation1 != null) {
 Permutation permutation2 = permutation.product(permutation1);
 return permute(rel, permutation2, null);
if (permutation1 != null) {
 Permutation permutation2 = permutation.product(permutation1);
 return permute(rel, permutation2, null);

代码示例来源:origin: org.apache.calcite/calcite-core

if (permutation1 != null) {
 Permutation permutation2 = permutation.product(permutation1);
 return permute(rel, permutation2, null);
if (permutation1 != null) {
 Permutation permutation2 = permutation.product(permutation1);
 return permute(rel, permutation2, null);

代码示例来源:origin: Qihoo360/Quicksql

RelOptUtil.permute(project.getCluster().getTypeFactory(), rowType,
  mapping);

代码示例来源:origin: org.apache.calcite/calcite-core

RelOptUtil.permute(project.getCluster().getTypeFactory(), rowType,
  mapping);

代码示例来源:origin: dremio/dremio-oss

final RelDataType newRowType = RelOptUtil.permute(window.getCluster().getTypeFactory(), rowType, permutationMapping);

相关文章

微信公众号

最新文章

更多

RelOptUtil类方法