kbendick commented on code in PR #5083:
URL: https://github.com/apache/iceberg/pull/5083#discussion_r929583244
##########
spark/v3.2/spark-extensions/src/main/scala/org/apache/spark/sql/catalyst/analysis/RewriteMergeIntoTable.scala:
##########
@@ -80,91 +82,136 @@ object RewriteMergeIntoTable extends
RewriteRowLevelCommand {
private final val ROW_ID_REF = FieldReference(ROW_ID)
override def apply(plan: LogicalPlan): LogicalPlan = plan resolveOperators {
- case m @ MergeIntoIcebergTable(aliasedTable, source, cond, matchedActions,
notMatchedActions, None)
+ case m @ MergeIntoIcebergTable(aliasedTable, _, _, matchedActions,
notMatchedActions, None)
if m.resolved && m.aligned && matchedActions.isEmpty &&
notMatchedActions.size == 1 =>
EliminateSubqueryAliases(aliasedTable) match {
case r: DataSourceV2Relation =>
- // NOT MATCHED conditions may only refer to columns in source so
they can be pushed down
- val insertAction = notMatchedActions.head.asInstanceOf[InsertAction]
- val filteredSource = insertAction.condition match {
- case Some(insertCond) => Filter(insertCond, source)
- case None => source
+ rewriteMergeIntoTableWithSingleNotMatchedAction(m, r)
+ case v: View =>
Review Comment:
Under what situations could it be a view outside of Hadoop tables? Can we be
a bit more tight on the type here or not?
--
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]