fn aggregate_nonnullable(expr: &mut AggregateExpr, metadata: &RelationType) {
    // An aggregate that is a count of non-nullable data can be replaced by
    // count(true).
    if let (AggregateFunc::Count, MirScalarExpr::Column(c)) = (&expr.func, &expr.expr) {
        if !metadata.column_types[*c].nullable && !expr.distinct {
            expr.expr = MirScalarExpr::literal_ok(Datum::True, ScalarType::Bool);
        }
    }
}
/// Transformations to aggregation functions, based on nonnullability of columns.
Transformations to aggregation functions, based on nonnullability of columns.
Transformations to aggregation functions based on nonnullability of columns .
fn aggregate_nonnullable(expr: &mut AggregateExpr, metadata: &RelationType) {
    // An aggregate that is a count of non-nullable data can be replaced by
    // count(true).
    if let (AggregateFunc::Count, MirScalarExpr::Column(c)) = (&expr.func, &expr.expr) {
        if !metadata.column_types[*c].nullable && !expr.distinct {
            expr.expr = MirScalarExpr::literal_ok(Datum::True, ScalarType::Bool);
        }
    }
}
fn aggregate_nonnullable ( expr : & mut AggregateExpr , metadata : & RelationType ) { // An aggregate that is a count of non-nullable data can be replaced by // count(true). if let ( AggregateFunc :: Count , MirScalarExpr :: Column ( c ) ) = ( & expr . func , & expr . expr ) { if ! metadata . column_types [ * c ] . nullable && ! expr . distinct { expr . expr = MirScalarExpr :: literal_ok ( Datum :: True , ScalarType :: Bool ) ; } } }
Transformations to aggregation functions, based on nonnullability of columns.
Transformations to aggregation functions based on nonnullability of columns .
expr
&mut AggregateExpr
metadata
&RelationType
expr
&mut AggregateExpr
metadata
&RelationType