@Override public Double getDistinctRowCount(RelNode rel, RelMetadataQuery mq, ImmutableBitSet groupKey, RexNode predicate) { if (rel instanceof HiveTableScan) { return getDistinctRowCount((HiveTableScan) rel, mq, groupKey, predicate); } /* * For now use Calcite' default formulas for propagating NDVs up the Query * Tree. */ return super.getDistinctRowCount(rel, mq, groupKey, predicate); }
@Override public Double getDistinctRowCount(RelNode rel, RelMetadataQuery mq, ImmutableBitSet groupKey, RexNode predicate) { if (rel instanceof HiveTableScan) { return getDistinctRowCount((HiveTableScan) rel, mq, groupKey, predicate); } /* * For now use Calcite' default formulas for propagating NDVs up the Query * Tree. */ return super.getDistinctRowCount(rel, mq, groupKey, predicate); }
@Override public Double getDistinctRowCount(RelNode rel, ImmutableBitSet groupKey, RexNode predicate) { if (rel instanceof HiveTableScan) { return getDistinctRowCount((HiveTableScan) rel, groupKey, predicate); } /* * For now use Calcite' default formulas for propagating NDVs up the Query * Tree. */ return super.getDistinctRowCount(rel, groupKey, predicate); }
public Double getDistinctRowCount(RelSubset rel, RelMetadataQuery mq, ImmutableBitSet groupKey, RexNode predicate) { final RelNode best = rel.getBest(); if (best != null) { return mq.getDistinctRowCount(best, groupKey, predicate); } if (!Bug.CALCITE_1048_FIXED) { return getDistinctRowCount((RelNode) rel, mq, groupKey, predicate); } Double d = null; for (RelNode r2 : rel.getRels()) { try { Double d2 = mq.getDistinctRowCount(r2, groupKey, predicate); d = NumberUtil.min(d, d2); } catch (CyclicMetadataException e) { // Ignore this relational expression; there will be non-cyclic ones // in this set. } } return d; } }
public Double getDistinctRowCount(RelSubset rel, RelMetadataQuery mq, ImmutableBitSet groupKey, RexNode predicate) { final RelNode best = rel.getBest(); if (best != null) { return mq.getDistinctRowCount(best, groupKey, predicate); } if (!Bug.CALCITE_1048_FIXED) { return getDistinctRowCount((RelNode) rel, mq, groupKey, predicate); } Double d = null; for (RelNode r2 : rel.getRels()) { try { Double d2 = mq.getDistinctRowCount(r2, groupKey, predicate); d = NumberUtil.min(d, d2); } catch (CyclicMetadataException e) { // Ignore this relational expression; there will be non-cyclic ones // in this set. } } return d; } }