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

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

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

RelOptUtil.conjunctions介绍

[英]Returns a condition decomposed by AND.

For example, conjunctions(TRUE) returns the empty list; conjunctions(FALSE) returns list {FALSE}}.
[中]返回由和分解的条件。
例如,conjunctions(TRUE)返回空列表;连接词(FALSE)返回列表{FALSE}。

代码示例

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

public ConstraintGroup(RexNode rexNode) {
 originalRexNode = rexNode;
 final List<RexNode> conjunctions = RelOptUtil.conjunctions(rexNode);
 for (RexNode n : conjunctions) {
  Constraint c = Constraint.of(n);
  if (c == null) {
   // interpretation failed; make this node opaque
   key = Collections.emptySet();
   return;
  }
  constraints.put(c.getKey(), c);
 }
 if (constraints.size() != conjunctions.size()) {
  LOG.debug("unexpected situation; giving up on this branch");
  key = Collections.emptySet();
  return;
 }
 key = constraints.keySet();
}

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

conjuctiveElements = RelOptUtil.conjunctions(predicate);

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

@Override
public boolean matches(RelOptRuleCall call) {
 Join join = call.rel(0);
 List<RexNode> joinConds = RelOptUtil.conjunctions(join.getCondition());
 for (RexNode joinCnd : joinConds) {
  if (!HiveCalciteUtil.isDeterministic(joinCnd)) {
   return false;
  }
 }
 return true;
}

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

for (RexNode pred : mq.getPulledUpPredicates(inp).pulledUpPredicates) {
 predicatesInSubtree.add(pred.toString());
 predicatesInSubtree.addAll(Lists.transform(RelOptUtil.conjunctions(pred), REX_STR_FN));

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

@Override
public boolean matches(RelOptRuleCall call) {
 Join join = call.rel(0);
 List<RexNode> joinConds = RelOptUtil.conjunctions(join.getCondition());
 for (RexNode joinCnd : joinConds) {
  if (!HiveCalciteUtil.isDeterministic(joinCnd)) {
   return false;
  }
 }
 return true;
}

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

final List<RexNode> conjunctions = RelOptUtil.conjunctions(operandCNF);

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

@SuppressWarnings("incomplete-switch")
private static List<RexNode> rewriteProjects(List<RexNode> projects,
    RexNode newPushedCondition, RelBuilder relBuilder) {
 final List<RexNode> conjunctions = RelOptUtil.conjunctions(newPushedCondition);
 final Map<String, RexNode> conditions = new HashMap<String, RexNode>();
 for (RexNode conjunction: conjunctions) {

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

for(RexNode pred : RelOptUtil.conjunctions(condition)) {
 if (first) {
  sb.append(convertRexToString(pred, rowType));

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

List<ExprNodeDesc> filterExpressionsForInput = new ArrayList<ExprNodeDesc>();
if (joinFilters.get(i) != null) {
 for (RexNode conj : RelOptUtil.conjunctions(joinFilters.get(i))) {
  ExprNodeDesc expr = convertToExprNode(conj, joinRel, null, newVcolsInCalcite);
  filterExpressionsForInput.add(expr);

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

RelOptUtil.conjunctions(notDisjunction);
if (disjunctions.containsAll(disjunctions2)) {
 return false;

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

for (RexNode pred : RelMetadataQuery.instance().getPulledUpPredicates(inp).pulledUpPredicates) {
 predicatesInSubtree.add(pred.toString());
 predicatesInSubtree.addAll(Lists.transform(RelOptUtil.conjunctions(pred), REX_STR_FN));

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

for (RexNode conj : RelOptUtil.conjunctions(rel.getCondition())) {
 if (conj.getKind() != SqlKind.EQUALS) {
  otherConjuncts.add(conj);

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

private boolean addBaseConditions(RexNode condition, StatisticsPayload payload, boolean redundant,
  Map<String, Double> baseConditionMap, RelDataType rowType) {
 boolean res = redundant;
 if (condition.getKind() == SqlKind.AND) {
  for(RexNode pred : RelOptUtil.conjunctions(condition)) {
   res = addBaseConditions(pred, payload, res, baseConditionMap, rowType);
  }
 } else if (condition.getKind() == SqlKind.OR) {
  for(RexNode pred : RelOptUtil.disjunctions(condition)) {
   res = addBaseConditions(pred, payload, res, baseConditionMap, rowType);
  }
 } else {
  // base condition
  String conditionAsStr = convertRexToString(condition, rowType);
  if (!redundant) {
   baseConditionMap.put(conditionAsStr, payload.getRowCount());
   return true;
  } else {
   baseConditionMap.put(conditionAsStr, -1.0);
   return false;
  }
 }
 return res;
}
/*

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

new RexPermuteInputsShuttle(leftMapping, joinRel.getInput(0)));
for (RexNode r : RelOptUtil.conjunctions(leftChildPredicates)) {
 exprFields.put(r.toString(), RelOptUtil.InputFinder.bits(r));
 allExprsDigests.add(r.toString());
  new RexPermuteInputsShuttle(rightMapping, joinRel.getInput(1)));
for (RexNode r : RelOptUtil.conjunctions(rightChildPredicates)) {
 exprFields.put(r.toString(), RelOptUtil.InputFinder.bits(r));
 allExprsDigests.add(r.toString());
 RelOptUtil.conjunctions(
   compose(rexBuilder, ImmutableList.of(joinRel.getCondition())));

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

new RexPermuteInputsShuttle(leftMapping, joinRel.getInput(0)));
for (RexNode r : RelOptUtil.conjunctions(leftChildPredicates)) {
 exprFields.put(r.toString(), RelOptUtil.InputFinder.bits(r));
 allExprsDigests.add(r.toString());
  new RexPermuteInputsShuttle(rightMapping, joinRel.getInput(1)));
for (RexNode r : RelOptUtil.conjunctions(rightChildPredicates)) {
 exprFields.put(r.toString(), RelOptUtil.InputFinder.bits(r));
 allExprsDigests.add(r.toString());
 RelOptUtil.conjunctions(
   compose(rexBuilder, ImmutableList.of(joinRel.getCondition())));

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

private RexNode convertToStatsCondition(RexNode condition, IndexDescriptor index,
  IndexCallContext context, RelNode scanRel, List<SqlKind>typesToProcess) {
 RexBuilder builder = scanRel.getCluster().getRexBuilder();
 if (condition.getKind() == SqlKind.AND) {
  final List<RexNode> conditions = Lists.newArrayList();
  for(RexNode pred : RelOptUtil.conjunctions(condition)) {
   conditions.add(convertToStatsCondition(pred, index, context, scanRel, typesToProcess));
  }
  return RexUtil.composeConjunction(builder, conditions, false);
 } else if (condition.getKind() == SqlKind.OR) {
  final List<RexNode> conditions = Lists.newArrayList();
  for(RexNode pred : RelOptUtil.disjunctions(condition)) {
   conditions.add(convertToStatsCondition(pred, index, context, scanRel, typesToProcess));
  }
  return RexUtil.composeDisjunction(builder, conditions, false);
 } else if (condition instanceof RexCall) {
  // LIKE operator - convert to a RANGE predicate, if possible
  if (typesToProcess.contains(SqlKind.LIKE)
    && ((RexCall) condition).getOperator().getKind() == SqlKind.LIKE) {
   return convertLikeToRange((RexCall)condition, builder);
  } else if (typesToProcess.contains(SqlKind.CAST)
    && hasCastExpression(condition)) {
   return convertCastForFIdx(((RexCall) condition), index, context, scanRel);
  }
  else {
   return condition;
  }
 }
 return condition;
}

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

for (RexNode ce : RelOptUtil.conjunctions(origFilterCond)) {
 RexNode newCondition = RelOptUtil.pushPastProject(ce, origproject);
 if (HiveCalciteUtil.isDeterministicFuncWithSingleInputRef(newCondition,

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

for (RexNode ce : RelOptUtil.conjunctions(origFilterCond)) {
 RexNode newCondition = RelOptUtil.pushPastProject(ce, origproject);
 if (HiveCalciteUtil.isDeterministicFuncWithSingleInputRef(newCondition,

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

final List<RexNode> condConjs = RelOptUtil.conjunctions(
  join.getCondition());

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

@SuppressWarnings("incomplete-switch")
private static List<RexNode> rewriteProjects(List<RexNode> projects,
    RexNode newPushedCondition, RelBuilder relBuilder) {
 final List<RexNode> conjunctions = RelOptUtil.conjunctions(newPushedCondition);
 final Map<String, RexNode> conditions = new HashMap<String, RexNode>();
 for (RexNode conjunction: conjunctions) {

相关文章

微信公众号

最新文章

更多

RelOptUtil类方法