예제 #1
0
  /** Add the Filter condition to the pulledPredicates list from the input. */
  public RelOptPredicateList getPredicates(Filter filter, RelMetadataQuery mq) {
    final RelNode input = filter.getInput();
    final RelOptPredicateList inputInfo = mq.getPulledUpPredicates(input);

    return Util.first(inputInfo, RelOptPredicateList.EMPTY)
        .union(RelOptPredicateList.of(RelOptUtil.conjunctions(filter.getCondition())));
  }
예제 #2
0
 /** @see RelMetadataQuery#getPulledUpPredicates(RelNode) */
 public RelOptPredicateList getPredicates(RelSubset r, RelMetadataQuery mq) {
   if (!Bug.CALCITE_1048_FIXED) {
     return RelOptPredicateList.EMPTY;
   }
   RelOptPredicateList list = null;
   for (RelNode r2 : r.getRels()) {
     RelOptPredicateList list2 = mq.getPulledUpPredicates(r2);
     if (list2 != null) {
       list = list == null ? list2 : list.union(list2);
     }
   }
   return Util.first(list, RelOptPredicateList.EMPTY);
 }
예제 #3
0
 /**
  * Runs with query #i.
  *
  * @param i Ordinal of query, per the benchmark, 1-based
  * @param enable Whether to enable query execution. If null, use the value of {@link #ENABLE}.
  *     Pass true only for 'fast' tests that do not read any data.
  */
 private CalciteAssert.AssertQuery query(int i, Boolean enable) {
   return with(Util.first(enable, ENABLE))
       .query(QUERIES.get(i - 1).replaceAll("tpch\\.", "tpch_01."));
 }
예제 #4
0
 @Override
 public double estimateRowCount(RelMetadataQuery mq) {
   return Util.first(RelMdUtil.getSemiJoinRowCount(mq, left, right, joinType, condition), 1D);
 }
예제 #5
0
 public String apply(String original, int attempt, int size) {
   return Util.first(original, "$f") + Math.max(size, attempt);
 }
예제 #6
0
 public String apply(String original, int attempt, int size) {
   return Util.first(original, "EXPR$") + attempt;
 }