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

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

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

RelOptUtil.decomposeConjunction介绍

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

代码示例

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

RelOptUtil.decomposeConjunction(e, disjunctions, notDisjunctions);

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

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

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

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

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

/** Splits this program into a list of project expressions and a list of
 * filter expressions.
 *
 * <p>Neither list is null.
 * The filters are evaluated first. */
public Pair<ImmutableList<RexNode>, ImmutableList<RexNode>> split() {
 final List<RexNode> filters = new ArrayList<>();
 if (condition != null) {
  RelOptUtil.decomposeConjunction(expandLocalRef(condition), filters);
 }
 final ImmutableList.Builder<RexNode> projects = ImmutableList.builder();
 for (RexLocalRef project : this.projects) {
  projects.add(expandLocalRef(project));
 }
 return Pair.of(projects.build(), ImmutableList.copyOf(filters));
}

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

/** Splits this program into a list of project expressions and a list of
 * filter expressions.
 *
 * <p>Neither list is null.
 * The filters are evaluated first. */
public Pair<ImmutableList<RexNode>, ImmutableList<RexNode>> split() {
 final List<RexNode> filters = new ArrayList<>();
 if (condition != null) {
  RelOptUtil.decomposeConjunction(expandLocalRef(condition), filters);
 }
 final ImmutableList.Builder<RexNode> projects = ImmutableList.builder();
 for (RexLocalRef project : this.projects) {
  projects.add(expandLocalRef(project));
 }
 return Pair.of(projects.build(), ImmutableList.copyOf(filters));
}

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

RexNode simplifyAnds(Iterable<? extends RexNode> nodes,
  RexUnknownAs unknownAs) {
 final List<RexNode> terms = new ArrayList<>();
 final List<RexNode> notTerms = new ArrayList<>();
 for (RexNode e : nodes) {
  RelOptUtil.decomposeConjunction(e, terms, notTerms);
 }
 simplifyList(terms, UNKNOWN);
 simplifyList(notTerms, UNKNOWN);
 if (unknownAs == FALSE) {
  return simplifyAnd2ForUnknownAsFalse(terms, notTerms);
 }
 return simplifyAnd2(terms, notTerms);
}

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

RexNode simplifyAnds(Iterable<? extends RexNode> nodes,
  RexUnknownAs unknownAs) {
 final List<RexNode> terms = new ArrayList<>();
 final List<RexNode> notTerms = new ArrayList<>();
 for (RexNode e : nodes) {
  RelOptUtil.decomposeConjunction(e, terms, notTerms);
 }
 simplifyList(terms, UNKNOWN);
 simplifyList(notTerms, UNKNOWN);
 if (unknownAs == FALSE) {
  return simplifyAnd2ForUnknownAsFalse(terms, notTerms);
 }
 return simplifyAnd2(terms, notTerms);
}

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

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

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

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

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

RexNode simplifyAnd(RexCall e, RexUnknownAs unknownAs) {
 final List<RexNode> terms = new ArrayList<>();
 final List<RexNode> notTerms = new ArrayList<>();
 RelOptUtil.decomposeConjunction(e, terms, notTerms);
 if (unknownAs == FALSE && predicateElimination) {
  simplifyAndTerms(terms);
 } else {
  simplifyList(terms, unknownAs);
 }
 simplifyList(notTerms, UNKNOWN); // TODO could be unknownAs.negate()?
 switch (unknownAs) {
 case FALSE:
  return simplifyAnd2ForUnknownAsFalse(terms, notTerms, Comparable.class);
 }
 return simplifyAnd2(terms, notTerms);
}

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

RexNode simplifyAnd(RexCall e, RexUnknownAs unknownAs) {
 final List<RexNode> terms = new ArrayList<>();
 final List<RexNode> notTerms = new ArrayList<>();
 RelOptUtil.decomposeConjunction(e, terms, notTerms);
 if (unknownAs == FALSE && predicateElimination) {
  simplifyAndTerms(terms);
 } else {
  simplifyList(terms, unknownAs);
 }
 simplifyList(notTerms, UNKNOWN); // TODO could be unknownAs.negate()?
 switch (unknownAs) {
 case FALSE:
  return simplifyAnd2ForUnknownAsFalse(terms, notTerms, Comparable.class);
 }
 return simplifyAnd2(terms, notTerms);
}

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

RelOptUtil.decomposeConjunction(e, disjunctions, notDisjunctions);

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

RelOptUtil.decomposeConjunction(e, disjunctions, notDisjunctions);

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

case AND:
 for (RexNode operand : ((RexCall) rexPredicate).getOperands()) {
  decomposeConjunction(operand, rexList, notList);

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

case AND:
 for (RexNode operand : ((RexCall) rexPredicate).getOperands()) {
  decomposeConjunction(operand, rexList, notList);

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

RelOptUtil.decomposeConjunction(outerJoinCond, ojFilters);
int numFields = multiJoin.getNumFieldsInJoinFactor(factIdx);
final ImmutableBitSet.Builder joinKeyBuilder =

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

RelOptUtil.decomposeConjunction(outerJoinCond, ojFilters);
int numFields = multiJoin.getNumFieldsInJoinFactor(factIdx);
final ImmutableBitSet.Builder joinKeyBuilder =

相关文章

微信公众号

最新文章

更多

RelOptUtil类方法