You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/04/22 12:38:58 UTC
[GitHub] [spark] cloud-fan commented on a change in pull request #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org