cloud-fan commented on a change in pull request #31832:
URL: https://github.com/apache/spark/pull/31832#discussion_r594148733



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
##########
@@ -1521,6 +1521,40 @@ case class DateAddYMInterval(date: Expression, interval: 
Expression) extends Add
   override def sql: String = s"${left.sql} + ${right.sql}"
 }
 
+// Adds the year-month interval to the timestamp
+case class TimestampAddYMInterval(

Review comment:
       Shall we make it general and accept both year-month and day-time 
intervals? The implementation can have 2 branches:
   ```
   override def nullSafeEval(micros: Any, months: Any): Any = interval.dataType 
match {
     case YearMonthIntervalType =>
       timestampAddMonths(micros.asInstanceOf[Long], months.asInstanceOf[Int], 
zoneId)
     case DayTimeIntervalType => ...
   }
   ```




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

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