kazuyukitanimura commented on a change in pull request #33930:
URL: https://github.com/apache/spark/pull/33930#discussion_r705904648
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala
##########
@@ -797,6 +831,14 @@ object NullPropagation extends Rule[LogicalPlan] {
// a null literal.
case e: NullIntolerant if e.children.exists(isNullLiteral) =>
Literal.create(null, e.dataType)
+
+ // Using IsNull(e(inputs)) == IsNull(input1) or IsNull(input2) ... rules
+ // E.g. IsNull(Not(null)) == IsNull(null)
+ // E.g. IsNotNull(a === b) == And(IsNotNull(a), IsNotNull(b))
+ case IsNull(e: NullIntolerant) if !e.isInstanceOf[ExtractValue] &&
e.children.nonEmpty =>
Review comment:
`ExtractValue` is used for the query planner to extract the field. E.g.
the planner resolves column `a` to `a#123`
We cannot optimize `IsNull(a#123)` case.
I will add this explanation to the comment.
--
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]