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

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

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

Join.getLeft介绍

暂无

代码示例

代码示例来源: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

int rightOffSet = j.getLeft().getRowType().getFieldCount();
   HiveRelMdDistinctRowCount.getDistinctRowCount(j.getLeft(), mq, ljk));
  ndvEstimate = Math.min(mq.getRowCount(j.getLeft()),
    ndvEstimate);
 }else if (j instanceof HiveJoin){
  ndvEstimate = Math.min(mq.getRowCount(j.getLeft())

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

.builder();
ImmutableMap<Integer, Double> colStatMap;
int rightOffSet = j.getLeft().getRowType().getFieldCount();
   HiveRelMdDistinctRowCount.getDistinctRowCount(j.getLeft(), mq, ljk));
  ndvCrossProduct = Math.min(mq.getRowCount(j.getLeft()),
    ndvCrossProduct);
 }else if (j instanceof HiveJoin){
  ndvCrossProduct = Math.min(mq.getRowCount(j.getLeft())

代码示例来源: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

int nFieldsLeft = joinRel.getLeft().getRowType().getFieldList().size();
int nFieldsRight = joinRel.getRight().getRowType().getFieldList().size();
int nSysFields = joinRel.getSystemFieldList().size();

代码示例来源: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 nFieldsLeft = joinRel.getLeft().getRowType().getFieldList().size();
int nFieldsRight = joinRel.getRight().getRowType().getFieldList().size();
int nSysFields = joinRel.getSystemFieldList().size();

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

int nullIndicatorPos) {
final RelDataTypeFactory typeFactory = join.getCluster().getTypeFactory();
final RelNode left = join.getLeft();
final JoinRelType joinType = join.getJoinType();

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

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/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

introduceDerivedTable(rel, parent);
String leftChild = getTblAlias(((Join)rel).getLeft());
if (null != leftChild && leftChild.equalsIgnoreCase(getTblAlias(((Join)rel).getRight()))) {
 introduceDerivedTable(((Join)rel).getLeft(), rel);

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

join.getLeft(),
true,
false);

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

@Override
public void onMatch(RelOptRuleCall call) {
 final Join join = call.rel(0);
 RelNode lChild = join.getLeft();
 RelNode rChild = join.getRight();

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

assert registry != null;
RexBuilder rB = join.getCluster().getRexBuilder();
RelNode lChild = join.getLeft();
RelNode rChild = join.getRight();

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

ImmutableBitSet.range(0, join.getLeft().getRowType().getFieldCount());

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

final MutableRel left = toMutable(join.getLeft());
final MutableRel right = toMutable(join.getRight());
return MutableJoin.of(join.getCluster(), left, right,

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

assert registry != null;
RexBuilder rB = join.getCluster().getRexBuilder();
RelNode lChild = join.getLeft();
RelNode rChild = join.getRight();

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

} else if (r instanceof Join) {
 Join join = (Join) r;
 QueryBlockInfo left = convertSource(join.getLeft());
 QueryBlockInfo right = convertSource(join.getRight());
 s = new Schema(left.schema, right.schema);

相关文章