-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-33862][SQL] Throw PartitionAlreadyExistsException if the target partition exists while renaming
#30866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-33862][SQL] Throw PartitionAlreadyExistsException if the target partition exists while renaming
#30866
Conversation
PartitionAlreadyExistsException if the target partition existing while renamingPartitionAlreadyExistsException if the target partition exists while renaming
|
Test build #133115 has finished for PR 30866 at commit
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, do you propose a behavior change from AnalysisException due to org.apache.hadoop.hive.ql.metadata.HiveException to PartitionAlreadyExistsException (extends AnalysisException) at Apache Spark 3.2.0?
Do you think we need a migration document, @MaxGekk ?
scala> sql("alter table t partition (b='a') rename to partition (b='a')").show
org.apache.spark.sql.AnalysisException: org.apache.hadoop.hive.ql.metadata.HiveException: Unable to rename partition. Partition already exists:default.t.[a];cc @gatorsmile
Yes, I do. This will be consistent with In-Memory catalog: spark/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/InMemoryCatalog.scala Line 474 in 3a299aa
As you mentioned |
…adyExistsException # Conflicts: # sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala
|
Kubernetes integration test starting |
|
Test build #133136 has finished for PR 30866 at commit
|
|
Kubernetes integration test status success |
|
Kubernetes integration test starting |
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala
Show resolved
Hide resolved
|
Kubernetes integration test status success |
HyukjinKwon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am good with this change but will leave it to @dongjoon-hyun since he's still reviewing it.
|
Test build #133142 has finished for PR 30866 at commit
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, LGTM for Apache Spark 3.2.
Thank you, @MaxGekk and @HyukjinKwon .
For the following, please file a JIRA ID and proceed as a documentation PR.
if we do that for the current changes, we should update the guide for: #30778 and #30711
@dongjoon-hyun Here is the PR for that: #30925 |
… in `HiveClientImpl` ### What changes were proposed in this pull request? Update the SQL migration guide about the changes made by: - #30778 - #30711 - #30866 ### Why are the changes needed? To inform users about the recent changes in the upcoming releases. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? N/A Closes #30925 from MaxGekk/sql-migr-guide-hiveclientimpl. Authored-by: Max Gekk <[email protected]> Signed-off-by: HyukjinKwon <[email protected]>
What changes were proposed in this pull request?
Throw
PartitionAlreadyExistsExceptionfromALTER TABLE .. RENAME TO PARTITIONfor a table from Hive V1 External Catalog in the case when the target partition already exists.Why are the changes needed?
Does this PR introduce any user-facing change?
Yes. After the changes, the partition renaming command throws
PartitionAlreadyExistsExceptionfor tables from the Hive catalog.How was this patch tested?
Added new UT: