File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,6 +72,12 @@ pub fn binary_operator_data_type(
7272
7373/// Coercion rules for all binary operators. Returns the output type
7474/// of applying `op` to an argument of `lhs_type` and `rhs_type`.
75+ ///
76+ /// TODO this function is trying to serve two purposes at once; it determines the result type
77+ /// of the binary operation and also determines how the inputs can be coerced but this
78+ /// results in inconsistencies in some cases (particular around date + interval)
79+ ///
80+ /// Tracking issue is https://github.com/apache/arrow-datafusion/issues/3419
7581pub fn coerce_types (
7682 lhs_type : & DataType ,
7783 op : & Operator ,
Original file line number Diff line number Diff line change @@ -101,8 +101,7 @@ impl ExprRewriter for TypeCoercionRewriter {
101101 DataType :: Date32 | DataType :: Date64 | DataType :: Timestamp ( _, _) ,
102102 & DataType :: Interval ( _) ,
103103 ) => {
104- // Arrow `can_cast_types` says we cannot cast an Interval to
105- // Date32/Date64/Timestamp, which contradicts DataFusion's `coerce_types`
104+ // this is a workaround for https://github.com/apache/arrow-datafusion/issues/3419
106105 Ok ( expr. clone ( ) )
107106 }
108107 _ => {
You can’t perform that action at this time.
0 commit comments