Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanyuanking committed Apr 22, 2020
1 parent 95102cc commit 73f4694
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ object Canonicalize {

/** 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)
case c: CastBase if c.timeZoneId.nonEmpty && !c.needsTimeZone =>
c.withTimeZone(null)
case _ => e
}

Expand Down

0 comments on commit 73f4694

Please sign in to comment.