sunchao commented on a change in pull request #29775:
URL: https://github.com/apache/spark/pull/29775#discussion_r489706969



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/UnwrapCastInBinaryComparison.scala
##########
@@ -184,7 +185,7 @@ object UnwrapCastInBinaryComparison extends 
Rule[LogicalPlan] {
     } else {
       // This means `value` is within range `(min, max)`. Optimize this by 
moving the cast to the
       // literal side.
-      val lit = Cast(Literal(value), fromType)
+      val lit = Cast(Literal(value), fromType, tz)

Review comment:
       We can also evaluate this and pass the value. It will be optimized away 
by ConstantFolding anyway. 




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