cloud-fan commented on code in PR #37625:
URL: https://github.com/apache/spark/pull/37625#discussion_r953590635


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -306,6 +306,47 @@ object OptimizeIn extends Rule[LogicalPlan] {
   }
 }
 
+/**
+ * SimplifyJoinCondition:
+ * Changes the join condition of type (key1=key2) || 
(isnull(key1)&&isnull(key2))
+ * to key1 <=> key2 to prevent join from converting to BNLJ in physical 
planning
+ * which is costly implementation of join.
+ */
+object SimplifyJoinCondition extends Rule[LogicalPlan] with PredicateHelper {
+  override def apply(plan: LogicalPlan): LogicalPlan = 
plan.transformWithPruning(
+    _.containsPattern(JOIN), ruleId) {
+    case join@Join(_, _, _, Some(joinCondition), _) =>

Review Comment:
   I think it's beneficial for `Filter` as well?



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