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

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

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

RelOptUtil.equal介绍

[英]Returns whether two types are equal using #areRowTypesEqual(RelDataType,RelDataType,boolean). Both types must not be null.
[中]使用#areRowTypesEqual(RelDataType、RelDataType、boolean)返回两个类型是否相等。两种类型都不能为null。

代码示例

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

/** Returns whether two relational expressions have the same row-type. */
public static boolean equalType(String desc0, MutableRel rel0, String desc1,
  MutableRel rel1, Litmus litmus) {
 return RelOptUtil.equal(desc0, rel0.getRowType(),
   desc1, rel1.getRowType(), litmus);
}

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

/** Returns whether two relational expressions have the same row-type. */
public static boolean equalType(String desc0, MutableRel rel0, String desc1,
  MutableRel rel1, Litmus litmus) {
 return RelOptUtil.equal(desc0, rel0.rowType, desc1, rel1.rowType, litmus);
}

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

/** Returns whether two relational expressions have the same row-type. */
public static boolean equalType(String desc0, MutableRel rel0, String desc1,
  MutableRel rel1, Litmus litmus) {
 return RelOptUtil.equal(desc0, rel0.rowType, desc1, rel1.rowType, litmus);
}

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

/** Returns whether two relational expressions have the same row-type. */
public static boolean equalType(String desc0, RelNode rel0, String desc1,
  RelNode rel1, Litmus litmus) {
 // TODO: change 'equal' to 'eq', which is stronger.
 return equal(desc0, rel0.getRowType(), desc1, rel1.getRowType(), litmus);
}

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

/** Returns whether two relational expressions have the same row-type. */
public static boolean equalType(String desc0, RelNode rel0, String desc1,
  RelNode rel1, Litmus litmus) {
 // TODO: change 'equal' to 'eq', which is stronger.
 return equal(desc0, rel0.getRowType(), desc1, rel1.getRowType(), litmus);
}

代码示例来源:origin: tzolov/calcite-sql-rewriter

);
RelOptUtil.equal(
    "RowType of original", p.getRowType(),
    "RowType of replaced", updated.getRowType(),

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

public RelNode onRegister(RelOptPlanner planner) {
 List<RelNode> oldInputs = getInputs();
 List<RelNode> inputs = new ArrayList<>(oldInputs.size());
 for (final RelNode input : oldInputs) {
  RelNode e = planner.ensureRegistered(input, null);
  if (e != input) {
   // TODO: change 'equal' to 'eq', which is stronger.
   assert RelOptUtil.equal(
     "rowtype of rel before registration",
     input.getRowType(),
     "rowtype of rel after registration",
     e.getRowType(),
     Litmus.THROW);
  }
  inputs.add(e);
 }
 RelNode r = this;
 if (!Util.equalShallow(oldInputs, inputs)) {
  r = copy(getTraitSet(), inputs);
 }
 r.recomputeDigest();
 assert r.isValid(Litmus.THROW, null);
 return r;
}

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

public RelNode onRegister(RelOptPlanner planner) {
 List<RelNode> oldInputs = getInputs();
 List<RelNode> inputs = new ArrayList<>(oldInputs.size());
 for (final RelNode input : oldInputs) {
  RelNode e = planner.ensureRegistered(input, null);
  if (e != input) {
   // TODO: change 'equal' to 'eq', which is stronger.
   assert RelOptUtil.equal(
     "rowtype of rel before registration",
     input.getRowType(),
     "rowtype of rel after registration",
     e.getRowType(),
     Litmus.THROW);
  }
  inputs.add(e);
 }
 RelNode r = this;
 if (!Util.equalShallow(oldInputs, inputs)) {
  r = copy(getTraitSet(), inputs);
 }
 r.recomputeDigest();
 assert r.isValid(Litmus.THROW, null);
 return r;
}

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

public RelSubset register(
  RelNode rel,
  RelNode equivRel) {
 assert !isRegistered(rel) : "pre: isRegistered(rel)";
 final RelSet set;
 if (equivRel == null) {
  set = null;
 } else {
  assert RelOptUtil.equal(
    "rel rowtype",
    rel.getRowType(),
    "equivRel rowtype",
    equivRel.getRowType(),
    Litmus.THROW);
  set = getSet(equivRel);
 }
 final RelSubset subset = registerImpl(rel, set);
 // Checking if tree is valid considerably slows down planning
 // Only doing it if logger level is debug or finer
 if (LOGGER.isDebugEnabled()) {
  assert isValid(Litmus.THROW);
 }
 return subset;
}

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

public RelSubset register(
  RelNode rel,
  RelNode equivRel) {
 assert !isRegistered(rel) : "pre: isRegistered(rel)";
 final RelSet set;
 if (equivRel == null) {
  set = null;
 } else {
  assert RelOptUtil.equal(
    "rel rowtype",
    rel.getRowType(),
    "equivRel rowtype",
    equivRel.getRowType(),
    Litmus.THROW);
  set = getSet(equivRel);
 }
 final RelSubset subset = registerImpl(rel, set);
 // Checking if tree is valid considerably slows down planning
 // Only doing it if logger level is debug or finer
 if (LOGGER.isDebugEnabled()) {
  assert isValid(Litmus.THROW);
 }
 return subset;
}

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

RelOptUtil.equal("rowtype of new rel", rel.getRowType(),
  "rowtype of set", getRowType(), Litmus.THROW);

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

RelOptUtil.equal("rowtype of new rel", rel.getRowType(),
  "rowtype of set", getRowType(), Litmus.THROW);

代码示例来源:origin: org.apache.flink/flink-table_2.10

validator.getTypeFactory().createStructType(convertedFields);
if (!RelOptUtil.equal("validated row type", validatedRowType,
  "converted row type", convertedRowType, Litmus.IGNORE)) {
  throw new AssertionError("Conversion to relational algebra failed to "

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

validator.getTypeFactory().createStructType(convertedFields);
if (!RelOptUtil.equal("validated row type", validatedRowType,
  "converted row type", convertedRowType, Litmus.IGNORE)) {
 throw new AssertionError("Conversion to relational algebra failed to "

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

validator.getTypeFactory().createStructType(convertedFields);
if (!RelOptUtil.equal("validated row type", validatedRowType,
  "converted row type", convertedRowType, Litmus.IGNORE)) {
 throw new AssertionError("Conversion to relational algebra failed to "

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

validator.getTypeFactory().createStructType(convertedFields);
if (!RelOptUtil.equal("validated row type", validatedRowType,
  "converted row type", convertedRowType, Litmus.IGNORE)) {
 throw new AssertionError("Conversion to relational algebra failed to "

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

public boolean isValid(Litmus litmus, Context context) {
 if (!RelOptUtil.equal(
   "program's input type",
   program.getInputRowType(),
   "child's output type",
   getInput().getRowType(), litmus)) {
  return litmus.fail(null);
 }
 if (!program.isValid(litmus, context)) {
  return litmus.fail(null);
 }
 if (!program.isNormalized(litmus, getCluster().getRexBuilder())) {
  return litmus.fail(null);
 }
 return litmus.succeed();
}

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

public boolean isValid(Litmus litmus, Context context) {
 if (!RelOptUtil.equal(
   "program's input type",
   program.getInputRowType(),
   "child's output type",
   getInput().getRowType(), litmus)) {
  return litmus.fail(null);
 }
 if (!program.isValid(litmus, context)) {
  return litmus.fail(null);
 }
 if (!program.isNormalized(litmus, getCluster().getRexBuilder())) {
  return litmus.fail(null);
 }
 return litmus.succeed();
}

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

Assert.assertTrue(
  msg2,
  RelOptUtil.equal(
    "origRelType", origRelType,
    "mutableRelType", mutableRelType,

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

Assert.assertTrue(
  msg2,
  RelOptUtil.equal(
    "origRelType", origRelType,
    "mutableRelType", mutableRelType,

相关文章

微信公众号

最新文章

更多

RelOptUtil类方法