Skip to content

Commit

Permalink
feat: Support planning Timestamp - Timestamp binary expr
Browse files Browse the repository at this point in the history
  • Loading branch information
MazterQyou committed Jan 25, 2024
1 parent 0499041 commit 8e72862
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions datafusion/physical-expr/src/coercion_rule/binary_rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -638,12 +638,14 @@ pub fn date_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
match op {
Operator::Minus => match (lhs_type, rhs_type) {
(Date32, Date32) => Some(Int32),
(Timestamp(_, _), Timestamp(_, _)) => Some(Interval(MonthDayNano)),
_ => None,
},
_ => None,
Expand Down

0 comments on commit 8e72862

Please sign in to comment.