public static JoinPredicateInfo constructJoinPredicateInfo(Join j) throws CalciteSemanticException { return constructJoinPredicateInfo(j, j.getCondition()); }
public static JoinPredicateInfo constructJoinPredicateInfo(Join j) throws CalciteSemanticException { return constructJoinPredicateInfo(j, j.getCondition()); }
/** * * @param j * @param additionalPredicate * @return if predicate is the join condition return (true, joinCond) * else return (false, minusPred) */ private Pair<Boolean,RexNode> getCombinedPredicateForJoin(Join j, RexNode additionalPredicate) { RexNode minusPred = RelMdUtil.minusPreds(j.getCluster().getRexBuilder(), additionalPredicate, j.getCondition()); if (minusPred != null) { List<RexNode> minusList = new ArrayList<RexNode>(); minusList.add(j.getCondition()); minusList.add(minusPred); return new Pair<Boolean,RexNode>(false, minusPred); } return new Pair<Boolean,RexNode>(true,j.getCondition()); }
/** * * @param j * @param additionalPredicate * @return if predicate is the join condition return (true, joinCond) * else return (false, minusPred) */ private Pair<Boolean,RexNode> getCombinedPredicateForJoin(Join j, RexNode additionalPredicate) { RexNode minusPred = RelMdUtil.minusPreds(j.getCluster().getRexBuilder(), additionalPredicate, j.getCondition()); if (minusPred != null) { List<RexNode> minusList = new ArrayList<RexNode>(); minusList.add(j.getCondition()); minusList.add(minusPred); return new Pair<Boolean,RexNode>(false, minusPred); } return new Pair<Boolean,RexNode>(true,j.getCondition()); }
@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; }
@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; }
@Override public boolean matches(RelOptRuleCall call) { final Join join = call.rel(0); final HiveJdbcConverter conv1 = call.rel(1); final HiveJdbcConverter conv2 = call.rel(2); if (!conv1.getJdbcDialect().equals(conv2.getJdbcDialect())) { return false; } return JDBCAbstractSplitFilterRule.canSplitFilter(join.getCondition(), conv1.getJdbcDialect()); }
rightFrame.r, decorrelateExpr(rel.getCondition()), rel.getJoinType());
@Override public boolean matches(RelOptRuleCall call) { Filter filter = call.rel(0); Join join = call.rel(1); HiveJdbcConverter conv1 = call.rel(2); HiveJdbcConverter conv2 = call.rel(3); if (!conv1.getJdbcDialect().equals(conv2.getJdbcDialect())) { return false; } boolean visitorRes = JDBCRexCallValidator.isValidJdbcOperation(filter.getCondition(), conv1.getJdbcDialect()); if (visitorRes) { return JDBCRexCallValidator.isValidJdbcOperation(join.getCondition(), conv1.getJdbcDialect()); } return false; }
new PushProjector( origProj, join.getCondition(), join, preserveExprCondition, if (join.getCondition() != null) { List<RelDataTypeField> projJoinFieldList = new ArrayList<>(); projJoinFieldList.addAll( newJoinFilter = pushProject.convertRefsAndExprs( join.getCondition(), projJoinFieldList, adjustments);
List<RexNode> exprs = RelOptUtil.conjunctions( compose(rexBuilder, ImmutableList.of(joinRel.getCondition())));
@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); } }
@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); } } }
if (join.getCondition().isAlwaysTrue()) { return; Join newJoin = join.copy(join.getTraitSet(), join.getCondition(), lChild, rChild, join.getJoinType(), join.isSemiJoinDone()); call.getPlanner().onCopy(join, newJoin);
RexNode newJoinCond = join.getCondition().accept(new RelOptUtil.RexInputConverter(rexBuilder, joinFields, joinFields, condAdjustments)); Join swappedJoin = (Join)builder.push(join.getRight()).push(join.getLeft()).join(join.getJoinType(),
RelNode newRel = join.copy(join.getTraitSet(), join.getCondition(), lChild, rChild, join.getJoinType(), join.isSemiJoinDone()); call.getPlanner().onCopy(join, newRel);
final MutableRel right = toMutable(join.getRight()); return MutableJoin.of(join.getCluster(), left, right, join.getCondition(), join.getJoinType(), join.getVariablesSet());
RelNode newRel = join.copy(join.getTraitSet(), join.getCondition(), lChild, rChild, join.getJoinType(), join.isSemiJoinDone()); call.getPlanner().onCopy(join, newRel);
QueryBlockInfo right = convertSource(join.getRight()); s = new Schema(left.schema, right.schema); ASTNode cond = join.getCondition().accept(new RexVisitor(s)); boolean semiJoin = join instanceof SemiJoin; if (join.getRight() instanceof Join && !semiJoin) {
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) {