dwsmith1983 commented on code in PR #5864:
URL: https://github.com/apache/datafusion-comet/pull/5864#discussion_r4081221139


##########
spark/src/main/scala/org/apache/comet/serde/datetime.scala:
##########
@@ -997,6 +997,37 @@ object CometTimestampAdd extends 
CometCodegenDispatch[TimestampAdd]
 
 object CometTimestampDiff extends CometCodegenDispatch[TimestampDiff]
 
+// Date and timestamp interval arithmetic. `timestamp + day-time or calendar 
interval` resolves
+// to `TimeAdd` on Spark 3.4 through 4.0 and to `TimestampAddInterval` on 
4.1+, so that serde
+// lives in the version shims.
+object CometDateAddInterval extends CometCodegenDispatch[DateAddInterval]
+
+object CometDateAddYMInterval extends CometCodegenDispatch[DateAddYMInterval]
+
+object CometTimestampAddYMInterval extends 
CometCodegenDispatch[TimestampAddYMInterval]
+
+object CometSubtractDates extends CometCodegenDispatch[SubtractDates]

Review Comment:
   > Worth a line?
   
   Added in 495026f53. The comment above `CometSubtractDates` now says 
`DateTimeUtils.subtractDates` always writes microseconds 0 into the calendar 
interval, so the dispatcher's `multiplyExact` cannot overflow and both modes 
dispatch, which is the invariant the next calendar-interval serde needs.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to