mhilton commented on code in PR #7758:
URL: https://github.com/apache/arrow-datafusion/pull/7758#discussion_r1349001968


##########
datafusion/physical-expr/src/intervals/cp_solver.rs:
##########
@@ -681,13 +693,41 @@ pub fn propagate_comparison_to_time_interval_at_right(
     }
 }
 
+/// Propagate the constraints arising from comparison operators on
+/// timestamp data types. Arithmetic on timestamps is treated specially,
+/// for example subtracting two timestamps results in duration rather
+/// than another timestamp. To work around this all values are converted
+/// to int64 before applying the proagation operation. The results are
+/// converted back to their original types before being returned.
+fn propagate_comparison_timestamp(
+    op: &Operator,
+    left_child: &Interval,
+    right_child: &Interval,
+    left_type: &DataType,
+    right_type: &DataType,
+) -> Result<(Option<Interval>, Option<Interval>)> {

Review Comment:
   Should this function have some additional constraint checks on the two 
timestamp types? Perhaps to ensure the two timestamps are actually comparable? 
I couldn't think of any to add, but maybe someone else can.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to