Spark: Prohibit subqueries in conditions of MERGE operations#2118
Merged
rdblue merged 3 commits intoapache:masterfrom Jan 21, 2021
Merged
Spark: Prohibit subqueries in conditions of MERGE operations#2118rdblue merged 3 commits intoapache:masterfrom
rdblue merged 3 commits intoapache:masterfrom
Conversation
dilipbiswal
reviewed
Jan 20, 2021
...ons/src/main/scala/org/apache/spark/sql/catalyst/analysis/MergeIntoTablePredicateCheck.scala
Outdated
Show resolved
Hide resolved
dilipbiswal
reviewed
Jan 20, 2021
| import org.apache.spark.sql.catalyst.plans.logical.MergeIntoTable | ||
| import org.apache.spark.sql.catalyst.plans.logical.UpdateAction | ||
|
|
||
| object MergeIntoTablePredicateCheck extends (LogicalPlan => Unit) { |
Contributor
There was a problem hiding this comment.
@aokolnychyi I am thinking if we should have a single rule for checking all the plans that iceberg rewrites instead of having a separate check for each one ?
Contributor
Author
There was a problem hiding this comment.
I am fine either way. It did seem like the logic was separate but we can refactor this part out once we have UPDATEs.
Contributor
|
Looks good to me. |
Contributor
|
Change looks good to me. |
Contributor
|
LGTM |
dilipbiswal
approved these changes
Jan 20, 2021
...ons/src/main/scala/org/apache/spark/sql/catalyst/analysis/MergeIntoTablePredicateCheck.scala
Outdated
Show resolved
Hide resolved
| case DeleteAction(Some(cond)) => checkMergeIntoCondition(cond, "DELETE") | ||
| case UpdateAction(Some(cond), _) => checkMergeIntoCondition(cond, "UPDATE") | ||
| case InsertAction(Some(cond), _) => checkMergeIntoCondition(cond, "INSERT") | ||
| case _ => // OK |
Member
There was a problem hiding this comment.
Are we actually OK if something else gets through here? Shouldn't this be a "Unknown or unsupported action"?
Contributor
Author
There was a problem hiding this comment.
There may be actions without conditions too.
rdblue
approved these changes
Jan 21, 2021
XuQianJin-Stars
pushed a commit
to XuQianJin-Stars/iceberg
that referenced
this pull request
Mar 22, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR disables subqueries in conditions of MERGE operations until we figure out the best way to support them.