alamb commented on code in PR #10765:
URL: https://github.com/apache/datafusion/pull/10765#discussion_r1630213374


##########
datafusion/optimizer/src/analyzer/type_coercion.rs:
##########
@@ -1082,13 +1083,16 @@ mod test {
 
     #[test]
     fn binary_op_date32_op_interval() -> Result<()> {
-        //CAST(Utf8("1998-03-18") AS Date32) + IntervalDayTime("386547056640")
+        // CAST(Utf8("1998-03-18") AS Date32) + IntervalDayTime("...")
         let expr = cast(lit("1998-03-18"), DataType::Date32)
-            + lit(ScalarValue::IntervalDayTime(Some(386547056640)));
+            + lit(ScalarValue::IntervalDayTime(Some(IntervalDayTime {
+                days: 123,
+                milliseconds: 456,
+            })));

Review Comment:
   BTW I think we could also use 
   
   
https://github.com/apache/datafusion/blob/6846513616608fa34e2aa92495df9f879bbd063a/datafusion/common/src/scalar/mod.rs#L942-L945
   
   to reduce the boilerplate:
   
   ```suggestion
               + lit(ScalarValue::new_interval_dt(123,  456))
   ```
   
   But it is less explicit
   



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to