/// Coercion rules for Strings: the type that both lhs and rhs can be
/// casted to for the purpose of a string computation
Coercion rules for Strings: the type that both lhs and rhs can be
casted to for the purpose of a string computation
Coercion rules for Strings : the type that both lhs and rhs can be casted to for the purpose of a string computation
pub fn string_coercion(lhs_type: &DataType, rhs_type: &DataType) -> Result<DataType> {
    match (lhs_type, rhs_type) {
        (Utf8, Utf8) => Ok(Utf8),
        (LargeUtf8, Utf8) => Ok(LargeUtf8),
        (Utf8, LargeUtf8) => Ok(LargeUtf8),
        (LargeUtf8, LargeUtf8) => Ok(LargeUtf8),
        _ => bail!("Can't construct type from {} and {}", lhs_type, rhs_type),
    }
}
pub fn string_coercion ( lhs_type : & DataType , rhs_type : & DataType ) -> Result < DataType > { match ( lhs_type , rhs_type ) { ( Utf8 , Utf8 ) => Ok ( Utf8 ) , ( LargeUtf8 , Utf8 ) => Ok ( LargeUtf8 ) , ( Utf8 , LargeUtf8 ) => Ok ( LargeUtf8 ) , ( LargeUtf8 , LargeUtf8 ) => Ok ( LargeUtf8 ) , _ => bail ! ( " " lhs_type rhs_type ) , } }
Coercion rules for Strings: the type that both lhs and rhs can be
casted to for the purpose of a string computation
Coercion rules for Strings : the type that both lhs and rhs can be casted to for the purpose of a string computation
lhs_type
&DataType
rhs_type
&DataType