dbtsai commented on a change in pull request #33865:
URL: https://github.com/apache/spark/pull/33865#discussion_r698804486



##########
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:
       Maybe you can document it here saying those boolean simplifications are 
removed because UnwrapCastInBinaryComparison can take care of it. 

##########
File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercionSuite.scala
##########
@@ -1244,48 +1244,6 @@ class TypeCoercionSuite extends AnalysisTest {
     )
   }
 
-  test("BooleanEquality simplification") {
-    val be = TypeCoercion.BooleanEquality

Review comment:
       Are we able to keep the same tests?




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