Skip to content

Commit 936a046

Browse files
committed
feat: Support planning Timestamp - Timestamp binary expr
1 parent 1b3fc4f commit 936a046

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,12 +638,14 @@ pub fn date_coercion(
638638
rhs_type: &DataType,
639639
) -> Option<DataType> {
640640
use arrow::datatypes::DataType::*;
641+
use arrow::datatypes::IntervalUnit::*;
641642

642643
// these are ordered from most informative to least informative so
643644
// that the coercion removes the least amount of information
644645
match op {
645646
Operator::Minus => match (lhs_type, rhs_type) {
646647
(Date32, Date32) => Some(Int32),
648+
(Timestamp(_, _), Timestamp(_, _)) => Some(Interval(MonthDayNano)),
647649
_ => None,
648650
},
649651
_ => None,

0 commit comments

Comments
 (0)