Function mz_sql::plan::typeconv::plan_cast

source ·
pub fn plan_cast(
    ecx: &ExprContext<'_>,
    ccx: CastContext,
    expr: HirScalarExpr,
    to: &ScalarType,
) -> Result<HirScalarExpr, PlanError>
Expand description

Plans a cast between ScalarTypes, specifying which types of casts are permitted using CastContext.

§Errors

If a cast between the ScalarExpr’s base type and the specified type is:

  • Not possible, e.g. Bytes to Interval
  • Not permitted, e.g. implicitly casting from Float64 to Float32.
  • Not implemented yet