tokoko commented on code in PR #52185:
URL: https://github.com/apache/spark/pull/52185#discussion_r4476958895


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/RewriteMergeIntoTable.scala:
##########
@@ -391,13 +404,23 @@ object RewriteMergeIntoTable extends 
RewriteRowLevelCommand with PredicateHelper
       targetTable: LogicalPlan,
       cond: Expression): (LogicalPlan, Expression) = {
 
+    val (targetCond, joinCond) = splitTargetPredicates(targetTable, cond)
+    (Filter(targetCond, targetTable), joinCond)
+  }
+
+  // splits the given condition into a part that can be evaluated against the 
target table alone
+  // and a part that requires the source as well, each returned as a 
conjunction
+  private def splitTargetPredicates(

Review Comment:
   done, switched to `extractPredicatesWithinOutputSet`, added a test for 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]

Reply via email to