Module mz_sql::plan::typeconv

source ยท
Expand description

Maintains a catalog of valid casts between mz_repr::ScalarTypes, as well as other cast-related functions.

Macrosยง

Structsยง

  • CastImpl ๐Ÿ”’
    The implementation of a cast.
  • CastTemplate ๐Ÿ”’
    A cast template is a function that produces a Cast given a concrete input and output type. A template can return None to indicate that it is incapable of producing a cast for the specified types.

Enumsยง

Constantsยง

Staticsยง

Functionsยง

  • Reports whether it is possible to perform a cast from the specified types.
  • get_cast ๐Ÿ”’
    Get casts directly between two ScalarTypes, with control over the allowed CastContext.
  • Guesses the most-common type among a set of ScalarTypes that all members can be cast to. Returns None if a common type cannot be deduced.
  • Plans a cast between ScalarTypes, specifying which types of casts are permitted using CastContext.
  • 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 type from.
  • sql_impl_cast ๐Ÿ”’
    Like func::sql_impl_func, but for casts.
  • Converts an expression to ScalarType::Jsonb.
  • Converts an expression to ScalarType::String.

Type Aliasesยง

  • Cast ๐Ÿ”’
    A cast is a function that takes a ScalarExpr to another ScalarExpr.