tanelk commented on pull request #29567:
URL: https://github.com/apache/spark/pull/29567#issuecomment-682375454


   Are you sure these rules are correct?
   The first one seems to fail if p is false
   And the seconds one seems to fail on all 3 values
   
   I tried a quick test and 4 out of 6 of these failed.
   ```
     val nullLiteral = Literal(null, BooleanType)
   
     Seq(Literal.TrueLiteral, Literal.FalseLiteral, nullLiteral).foreach(p => {
       assertEquivalent(If(p, nullLiteral, Literal.FalseLiteral), And(p, 
nullLiteral))
       assertEquivalent(If(p, nullLiteral, Literal.TrueLiteral), Or(p, 
nullLiteral))
     })
   
     private def assertEquivalent(e1: Expression, e2: Expression): Unit = {
       test("SPARK-32721: " + e1.toString) {
         checkEvaluation (e1, e2.eval (EmptyRow) )
       }
     }
   ```
   
   It seem that there might be some sort of equivalence here, but I'm not 100% 
sure how it should look like.


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