pub fn coerce_types(
    lhs_type: &DataType,
    op: &Operator,
    rhs_type: &DataType
) -> Result<DataType>
Expand description

Coercion rules for all binary operators. Returns the output type of applying op to an argument of lhs_type and rhs_type.

TODO this function is trying to serve two purposes at once; it determines the result type of the binary operation and also determines how the inputs can be coerced but this results in inconsistencies in some cases (particular around date + interval)

Tracking issue is https://github.com/apache/arrow-datafusion/issues/3419