viirya commented on code in PR #44498:
URL: https://github.com/apache/spark/pull/44498#discussion_r1436596084


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/UnwrapCastInBinaryComparison.scala:
##########
@@ -452,9 +452,7 @@ object UnwrapCastInBinaryComparison extends 
Rule[LogicalPlan] {
       fromExp: Expression,
       toType: DataType,
       literalType: DataType): Boolean = {
-    DataTypeUtils.sameType(toType, literalType) &&
-      !fromExp.foldable &&
-      toType.isInstanceOf[NumericType] &&
+    DataTypeUtils.sameType(toType, literalType) && !fromExp.foldable &&

Review Comment:
   Hmm, although currently all callers's `toType` are `NumericType`, it doesn't 
prevent future caller to pass other types. I guess it is used to prevent that?



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