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

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

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

RelOptUtil.decomposeDisjunction介绍

[英]Decomposes a predicate into a list of expressions that are OR'ed together.
[中]将一个谓词分解为一系列被或组合在一起的表达式。

代码示例

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

/**
 * Returns a condition decomposed by OR.
 *
 * <p>For example, {@code disjunctions(FALSE)} returns the empty list.</p>
 */
public static List<RexNode> disjunctions(RexNode rexPredicate) {
 final List<RexNode> list = new ArrayList<>();
 decomposeDisjunction(rexPredicate, list);
 return list;
}

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

/**
 * Returns a condition decomposed by OR.
 *
 * <p>For example, {@code disjunctions(FALSE)} returns the empty list.</p>
 */
public static List<RexNode> disjunctions(RexNode rexPredicate) {
 final List<RexNode> list = new ArrayList<>();
 decomposeDisjunction(rexPredicate, list);
 return list;
}

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

/**
 * Decomposes a predicate into a list of expressions that are OR'ed
 * together.
 *
 * @param rexPredicate predicate to be analyzed
 * @param rexList      list of decomposed RexNodes
 */
public static void decomposeDisjunction(
  RexNode rexPredicate,
  List<RexNode> rexList) {
 if (rexPredicate == null || rexPredicate.isAlwaysFalse()) {
  return;
 }
 if (rexPredicate.isA(SqlKind.OR)) {
  for (RexNode operand : ((RexCall) rexPredicate).getOperands()) {
   decomposeDisjunction(operand, rexList);
  }
 } else {
  rexList.add(rexPredicate);
 }
}

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

/**
 * Decomposes a predicate into a list of expressions that are OR'ed
 * together.
 *
 * @param rexPredicate predicate to be analyzed
 * @param rexList      list of decomposed RexNodes
 */
public static void decomposeDisjunction(
  RexNode rexPredicate,
  List<RexNode> rexList) {
 if (rexPredicate == null || rexPredicate.isAlwaysFalse()) {
  return;
 }
 if (rexPredicate.isA(SqlKind.OR)) {
  for (RexNode operand : ((RexCall) rexPredicate).getOperands()) {
   decomposeDisjunction(operand, rexList);
  }
 } else {
  rexList.add(rexPredicate);
 }
}

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

case OR:
 final List<RexNode> ors = new ArrayList<>();
 decomposeDisjunction(e, ors);
 for (RexNode or : ors) {
  switch (or.getKind()) {

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

case OR:
 final List<RexNode> ors = new ArrayList<>();
 decomposeDisjunction(e, ors);
 for (RexNode or : ors) {
  switch (or.getKind()) {

相关文章

微信公众号

最新文章

更多

RelOptUtil类方法