kazuyukitanimura commented on a change in pull request #33865:
URL: https://github.com/apache/spark/pull/33865#discussion_r698750711
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala
##########
@@ -1121,25 +1121,6 @@ object TypeCoercion extends TypeCoercionBase {
// Hive treats (true = 1) as true and (false = 0) as true,
// all other cases are considered as false.
- // We may simplify the expression if one side is literal numeric values
- // TODO: Maybe these rules should go into the optimizer.
- case EqualTo(bool @ BooleanType(), Literal(value, _: NumericType))
- if trueValues.contains(value) => bool
- case EqualTo(bool @ BooleanType(), Literal(value, _: NumericType))
- if falseValues.contains(value) => Not(bool)
Review comment:
Yes, UnwrapCastInBinaryComparison nicely takes care of it.
--
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]