org.apache.calcite.rel.core.Project.getPermutation()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(169)

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

Project.getPermutation介绍

[英]Returns a permutation, if this projection is merely a permutation of its input fields; otherwise null.
[中]如果此投影只是其输入字段的排列,则返回一个排列;否则为空。

代码示例

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

final Permutation topPermutation = topProject.getPermutation();
if (topPermutation == null) {
 return;
final Permutation bottomPermutation = bottomProject.getPermutation();
if (bottomPermutation == null) {
 return;

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

final Permutation topPermutation = topProject.getPermutation();
if (topPermutation == null) {
 return;
final Permutation bottomPermutation = bottomProject.getPermutation();
if (bottomPermutation == null) {
 return;

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

/**
 * Returns a permutation, if this projection is merely a permutation of its
 * input fields; otherwise null.
 *
 * @return Permutation, if this projection is merely a permutation of its
 *   input fields; otherwise null
 */
public Permutation getPermutation() {
 return getPermutation(getInput().getRowType().getFieldCount(), exps);
}

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

/**
 * Returns a permutation, if this projection is merely a permutation of its
 * input fields; otherwise null.
 *
 * @return Permutation, if this projection is merely a permutation of its
 *   input fields; otherwise null
 */
public Permutation getPermutation() {
 return getPermutation(getInput().getRowType().getFieldCount(), exps);
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

final Permutation topPermutation = topProject.getPermutation();
if (topPermutation == null) {
 return;
final Permutation bottomPermutation = bottomProject.getPermutation();
if (bottomPermutation == null) {
 return;

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

@Test public void testProjectPermutation() {
  final RelDataTypeFactory typeFactory = new JavaTypeFactoryImpl();
  final RexBuilder builder = new RexBuilder(typeFactory);
  final RelDataType doubleType =
    typeFactory.createSqlType(SqlTypeName.DOUBLE);

  // A project with [1, 1] is not a permutation, so should return null
  final Permutation perm = Project.getPermutation(2,
    ImmutableList.of(builder.makeInputRef(doubleType, 1),
      builder.makeInputRef(doubleType, 1)));
  assertThat(perm, nullValue());

  // A project with [0, 1, 0] is not a permutation, so should return null
  final Permutation perm1 = Project.getPermutation(2,
    ImmutableList.of(builder.makeInputRef(doubleType, 0),
      builder.makeInputRef(doubleType, 1),
      builder.makeInputRef(doubleType, 0)));
  assertThat(perm1, nullValue());

  // A project of [1, 0] is a valid permutation!
  final Permutation perm2 = Project.getPermutation(2,
    ImmutableList.of(builder.makeInputRef(doubleType, 1),
      builder.makeInputRef(doubleType, 0)));
  assertThat(perm2, is(new Permutation(new int[]{1, 0})));
 }
}

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

@Test public void testProjectPermutation() {
  final RelDataTypeFactory typeFactory = new JavaTypeFactoryImpl();
  final RexBuilder builder = new RexBuilder(typeFactory);
  final RelDataType doubleType =
    typeFactory.createSqlType(SqlTypeName.DOUBLE);

  // A project with [1, 1] is not a permutation, so should return null
  final Permutation perm = Project.getPermutation(2,
    ImmutableList.of(builder.makeInputRef(doubleType, 1),
      builder.makeInputRef(doubleType, 1)));
  assertThat(perm, nullValue());

  // A project with [0, 1, 0] is not a permutation, so should return null
  final Permutation perm1 = Project.getPermutation(2,
    ImmutableList.of(builder.makeInputRef(doubleType, 0),
      builder.makeInputRef(doubleType, 1),
      builder.makeInputRef(doubleType, 0)));
  assertThat(perm1, nullValue());

  // A project of [1, 0] is a valid permutation!
  final Permutation perm2 = Project.getPermutation(2,
    ImmutableList.of(builder.makeInputRef(doubleType, 1),
      builder.makeInputRef(doubleType, 0)));
  assertThat(perm2, is(new Permutation(new int[]{1, 0})));
 }
}

代码示例来源:origin: org.apache.kylin/atopcalcite

final RelNode relB = bottomJoin.getRight();
final RelOptCluster cluster = topJoin.getCluster();
final Permutation projectPermu = projectOnBottomJoin.getPermutation();
final Permutation inverseProjectPermu = projectPermu.inverse();

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

final Permutation topPermutation = topProject.getPermutation();
if (topPermutation != null) {
 if (topPermutation.isIdentity()) {
 final Permutation bottomPermutation = bottomProject.getPermutation();
 if (bottomPermutation != null) {
  if (bottomPermutation.isIdentity()) {

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

final Permutation topPermutation = topProject.getPermutation();
if (topPermutation != null) {
 if (topPermutation.isIdentity()) {
 final Permutation bottomPermutation = bottomProject.getPermutation();
 if (bottomPermutation != null) {
  if (bottomPermutation.isIdentity()) {

代码示例来源:origin: org.apache.drill.exec/drill-java-exec

final Permutation topPermutation = topProject.getPermutation();
if (topPermutation != null) {
 if (topPermutation.isIdentity()) {
 final Permutation bottomPermutation = bottomProject.getPermutation();
 if (bottomPermutation != null) {
  if (bottomPermutation.isIdentity()) {

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

final Permutation topPermutation = topProject.getPermutation();
if (topPermutation != null) {
 if (topPermutation.isIdentity()) {
 final Permutation bottomPermutation = bottomProject.getPermutation();
 if (bottomPermutation != null) {
  if (bottomPermutation.isIdentity()) {

相关文章