Skip to content

Commit 2841b5a

Browse files
committed
feat: Support planning Float * Interval binary expr
1 parent 936a046 commit 2841b5a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

datafusion/physical-expr/src/coercion_rule/binary_rule.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@ pub fn interval_coercion(
585585
rhs_type: &DataType,
586586
) -> Option<DataType> {
587587
use arrow::datatypes::DataType::*;
588+
use arrow::datatypes::IntervalUnit::*;
588589

589590
// these are ordered from most informative to least informative so
590591
// that the coercion removes the least amount of information
@@ -605,6 +606,10 @@ pub fn interval_coercion(
605606
_ => None,
606607
},
607608
Operator::Multiply => match (lhs_type, rhs_type) {
609+
(Float64, Interval(_))
610+
| (Interval(_), Float64)
611+
| (Float32, Interval(_))
612+
| (Interval(_), Float32) => Some(Interval(MonthDayNano)),
608613
(Utf8, Interval(itype))
609614
| (Interval(itype), Utf8)
610615
| (Int64, Interval(itype))

0 commit comments

Comments
 (0)