-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error #35007
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
Conversation
|
cc @cloud-fan @huaxingao. FYI ! |
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.
Change the error message of v1 command.
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.
Move cannotDropNonemptyNamespaceError from QueryExecutionErrors to QueryCompilationErrors as SPARK-33539
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.
Does CASCADE work for the v1 command? If yes, we should also mention it in the v1 error message.
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.
Yes, it works. I'll mention it in v1 error message. Thank you, @cloud-fan!
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.
Alias for namespace: database for v1 and namespace for v2
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.
Try-catch the error from hive catalog and re-throw it with a different error message that matches v1, v2
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
Test build #146548 has finished for PR 35007 at commit
|
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
Test build #146556 has finished for PR 35007 at commit
|
|
Please take a look if you have time @cloud-fan, @huaxingao . Many thanks! |
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.
Seems we can remove the details parameter now.
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.
Sorry, I missed the call cannotDropNonemptyDatabaseError(db, "tables") and cannotDropNonemptyDatabaseError(db, "functions") in InMemoryCatalog file. So I think keep original error message and also mention use CASCADE.
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.
Actually, I think One or more $details exist is a repeat of non-empty database, and it's OK to remove it, to keep consistent with v2.
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.
Updated. Thank you @cloud-fan!
2fa0bc8 to
941207d
Compare
| case NonFatal(exception) => | ||
| if (exception.getClass.getName.equals("org.apache.hadoop.hive.ql.metadata.HiveException") | ||
| && exception.getMessage.contains(s"Database $db is not empty.")) { | ||
| throw new AnalysisException(s"Cannot drop a non-empty database: $db.") |
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.
shall we use cannotDropNonemptyDatabaseError?
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.
Updated. Thank you @cloud-fan!
|
thanks, merging to master! |
What changes were proposed in this pull request?
According to #cmt, unify the error of v1, v2 and hive external catalog in DROP NAMESPACE tests.
Why are the changes needed?
Currently, v1 and hive external catalog command throw
AnalysisException, while v2 command throwsSparkException. The error messages of v1 and hive catalog are also completely different from v2.So this PR is for unifying those errors to
AnalysisException. The error message will have one difference between v1/hive and v2:Cannot drop a non-empty database: ...vsCannot drop a non-empty namespace: ...Does this PR introduce any user-facing change?
No
How was this patch tested?
v1/v2 and Hive v1 DropNamespaceSuite:
$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *DropNamespaceSuite"