Expand description
Maintains a catalog of valid casts between mz_repr::ScalarType
s, as well as
other cast-related functions.
Macrosยง
- casts ๐
Structsยง
- Cast
Impl ๐ - The implementation of a cast.
- Cast
Template ๐ - A cast template is a function that produces a
Cast
given a concrete input and output type. A template can returnNone
to indicate that it is incapable of producing a cast for the specified types.
Enumsยง
- Cast
Context - Describes the context of a cast.
Constantsยง
- REG_
STRING_ ๐CAST_ TEMPLATE - STRING_
REG_ ๐CAST_ TEMPLATE - STRING to REG*
Staticsยง
- REGCLASS_
TO_ ๐STRING - REGPROC_
TO_ ๐STRING - REGTYPE_
TO_ ๐STRING - STRING_
TO_ ๐REGCLASS_ COERCED - STRING_
TO_ ๐REGCLASS_ EXPLICIT - STRING_
TO_ ๐REGPROC - STRING_
TO_ ๐REGTYPE - VALID_
CASTS ๐
Functionsยง
- can_
cast - Reports whether it is possible to perform a cast from the specified types.
- get_
cast ๐ - Get casts directly between two
ScalarType
s, with control over the allowedCastContext
. - guess_
best_ common_ type - Guesses the most-common type among a set of
ScalarType
s that all members can be cast to. ReturnsNone
if a common type cannot be deduced. - plan_
cast - Plans a cast between
ScalarType
s, specifying which types of casts are permitted usingCastContext
. - plan_
coerce - plan_
hypothetical_ cast - Similar to
plan_cast
, but for situations where you only know the type of the input expression (from
) and not the expression itself. The returned expression refers to the first column of some imaginary row, where the first column is assumed to have typefrom
. - sql_
impl_ ๐cast - Like func::sql_impl_func, but for casts.
- sql_
impl_ ๐cast_ per_ context - to_
jsonb - Converts an expression to
ScalarType::Jsonb
. - to_
string - Converts an expression to
ScalarType::String
.
Type Aliasesยง
- Cast ๐
- A cast is a function that takes a
ScalarExpr
to anotherScalarExpr
.