rdblue commented on a change in pull request #2116:
URL: https://github.com/apache/iceberg/pull/2116#discussion_r560445155
##########
File path:
spark3-extensions/src/main/scala/org/apache/spark/sql/catalyst/optimizer/RewriteMergeInto.scala
##########
@@ -58,53 +61,136 @@ case class RewriteMergeInto(conf: SQLConf) extends
Rule[LogicalPlan] with Rewrit
override def apply(plan: LogicalPlan): LogicalPlan = {
plan resolveOperators {
+ case MergeIntoTable(target: DataSourceV2Relation, source: LogicalPlan,
cond, matchedActions, notMatchedActions)
+ if matchedActions.isEmpty =>
+
+ val (_, targetTableScan) = buildTargetScan(target, source, cond)
Review comment:
Do we need to perform the check if any match results in discarding the
source row? I guess we could turn off the optimization if the cardinality check
is enabled.
----------------------------------------------------------------
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]