if (!RelMdUtil.areColumnsDefinitelyUnique(mq, left, allCols)) {
/** Catch-all implementation for * {@link BuiltInMetadata.PopulationSize#getPopulationSize(ImmutableBitSet)}, * invoked using reflection. * * @see org.apache.calcite.rel.metadata.RelMetadataQuery#getPopulationSize(RelNode, ImmutableBitSet) */ public Double getPopulationSize(RelNode rel, RelMetadataQuery mq, ImmutableBitSet groupKey) { // if the keys are unique, return the row count; otherwise, we have // no further information on which to return any legitimate value // REVIEW zfong 4/11/06 - Broadbase code returns the product of each // unique key, which would result in the population being larger // than the total rows in the relnode boolean uniq = RelMdUtil.areColumnsDefinitelyUnique(mq, rel, groupKey); if (uniq) { return mq.getRowCount(rel); } return null; } }
if (!RelMdUtil.areColumnsDefinitelyUnique(mq, left, allCols)) {
/** Catch-all implementation for * {@link BuiltInMetadata.PopulationSize#getPopulationSize(ImmutableBitSet)}, * invoked using reflection. * * @see org.apache.calcite.rel.metadata.RelMetadataQuery#getPopulationSize(RelNode, ImmutableBitSet) */ public Double getPopulationSize(RelNode rel, RelMetadataQuery mq, ImmutableBitSet groupKey) { // if the keys are unique, return the row count; otherwise, we have // no further information on which to return any legitimate value // REVIEW zfong 4/11/06 - Broadbase code returns the product of each // unique key, which would result in the population being larger // than the total rows in the relnode boolean uniq = RelMdUtil.areColumnsDefinitelyUnique(mq, rel, groupKey); if (uniq) { return mq.getRowCount(rel); } return null; } }
if (!RelMdUtil.areColumnsDefinitelyUnique(mq, left, allCols)) { SQL2REL_LOGGER.debug("There are no unique keys for {}", left); return;
/** Catch-all implementation for * {@link BuiltInMetadata.DistinctRowCount#getDistinctRowCount(ImmutableBitSet, RexNode)}, * invoked using reflection. * * @see org.apache.calcite.rel.metadata.RelMetadataQuery#getDistinctRowCount(RelNode, ImmutableBitSet, RexNode) */ public Double getDistinctRowCount(RelNode rel, RelMetadataQuery mq, ImmutableBitSet groupKey, RexNode predicate) { // REVIEW zfong 4/19/06 - Broadbase code does not take into // consideration selectivity of predicates passed in. Also, they // assume the rows are unique even if the table is not boolean uniq = RelMdUtil.areColumnsDefinitelyUnique(mq, rel, groupKey); if (uniq) { return NumberUtil.multiply(mq.getRowCount(rel), mq.getSelectivity(rel, predicate)); } return null; }
if (!RelMdUtil.areColumnsDefinitelyUnique(mq, left, allCols)) { SQL2REL_LOGGER.debug("There are no unique keys for {}", left); return;
/** Catch-all implementation for * {@link BuiltInMetadata.DistinctRowCount#getDistinctRowCount(ImmutableBitSet, RexNode)}, * invoked using reflection. * * @see org.apache.calcite.rel.metadata.RelMetadataQuery#getDistinctRowCount(RelNode, ImmutableBitSet, RexNode) */ public Double getDistinctRowCount(RelNode rel, RelMetadataQuery mq, ImmutableBitSet groupKey, RexNode predicate) { // REVIEW zfong 4/19/06 - Broadbase code does not take into // consideration selectivity of predicates passed in. Also, they // assume the rows are unique even if the table is not boolean uniq = RelMdUtil.areColumnsDefinitelyUnique(mq, rel, groupKey); if (uniq) { return NumberUtil.multiply(mq.getRowCount(rel), mq.getSelectivity(rel, predicate)); } return null; }
if (!RelMdUtil.areColumnsDefinitelyUnique(mq, left, allCols)) { SQL2REL_LOGGER.debug("There are no unique keys for {}", left); return;
&& !RelMdUtil.areColumnsDefinitelyUnique( mq, join.getRight(), joinInfo.rightSet())) { return false; && !RelMdUtil.areColumnsDefinitelyUnique( mq, join.getLeft(), joinInfo.leftSet())) { return false;
&& !RelMdUtil.areColumnsDefinitelyUnique( mq, join.getRight(), joinInfo.rightSet())) { return false; && !RelMdUtil.areColumnsDefinitelyUnique( mq, join.getLeft(), joinInfo.leftSet())) { return false;
for (RelNode input : union.getInputs()) { boolean alreadyUnique = RelMdUtil.areColumnsDefinitelyUnique(mq, input, aggRel.getGroupSet());
for (RelNode input : union.getInputs()) { boolean alreadyUnique = RelMdUtil.areColumnsDefinitelyUnique(mq, input, aggRel.getGroupSet());