You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/07/26 06:45:45 UTC
[GitHub] [iceberg] kbendick commented on a diff in pull request #5083: support update/delete/merge into on hadoopTables using Spark
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org