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

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

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

Join.getRight介绍

暂无

代码示例

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

private static boolean validJoinParent(RelNode joinNode, RelNode parent) {
 boolean validParent = true;
 if (parent instanceof Join) {
  // In Hive AST, right child of join cannot be another join,
  // thus we need to introduce a project on top of it.
  // But we only need the additional project if the left child
  // is another join too; if it is not, ASTConverter will swap
  // the join inputs, leaving the join operator on the left.
  // we also do it if parent is HiveSemiJoin since ASTConverter won't
  // swap inputs then
  // This will help triggering multijoin recognition methods that
  // are embedded in SemanticAnalyzer.
  if (((Join) parent).getRight() == joinNode &&
     (((Join) parent).getLeft() instanceof Join || parent instanceof HiveSemiJoin) ) {
   validParent = false;
  }
 } else if (parent instanceof SetOp) {
  validParent = false;
 }
 return validParent;
}

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

private static boolean validJoinParent(RelNode joinNode, RelNode parent) {
 boolean validParent = true;
 if (parent instanceof Join) {
  // In Hive AST, right child of join cannot be another join,
  // thus we need to introduce a project on top of it.
  // But we only need the additional project if the left child
  // is another join too; if it is not, ASTConverter will swap
  // the join inputs, leaving the join operator on the left.
  // This will help triggering multijoin recognition methods that
  // are embedded in SemanticAnalyzer.
  if (((Join) parent).getRight() == joinNode &&
     (((Join) parent).getLeft() instanceof Join) ) {
   validParent = false;
  }
 } else if (parent instanceof SetOp) {
  validParent = false;
 }
 return validParent;
}

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

final RelNode newRightInput = dispatchAlign(rel.getRight(), propagateCollationsRight.build());

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

public Double getSelectivity(Join j, RelMetadataQuery mq, RexNode predicate) {
 if (j.getJoinType().equals(JoinRelType.INNER)) {
  return computeInnerJoinSelectivity(j, mq, predicate);
 } else if (j.getJoinType().equals(JoinRelType.LEFT) ||
     j.getJoinType().equals(JoinRelType.RIGHT)) {
  double left = mq.getRowCount(j.getLeft());
  double right = mq.getRowCount(j.getRight());
  double product = left * right;
  double innerJoinSelectivity = computeInnerJoinSelectivity(j, mq, predicate);
  if (j.getJoinType().equals(JoinRelType.LEFT)) {
   return Math.max(innerJoinSelectivity, left/product);
  }
  return Math.max(innerJoinSelectivity, right/product);
 }
 return 1.0;
}

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

HiveRelMdDistinctRowCount.getDistinctRowCount(j.getRight(), mq, rjk));
}else if (j instanceof HiveJoin){
 ndvEstimate = Math.min(mq.getRowCount(j.getLeft())
   * mq.getRowCount(j.getRight()), ndvEstimate);
} else {
 throw new RuntimeException("Unexpected Join type: " + j.getClass().getName());

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

int nFieldsRight = joinRel.getRight().getRowType().getFieldList().size();
int nSysFields = joinRel.getSystemFieldList().size();
ImmutableBitSet rightFieldsBitSet = ImmutableBitSet.range(nSysFields + nFieldsLeft,

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

public Double getSelectivity(Join j, RelMetadataQuery mq, RexNode predicate) {
 if (j.getJoinType().equals(JoinRelType.INNER)) {
  return computeInnerJoinSelectivity(j, mq, predicate);
 } else if (j.getJoinType().equals(JoinRelType.LEFT) ||
     j.getJoinType().equals(JoinRelType.RIGHT)) {
  double left = mq.getRowCount(j.getLeft());
  double right = mq.getRowCount(j.getRight());
  double product = left * right;
  double innerJoinSelectivity = computeInnerJoinSelectivity(j, mq, predicate);
  if (j.getJoinType().equals(JoinRelType.LEFT)) {
   return Math.max(innerJoinSelectivity, left/product);
  }
  return Math.max(innerJoinSelectivity, right/product);
 }
 return 1.0;
}

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

int nFieldsRight = joinRel.getRight().getRowType().getFieldList().size();
int nSysFields = joinRel.getSystemFieldList().size();
ImmutableBitSet rightFieldsBitSet = ImmutableBitSet.range(nSysFields + nFieldsLeft,

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

this.isSemiJoin = isSemiJoin;
nFieldsLeft = joinRel.getLeft().getRowType().getFieldList().size();
nFieldsRight = joinRel.getRight().getRowType().getFieldList().size();
nSysFields = joinRel.getSystemFieldList().size();
leftFieldsBitSet = ImmutableBitSet.range(nSysFields,

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

private Project swapInputs(Join join, Project topProject, RelBuilder builder) {
 RexBuilder rexBuilder = join.getCluster().getRexBuilder();
 int rightInputSize = join.getRight().getRowType().getFieldCount();
 int leftInputSize = join.getLeft().getRowType().getFieldCount();
 List<RelDataTypeField> joinFields = join.getRowType().getFieldList();
 Join swappedJoin = (Join)builder.push(join.getRight()).push(join.getLeft()).join(join.getJoinType(),
                                          newJoinCond).build();

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

HiveRelMdDistinctRowCount.getDistinctRowCount(j.getRight(), mq, rjk));
}else if (j instanceof HiveJoin){
 ndvCrossProduct = Math.min(mq.getRowCount(j.getLeft())
   * mq.getRowCount(j.getRight()), ndvCrossProduct);
} else {
 throw new RuntimeException("Unexpected Join type: " + j.getClass().getName());

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

@Override
 public void onMatch(RelOptRuleCall call) {
  final Join join = call.rel(0);
  final RexBuilder rexBuilder = join.getCluster().getRexBuilder();
  final RexNode condition = RexUtil.pullFactors(rexBuilder, join.getCondition());
  RexNode newCondition = analyzeRexNode(rexBuilder, condition);
  // If we could not transform anything, we bail out
  if (newCondition.toString().equals(condition.toString())) {
   return;
  }
  RelNode newNode = join.copy(join.getTraitSet(),
    newCondition,
    join.getLeft(),
    join.getRight(),
    join.getJoinType(),
    join.isSemiJoinDone());
  call.transformTo(newNode);
 }
}

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

@Override public void onMatch(RelOptRuleCall call) {
  final Join topJoin= call.rel(0);
  final Join join = call.rel(2);
  final Aggregate aggregate = call.rel(6);

  // in presence of grouping sets we can't remove sq_count_check
  if(aggregate.indicator) {
   return;
  }
  if(isAggregateWithoutGbyKeys(aggregate) || isAggWithConstantGbyKeys(aggregate, call)) {
   // join(left, join.getRight)
   RelNode newJoin = HiveJoin.getJoin(topJoin.getCluster(), join.getLeft(),  topJoin.getRight(),
     topJoin.getCondition(), topJoin.getJoinType());
   call.transformTo(newJoin);
  }
 }
}

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

RelNode rightProjRel =
  pushProject.createProjectRefsAndExprs(
    join.getRight(),
    true,
    true);

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

final Join join = call.rel(0);
RelNode lChild = join.getLeft();
RelNode rChild = join.getRight();

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

if (null != leftChild && leftChild.equalsIgnoreCase(getTblAlias(((Join)rel).getRight()))) {

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

RexBuilder rB = join.getCluster().getRexBuilder();
RelNode lChild = join.getLeft();
RelNode rChild = join.getRight();

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

Join join = (Join) r;
QueryBlockInfo left = convertSource(join.getLeft());
QueryBlockInfo right = convertSource(join.getRight());
s = new Schema(left.schema, right.schema);
ASTNode cond = join.getCondition().accept(new RexVisitor(s, false, r.getCluster().getRexBuilder()));
boolean semiJoin = join instanceof SemiJoin;
if (join.getRight() instanceof Join && !semiJoin) {

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

final Join join = (Join) rel;
final MutableRel left = toMutable(join.getLeft());
final MutableRel right = toMutable(join.getRight());
return MutableJoin.of(join.getCluster(), left, right,
  join.getCondition(), join.getJoinType(), join.getVariablesSet());

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

RexBuilder rB = join.getCluster().getRexBuilder();
RelNode lChild = join.getLeft();
RelNode rChild = join.getRight();

相关文章