A stack of error messages for the cast operation.
Collect all InputRef
sโ indexes in the expression.
for every (col) == (col)
,
transform to IsNotNull(col)
since in the boolean context, null = (...)
will always
be treated as false.
note: as always, only for single column.
A reference to a column outside the subquery.
Count Now
s in the expression.
A function signature.
Similar to
FunctionCall
, with an extra lambda function argument.
Expression rewriter to inline NOW()
and PROCTIME()
to a literal extracted from the epoch.
The NOW()
function.
A sort expression in the ORDER BY
clause.
SessionTimezone
will be used to resolve session
timezone-dependent casts, comparisons or arithmetic.
Subquery expression.
A table function takes a row as input and returns a table. It is also known as Set-Returning
Function.
A window function performs a calculation across a set of table rows that are somehow related to
the current row, according to the window spec OVER (PARTITION BY .. ORDER BY ..)
.
One output row is calculated for each row in the input table.
Find the
least_restrictive
type over a list of
exprs
, and add implicit cast when necessary.
Used by
VALUES
,
CASE
,
UNION
, etc. See
PG.
Checks whether casting from source
to target
is ok in allows
context.
Returns an error if the cast is not possible.
Checks whether casting from source
to target
is ok in allows
context.
Checks whether casting from source
to target
is ok in allows
context.
Both source
and target
must be base types, i.e. not struct or array.
Collect all InputRef
sโ indexes in the expressions.
check ColumnSelfEqualRewriter
โs comment below.
The default implementation of
ExprRewriter::rewrite_expr
that simply dispatches to other
methods based on the type of the expression.
The default implementation of
ExprVisitor::visit_expr
that simply dispatches to other
methods based on the type of the expression.
fold boolean constants in boolean exprs
e.g. (A And false) Or true
will become True
From all available functions in sig_map
, find and return the best matching FuncSign
for the
provided func_name
and inputs
. This not only support exact function signature match, but can
also match substr(varchar, smallint)
or even substr(varchar, unknown)
to substr(varchar, int)
.
Infers the return type of a function. Returns Err
if the function with specified data types
is not supported on backend.
Expand
Type::Not
expressions.
e.g. Not(A And B) will become (Not A) Or (Not B)
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
.
If
expr
is not a
ExprImpl::Literal
, or the Literal is not a boolean, this function will
return None. Otherwise it will return the boolean value.