/** Finds a {@link RexInputRef} that is equivalent to a {@link CorRef}, * and if found, throws a {@link org.apache.calcite.util.Util.FoundOne}. */ private void findCorrelationEquivalent(CorRef correlation, RexNode e) throws Util.FoundOne { switch (e.getKind()) { case EQUALS: final RexCall call = (RexCall) e; final List<RexNode> operands = call.getOperands(); if (references(operands.get(0), correlation)) { throw new Util.FoundOne(operands.get(1)); } if (references(operands.get(1), correlation)) { throw new Util.FoundOne(operands.get(0)); } break; case AND: for (RexNode operand : ((RexCall) e).getOperands()) { findCorrelationEquivalent(correlation, operand); } } }
/** Finds a {@link RexInputRef} that is equivalent to a {@link CorRef}, * and if found, throws a {@link org.apache.calcite.util.Util.FoundOne}. */ private void findCorrelationEquivalent(CorRef correlation, RexNode e) throws Util.FoundOne { switch (e.getKind()) { case EQUALS: final RexCall call = (RexCall) e; final List<RexNode> operands = call.getOperands(); if (references(operands.get(0), correlation)) { throw new Util.FoundOne(operands.get(1)); } if (references(operands.get(1), correlation)) { throw new Util.FoundOne(operands.get(0)); } break; case AND: for (RexNode operand : ((RexCall) e).getOperands()) { findCorrelationEquivalent(correlation, operand); } } }
/** Finds a {@link RexInputRef} that is equivalent to a {@link CorRef}, * and if found, throws a {@link org.apache.calcite.util.Util.FoundOne}. */ private void findCorrelationEquivalent(CorRef correlation, RexNode e) throws Util.FoundOne { switch (e.getKind()) { case EQUALS: final RexCall call = (RexCall) e; final List<RexNode> operands = call.getOperands(); if (references(operands.get(0), correlation)) { throw new Util.FoundOne(operands.get(1)); } if (references(operands.get(1), correlation)) { throw new Util.FoundOne(operands.get(0)); } break; case AND: for (RexNode operand : ((RexCall) e).getOperands()) { findCorrelationEquivalent(correlation, operand); } } }
findCorrelationEquivalent(correlation, ((Filter) rel).getCondition()); } catch (Util.FoundOne e) { if (e.getNode() instanceof RexInputRef) {
findCorrelationEquivalent(correlation, ((Filter) rel).getCondition()); } catch (Util.FoundOne e) { if (e.getNode() instanceof RexInputRef) {
findCorrelationEquivalent(correlation, ((Filter) rel).getCondition()); } catch (Util.FoundOne e) { if (e.getNode() instanceof RexInputRef) {