Function mz_sql::plan::typeconv::guess_best_common_type

source ·
pub fn guess_best_common_type(
    ecx: &ExprContext<'_>,
    types: &[CoercibleScalarType],
) -> Result<ScalarType, PlanError>
Expand description

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.

Note that this function implements the type-determination components of Postgres’ UNION, CASE, and Related Constructs” type conversion.