if (RelOptUtil.getVariablesUsed(right).size() > 0) { return; } else if (cm.mapRefRelToCorRef.containsKey(aggInputProject)) { if (RelOptUtil.getVariablesUsed(right).size() > 0) { return;
if (RelOptUtil.getVariablesUsed(right).size() > 0) { return; } else if (cm.mapRefRelToCorRef.containsKey(project)) { if (RelOptUtil.getVariablesUsed(right).size() > 0) { return;
if (RelOptUtil.getVariablesUsed(right).size() > 0) { return; } else if (cm.mapRefRelToCorRef.containsKey(project)) { if (RelOptUtil.getVariablesUsed(right).size() > 0) { return;
if (RelOptUtil.getVariablesUsed(right).size() > 0) { return; } else if (cm.mapRefRelToCorRef.containsKey(aggInputProject)) { if (RelOptUtil.getVariablesUsed(right).size() > 0) { return;
@Deprecated // to be removed before 2.0 public static List<CorrelationId> getVariablesSetAndUsed(RelNode rel0, RelNode rel1) { Set<CorrelationId> set = getVariablesSet(rel0); if (set.size() == 0) { return ImmutableList.of(); } Set<CorrelationId> used = getVariablesUsed(rel1); if (used.size() == 0) { return ImmutableList.of(); } final List<CorrelationId> result = new ArrayList<>(); for (CorrelationId s : set) { if (used.contains(s) && !result.contains(s)) { result.add(s); } } return result; }
@Deprecated // to be removed before 2.0 public static List<CorrelationId> getVariablesSetAndUsed(RelNode rel0, RelNode rel1) { Set<CorrelationId> set = getVariablesSet(rel0); if (set.size() == 0) { return ImmutableList.of(); } Set<CorrelationId> used = getVariablesUsed(rel1); if (used.size() == 0) { return ImmutableList.of(); } final List<CorrelationId> result = new ArrayList<>(); for (CorrelationId s : set) { if (used.contains(s) && !result.contains(s)) { result.add(s); } } return result; }
/** Returns true, and calls {@link Litmus#succeed()} if a given relational * expression does not contain a given correlation. */ public static boolean notContainsCorrelation(RelNode r, CorrelationId correlationId, Litmus litmus) { final Set<CorrelationId> set = getVariablesUsed(r); if (!set.contains(correlationId)) { return litmus.succeed(); } else { return litmus.fail("contains {}", correlationId); } }
/** Returns true, and calls {@link Litmus#succeed()} if a given relational * expression does not contain a given correlation. */ public static boolean notContainsCorrelation(RelNode r, CorrelationId correlationId, Litmus litmus) { final Set<CorrelationId> set = getVariablesUsed(r); if (!set.contains(correlationId)) { return litmus.succeed(); } else { return litmus.fail("contains {}", correlationId); } }
Set<CorrelationId> correlatedVariables = RelOptUtil.getVariablesUsed(subq); for (CorrelationId correlName : correlatedVariables) { DeferredLookup lookup = mapCorrelToDeferred.get(correlName);
Set<CorrelationId> correlatedVariables = RelOptUtil.getVariablesUsed(subq); for (CorrelationId correlName : correlatedVariables) { DeferredLookup lookup = mapCorrelToDeferred.get(correlName);
Set<CorrelationId> correlatedVariables = RelOptUtil.getVariablesUsed(subq); for (CorrelationId correlName : correlatedVariables) { DeferredLookup lookup = mapCorrelToDeferred.get(correlName);
private CorrelationUse getCorrelationUse(Blackboard bb, final RelNode r0) { final Set<CorrelationId> correlatedVariables = RelOptUtil.getVariablesUsed(r0); if (correlatedVariables.isEmpty()) { return null;
private CorrelationUse getCorrelationUse(Blackboard bb, final RelNode r0) { final Set<CorrelationId> correlatedVariables = RelOptUtil.getVariablesUsed(r0); if (correlatedVariables.isEmpty()) { return null;
private CorrelationUse getCorrelationUse(Blackboard bb, final RelNode r0) { final Set<CorrelationId> correlatedVariables = RelOptUtil.getVariablesUsed(r0); if (correlatedVariables.isEmpty()) { return null;
Set<CorrelationId> correlatedVariables = RelOptUtil.getVariablesUsed(subq); for (CorrelationId correlName : correlatedVariables) { DeferredLookup lookup = mapCorrelToDeferred.get(correlName);
private CorrelationUse getCorrelationUse(Blackboard bb, final RelNode r0) { final Set<CorrelationId> correlatedVariables = RelOptUtil.getVariablesUsed(r0); if (correlatedVariables.isEmpty()) { return null;
if (RelOptUtil.getVariablesUsed(right).size() > 0) { return; } else if (cm.mapRefRelToCorRef.containsKey(project)) { if (RelOptUtil.getVariablesUsed(right).size() > 0) { return;
if (RelOptUtil.getVariablesUsed(right).size() > 0) { return; } else if (cm.mapRefRelToCorRef.containsKey(project)) { if (RelOptUtil.getVariablesUsed(right).size() > 0) { return;
public void onMatch(RelOptRuleCall call) { final Filter filter = call.rel(0); final RelBuilder builder = call.builder(); builder.push(filter.getInput()); int count = 0; RexNode c = filter.getCondition(); while (true) { final RexSubQuery e = RexUtil.SubQueryFinder.find(c); if (e == null) { assert count > 0; break; } ++count; final RelOptUtil.Logic logic = LogicVisitor.find(RelOptUtil.Logic.TRUE, ImmutableList.of(c), e); final Set<CorrelationId> variablesSet = RelOptUtil.getVariablesUsed(e.rel); final RexNode target = apply(e, variablesSet, logic, builder, 1, builder.peek().getRowType().getFieldCount()); final RexShuttle shuttle = new ReplaceSubQueryShuttle(e, target); c = c.accept(shuttle); } builder.filter(c); builder.project(fields(builder, filter.getRowType().getFieldCount())); call.transformTo(builder.build()); } }
public void onMatch(RelOptRuleCall call) { final Filter filter = call.rel(0); final RelBuilder builder = call.builder(); builder.push(filter.getInput()); int count = 0; RexNode c = filter.getCondition(); while (true) { final RexSubQuery e = RexUtil.SubQueryFinder.find(c); if (e == null) { assert count > 0; break; } ++count; final RelOptUtil.Logic logic = LogicVisitor.find(RelOptUtil.Logic.TRUE, ImmutableList.of(c), e); final Set<CorrelationId> variablesSet = RelOptUtil.getVariablesUsed(e.rel); final RexNode target = apply(e, variablesSet, logic, builder, 1, builder.peek().getRowType().getFieldCount()); final RexShuttle shuttle = new ReplaceSubQueryShuttle(e, target); c = c.accept(shuttle); } builder.filter(c); builder.project(fields(builder, filter.getRowType().getFieldCount())); call.transformTo(builder.build()); } }