Macrosยง
- assert_
input_ ๐ref give a expression, and check all columns in itsinput_ref
expressions less than the input column number.
Structsยง
- Fold boolean constants in a expr
- Collect all
InputRef
sโ indexes in the expression. - for every
(col) == (col)
, transform toIsNotNull(col)
since in the boolean context,null = (...)
will always be treated as false. note: as always, only for single column. - Count
Now
s in the expression. - NotPush
Down ๐
Functionsยง
boolean_constant_fold_and
takes the left hand side and right hands side of aType::And
operator. It is required that the the lhs should always be a constant.boolean_constant_fold_or
takes the left hand side and right hands side of aType::Or
operator. It is required that the the lhs should always be a constant.- Collect all
InputRef
sโ indexes in the expressions. - check
ColumnSelfEqualRewriter
โs comment below. - fold boolean constants in boolean exprs e.g.
(A And false) Or true
will becomeTrue
- Merge the given expressions by the logical operation.
- Expand
Type::Not
expressions. e.g. Not(A And B) will become (Not A) Or (Not B) - split_
expr_ ๐by - Transform a bool expression to Conjunctive form. e.g. given expression is (expr1 AND expr2 AND expr3) the function will return Vec[expr1, expr2, expr3].
- Transform a bool expression to Disjunctive form. e.g. given expression is (expr1 OR expr2 OR expr3) the function will return Vec[expr1, expr2, expr3].
- Try to get bool constant from a
ExprImpl
. Ifexpr
is not aExprImpl::Literal
, or the Literal is not a boolean, this function will return None. Otherwise it will return the boolean value.