fn scalar_nonnullable(expr: &mut MirScalarExpr, metadata: &RelationType) {
    // Tests for null can be replaced by "false" for non-nullable columns.
    expr.visit_mut_post(&mut |e| {
        if let MirScalarExpr::CallUnary {
            func: UnaryFunc::IsNull(func::IsNull),
            expr,
        } = e
        {
            if let MirScalarExpr::Column(c) = &**expr {
                if !metadata.column_types[*c].nullable {
                    *e = MirScalarExpr::literal_ok(Datum::False, ScalarType::Bool);
                }
            }
        }
    })
}
/// Transformations to scalar functions, based on nonnullability of columns.
Transformations to scalar functions, based on nonnullability of columns.
Transformations to scalar functions based on nonnullability of columns .
fn scalar_nonnullable(expr: &mut MirScalarExpr, metadata: &RelationType) {
    // Tests for null can be replaced by "false" for non-nullable columns.
    expr.visit_mut_post(&mut |e| {
        if let MirScalarExpr::CallUnary {
            func: UnaryFunc::IsNull(func::IsNull),
            expr,
        } = e
        {
            if let MirScalarExpr::Column(c) = &**expr {
                if !metadata.column_types[*c].nullable {
                    *e = MirScalarExpr::literal_ok(Datum::False, ScalarType::Bool);
                }
            }
        }
    })
}
fn scalar_nonnullable ( expr : & mut MirScalarExpr , metadata : & RelationType ) { // Tests for null can be replaced by "false" for non-nullable columns. expr . visit_mut_post ( & mut | e | { if let MirScalarExpr :: CallUnary { func : UnaryFunc :: IsNull ( func :: IsNull ) , expr , } = e { if let MirScalarExpr :: Column ( c ) = & * * expr { if ! metadata . column_types [ * c ] . nullable { * e = MirScalarExpr :: literal_ok ( Datum :: False , ScalarType :: Bool ) ; } } } } ) }
Transformations to scalar functions, based on nonnullability of columns.
Transformations to scalar functions based on nonnullability of columns .
expr
&mut MirScalarExpr
metadata
&RelationType
expr
&mut MirScalarExpr
metadata
&RelationType