MaxGekk commented on code in PR #41771:
URL: https://github.com/apache/spark/pull/41771#discussion_r1246386620


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/AnsiTypeCoercion.scala:
##########
@@ -294,14 +294,16 @@ object AnsiTypeCoercion extends TypeCoercionBase {
       // Skip nodes who's children have not been resolved yet.
       case e if !e.childrenResolved => e
 
-      case d @ DateAdd(AnyTimestampType(), _) => d.copy(startDate = 
Cast(d.startDate, DateType))
-      case d @ DateSub(AnyTimestampType(), _) => d.copy(startDate = 
Cast(d.startDate, DateType))
+      case d @ DateAdd(AnyTimestampTypeExpression(), _)
+      => d.copy(startDate = Cast(d.startDate, DateType))
+      case d @ DateSub(AnyTimestampTypeExpression(), _)
+      => d.copy(startDate = Cast(d.startDate, DateType))

Review Comment:
   Could you change coding style here, please:
   ```suggestion
         case d @ DateAdd(AnyTimestampTypeExpression(), _) =>
           d.copy(startDate = Cast(d.startDate, DateType))
         case d @ DateSub(AnyTimestampTypeExpression(), _) =>
           d.copy(startDate = Cast(d.startDate, DateType))
   ```



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