Examples of RexNode


Examples of org.eigenbase.rex.RexNode

                    cluster, cluster.traitSetOf(EnumerableConvention.INSTANCE),
                    relOptTable, Object[].class);

            // "WHERE i > 1"
            final RexBuilder rexBuilder = cluster.getRexBuilder();
            final RexNode condition =
                rexBuilder.makeCall(SqlStdOperatorTable.GREATER_THAN,
                    rexBuilder.makeFieldAccess(
                        rexBuilder.makeRangeReference(tableRel), "i", true),
                    rexBuilder.makeExactLiteral(BigDecimal.ONE));
            final FilterRel filterRel =
View Full Code Here

Examples of org.eigenbase.rex.RexNode

  public Queryable<T> where(
      Queryable<T> source,
      FunctionExpression<? extends Predicate1<T>> predicate) {
    RelNode child = toRel(source);
    RexNode node = translator.toRex(predicate, child);
    setRel(new FilterRel(translator.cluster, child, node));
    return source;
  }
View Full Code Here

Examples of org.eigenbase.rex.RexNode

                    cluster, cluster.traitSetOf(EnumerableConvention.INSTANCE),
                    relOptTable, Object[].class);

            // "WHERE i > 1"
            final RexBuilder rexBuilder = cluster.getRexBuilder();
            final RexNode condition =
                rexBuilder.makeCall(SqlStdOperatorTable.GREATER_THAN,
                    rexBuilder.makeFieldAccess(
                        rexBuilder.makeRangeReference(tableRel), "i", true),
                    rexBuilder.makeExactLiteral(BigDecimal.ONE));
            final FilterRel filterRel =
View Full Code Here

Examples of org.eigenbase.rex.RexNode

  /** Creates a {@code JoinInfo} by analyzing a condition. */
  public static JoinInfo of(RelNode left, RelNode right, RexNode condition) {
    final List<Integer> leftKeys = new ArrayList<Integer>();
    final List<Integer> rightKeys = new ArrayList<Integer>();
    RexNode remaining =
        RelOptUtil.splitJoinCondition(left, right, condition, leftKeys,
            rightKeys);
    if (remaining.isAlwaysTrue()) {
      return new EquiJoinInfo(ImmutableIntList.copyOf(leftKeys),
          ImmutableIntList.copyOf(rightKeys));
    } else {
      return new NonEquiJoinInfo(ImmutableIntList.copyOf(leftKeys),
          ImmutableIntList.copyOf(rightKeys), remaining);
View Full Code Here

Examples of org.eigenbase.rex.RexNode

            0, aCount, bCount,
            bCount, aCount + bCount, cCount);
    final List<RexNode> newBottomList = Lists.newArrayList();
    new RexPermuteInputsShuttle(bottomMapping, relB, relC)
        .visitList(bottom, newBottomList);
    RexNode newBottomCondition =
        RexUtil.composeConjunction(rexBuilder, newBottomList, false);

    final JoinRelBase newBottomJoin =
        bottomJoin.copy(bottomJoin.getTraitSet(), newBottomCondition, relB,
            relC, JoinRelType.INNER, false);

    // Condition for newTopJoin consists of pieces from bottomJoin and topJoin.
    // Field ordinals do not need to be changed.
    RexNode newTopCondition =
        RexUtil.composeConjunction(rexBuilder, top, false);
    final JoinRelBase newTopJoin =
        topJoin.copy(topJoin.getTraitSet(), newTopCondition, relA,
            newBottomJoin, JoinRelType.INNER, false);
View Full Code Here

Examples of org.eigenbase.rex.RexNode

  public Queryable<T> where(
      Queryable<T> source,
      FunctionExpression<? extends Predicate1<T>> predicate) {
    RelNode child = toRel(source);
    RexNode node = translator.toRex(predicate, child);
    setRel(new FilterRel(translator.cluster, child, node));
    return source;
  }
View Full Code Here

Examples of org.eigenbase.rex.RexNode

        if (!includeEqualityInference
            && equalityPredicates.contains(r.toString())) {
          continue;
        }
        for (Mapping m : mappings(r)) {
          RexNode tr = r.accept(
              new RexPermuteInputsShuttle(m, joinRel.getInput(0),
                  joinRel.getInput(1)));
          if (BitSets.contains(inferringFields, RelOptUtil.InputFinder.bits(tr))
              && !allExprsDigests.contains(tr.toString())
              && !isAlwaysTrue(tr)) {
            inferedPredicates.add(tr);
            allExprsDigests.add(tr.toString());
          }
        }
      }
    }
View Full Code Here

Examples of org.eigenbase.rex.RexNode

  /** Creates a DrillJoinRel. */
  public DrillJoinRel(RelOptCluster cluster, RelTraitSet traits, RelNode left, RelNode right, RexNode condition,
      JoinRelType joinType) throws InvalidRelException {
    super(cluster, traits, left, right, condition, joinType, Collections.<String> emptySet());

    RexNode remaining = RelOptUtil.splitJoinCondition(left, right, condition, leftKeys, rightKeys);
    if (!remaining.isAlwaysTrue()) {
      throw new InvalidRelException("DrillJoinRel only supports equi-join");
    }
  }
View Full Code Here

Examples of org.eigenbase.rex.RexNode

          // Ignore casts. Drill is type-less.
          logger.debug("Ignoring cast {}, {}", call.getOperands().get(0), call.getOperands().get(0).getClass());
          return call.getOperands().get(0).accept(this);
        }
        if (call.getOperator() == SqlStdOperatorTable.itemOp) {
          final RexNode left = call.getOperands().get(0);
          final RexLiteral literal = (RexLiteral) call.getOperands().get(1);
          final String field = (String) literal.getValue2();
//          buf.append('\'');
          final int length = buf.length();
          left.accept(this);
          if (buf.length() > length) {
            // check before generating empty LHS if inputName is null
            buf.append('.');
          }
          buf.append(field);
View Full Code Here

Examples of org.eigenbase.rex.RexNode

      return false;
    }

    List<Integer> leftKeys = Lists.newArrayList();
    List<Integer> rightKeys = Lists.newArrayList() ;
    RexNode remaining = RelOptUtil.splitJoinCondition(left, right, join.getCondition(), leftKeys, rightKeys);
    if (!remaining.isAlwaysTrue() && (leftKeys.size() == 0 || rightKeys.size() == 0)) {
      // this is a non-equijoin which is not supported by existing rules
      return false;
    }
    return true;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.