Kwafoor commented on code in PR #40294:
URL: https://github.com/apache/spark/pull/40294#discussion_r1151924388


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/UnwrapCastInBinaryComparison.scala:
##########
@@ -133,6 +133,11 @@ object UnwrapCastInBinaryComparison extends 
Rule[LogicalPlan] {
         if canImplicitlyCast(fromExp, toType, literalType) =>
       simplifyNumericComparison(be, fromExp, toType, value)
 
+    case be @ BinaryComparison(
+      Cast(fromExp, _, timeZoneId, evalMode), date @ Literal(value, DateType))
+        if fromExp.dataType == StringType && value != null =>
+      be.withNewChildren(Seq(fromExp, Cast(date, StringType, timeZoneId, 
evalMode)))

Review Comment:
    `UnwrapCastInBinaryComparison` class is only responsible for processing 
casts related to numeric types, and it is dangerous to cast date types. Can we 
add the related conversion of partition columns to the 
`PruneHiveTablePartitions` rule?



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