MaxGekk commented on a change in pull request #31855:
URL: https://github.com/apache/spark/pull/31855#discussion_r597074652



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -342,11 +342,12 @@ class Analyzer(override val catalogManager: 
CatalogManager)
           case (YearMonthIntervalType, DateType) => DateAddYMInterval(r, l)
           case (TimestampType, YearMonthIntervalType) => 
TimestampAddYMInterval(l, r)
           case (YearMonthIntervalType, TimestampType) => 
TimestampAddYMInterval(r, l)
-          case (CalendarIntervalType, CalendarIntervalType) => a
+          case (CalendarIntervalType, CalendarIntervalType) |
+               (DayTimeIntervalType, DayTimeIntervalType) => a

Review comment:
       The op is allowed already, see the test 
https://github.com/apache/spark/pull/31789/files#diff-bff10c8a3182aa943d8927135e0c14b02a338d9bcca94ddcd77670ee01fea0f3R2380
 . It should still pass after the changes.
   
   I have to add this cases because I reuse the `TimeAdd` expression, and 
associated rules here.
   
   The `year-month interval` +/- `year-month interval` expr is handled by the 
default case `case _ => a`/`case _ => s`.




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