Skip to content

Commit

Permalink
feat: Support planning Float * Interval binary expr
Browse files Browse the repository at this point in the history
  • Loading branch information
MazterQyou committed Jan 25, 2024
1 parent 936a046 commit 2841b5a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions datafusion/physical-expr/src/coercion_rule/binary_rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ pub fn interval_coercion(
rhs_type: &DataType,
) -> Option<DataType> {
use arrow::datatypes::DataType::*;
use arrow::datatypes::IntervalUnit::*;

// these are ordered from most informative to least informative so
// that the coercion removes the least amount of information
Expand All @@ -605,6 +606,10 @@ pub fn interval_coercion(
_ => None,
},
Operator::Multiply => match (lhs_type, rhs_type) {
(Float64, Interval(_))
| (Interval(_), Float64)
| (Float32, Interval(_))
| (Interval(_), Float32) => Some(Interval(MonthDayNano)),
(Utf8, Interval(itype))
| (Interval(itype), Utf8)
| (Int64, Interval(itype))
Expand Down

0 comments on commit 2841b5a

Please sign in to comment.