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



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Canonicalize.scala
##########
@@ -46,6 +47,15 @@ object Canonicalize {
     case _ => e
   }
 
+  /** Remove TimeZoneId for Cast if needsTimeZone return false. */
+  private[expressions] def ignoreTimeZone(e: Expression): Expression = e match 
{
+    case a: AnsiCast if !a.needsTimeZone && a.timeZoneId.nonEmpty =>
+      a.copy(timeZoneId = None)
+    case c: Cast if !c.needsTimeZone && c.timeZoneId.nonEmpty =>
+      c.copy(timeZoneId = None)

Review comment:
       `CastBase` is not a case class and can't call `copy`




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