Package org.apache.calcite.rel.metadata
Interface BuiltInMetadata.DistinctRowCount
-
- All Superinterfaces:
Metadata
- All Known Subinterfaces:
BuiltInMetadata.All
- Enclosing class:
- BuiltInMetadata
public static interface BuiltInMetadata.DistinctRowCount extends Metadata
Metadata about the number of distinct rows returned by a set of columns in a relational expression.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
BuiltInMetadata.DistinctRowCount.Handler
Handler API.
-
Field Summary
Fields Modifier and Type Field Description static MetadataDef<BuiltInMetadata.DistinctRowCount>
DEF
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Double
getDistinctRowCount(ImmutableBitSet groupKey, RexNode predicate)
Estimates the number of rows which would be produced by a GROUP BY on the set of columns indicated by groupKey, where the input to the GROUP BY has been pre-filtered by predicate.
-
-
-
Field Detail
-
DEF
static final MetadataDef<BuiltInMetadata.DistinctRowCount> DEF
-
-
Method Detail
-
getDistinctRowCount
java.lang.Double getDistinctRowCount(ImmutableBitSet groupKey, RexNode predicate)
Estimates the number of rows which would be produced by a GROUP BY on the set of columns indicated by groupKey, where the input to the GROUP BY has been pre-filtered by predicate. This quantity (leaving out predicate) is often referred to as cardinality (as in gender being a "low-cardinality column").- Parameters:
groupKey
- column mask representing group by columnspredicate
- pre-filtered predicates- Returns:
- distinct row count for groupKey, filtered by predicate, or null if no reliable estimate can be determined
-
-