You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/12/24 03:09:54 UTC
[GitHub] [spark] dchvn opened a new pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
dchvn opened a new pull request #35007:
URL: https://github.com/apache/spark/pull/35007
### What changes were proposed in this pull request?
According to [#cmt](https://github.com/apache/spark/pull/34819#discussion_r763629569), 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 throws `SparkException`. 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: ...` vs `Cannot 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"```
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #35007:
URL: https://github.com/apache/spark/pull/35007#issuecomment-1002933291
thanks, merging to master!
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #35007:
URL: https://github.com/apache/spark/pull/35007#issuecomment-1000728915
Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/51031/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #35007:
URL: https://github.com/apache/spark/pull/35007#issuecomment-1000662547
Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/51023/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #35007:
URL: https://github.com/apache/spark/pull/35007#issuecomment-1000626961
**[Test build #146548 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/146548/testReport)** for PR 35007 at commit [`e1793be`](https://github.com/apache/spark/commit/e1793be57ca6d81a87240ff8b1df959511c639a2).
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #35007:
URL: https://github.com/apache/spark/pull/35007#discussion_r775708585
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -540,8 +540,14 @@ object QueryCompilationErrors {
s"rename temporary view from '$oldName' to '$newName': destination view already exists")
}
- def databaseNotEmptyError(db: String, details: String): Throwable = {
- new AnalysisException(s"Database $db is not empty. One or more $details exist.")
+ def cannotDropNonemptyDatabaseError(db: String, details: String): Throwable = {
Review comment:
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.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan closed pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #35007:
URL: https://github.com/apache/spark/pull/35007
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dchvn commented on a change in pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
dchvn commented on a change in pull request #35007:
URL: https://github.com/apache/spark/pull/35007#discussion_r775692083
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -540,8 +540,14 @@ object QueryCompilationErrors {
s"rename temporary view from '$oldName' to '$newName': destination view already exists")
}
- def databaseNotEmptyError(db: String, details: String): Throwable = {
- new AnalysisException(s"Database $db is not empty. One or more $details exist.")
+ def cannotDropNonemptyDatabaseError(db: String, details: String): Throwable = {
Review comment:
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`.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dchvn commented on pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
dchvn commented on pull request #35007:
URL: https://github.com/apache/spark/pull/35007#issuecomment-1000626683
cc @cloud-fan @huaxingao. FYI !
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #35007:
URL: https://github.com/apache/spark/pull/35007#issuecomment-1000683164
**[Test build #146548 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/146548/testReport)** for PR 35007 at commit [`e1793be`](https://github.com/apache/spark/commit/e1793be57ca6d81a87240ff8b1df959511c639a2).
* This patch **fails Spark unit tests**.
* This patch merges cleanly.
* This patch adds no public classes.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dchvn commented on a change in pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
dchvn commented on a change in pull request #35007:
URL: https://github.com/apache/spark/pull/35007#discussion_r774853598
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/DropNamespaceSuiteBase.scala
##########
@@ -36,7 +36,7 @@ trait DropNamespaceSuiteBase extends QueryTest with DDLCommandTestUtils {
protected def builtinTopNamespaces: Seq[String] = Seq.empty
protected def isCasePreserving: Boolean = true
- protected def assertDropFails(): Unit
+ protected def namespaceAlias: String = "namespace"
Review comment:
Alias for namespace: `database` for v1 and `namespace` for v2
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dchvn commented on a change in pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
dchvn commented on a change in pull request #35007:
URL: https://github.com/apache/spark/pull/35007#discussion_r775429827
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -540,8 +540,14 @@ object QueryCompilationErrors {
s"rename temporary view from '$oldName' to '$newName': destination view already exists")
}
- def databaseNotEmptyError(db: String, details: String): Throwable = {
- new AnalysisException(s"Database $db is not empty. One or more $details exist.")
+ def cannotDropNonemptyDatabaseError(db: String, details: String): Throwable = {
+ new AnalysisException(s"Cannot drop a non-empty database: $db. One or more $details exist.")
+ }
+
+ def cannotDropNonemptyNamespaceError(namespace: Seq[String]): Throwable = {
+ new AnalysisException(
+ s"Cannot drop a non-empty namespace: ${namespace.quoted}. " +
+ "Use CASCADE option to drop a non-empty namespace.")
Review comment:
Yes, it works. I'll mention it in v1 error message. Thank you, @cloud-fan!
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #35007:
URL: https://github.com/apache/spark/pull/35007#discussion_r775455618
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -540,8 +540,14 @@ object QueryCompilationErrors {
s"rename temporary view from '$oldName' to '$newName': destination view already exists")
}
- def databaseNotEmptyError(db: String, details: String): Throwable = {
- new AnalysisException(s"Database $db is not empty. One or more $details exist.")
+ def cannotDropNonemptyDatabaseError(db: String, details: String): Throwable = {
Review comment:
Since we can remove the `details` parameter now.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #35007:
URL: https://github.com/apache/spark/pull/35007#discussion_r775871973
##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala
##########
@@ -196,7 +196,15 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat
db: String,
ignoreIfNotExists: Boolean,
cascade: Boolean): Unit = withClient {
- client.dropDatabase(db, ignoreIfNotExists, cascade)
+ try {
+ client.dropDatabase(db, ignoreIfNotExists, cascade)
+ } catch {
+ 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.")
Review comment:
shall we use `cannotDropNonemptyDatabaseError`?
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #35007:
URL: https://github.com/apache/spark/pull/35007#issuecomment-1000761530
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/146556/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #35007:
URL: https://github.com/apache/spark/pull/35007#issuecomment-1000746720
**[Test build #146556 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/146556/testReport)** for PR 35007 at commit [`a881d22`](https://github.com/apache/spark/commit/a881d22d90c2bad4002ad959a1b35a0fa08fc0cb).
* This patch **fails Spark unit tests**.
* This patch merges cleanly.
* This patch adds no public classes.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dchvn commented on pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
dchvn commented on pull request #35007:
URL: https://github.com/apache/spark/pull/35007#issuecomment-1000765672
Please take a look if you have time @cloud-fan, @huaxingao . Many thanks!
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #35007:
URL: https://github.com/apache/spark/pull/35007#issuecomment-1000649667
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/51023/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dchvn commented on a change in pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
dchvn commented on a change in pull request #35007:
URL: https://github.com/apache/spark/pull/35007#discussion_r775692083
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -540,8 +540,14 @@ object QueryCompilationErrors {
s"rename temporary view from '$oldName' to '$newName': destination view already exists")
}
- def databaseNotEmptyError(db: String, details: String): Throwable = {
- new AnalysisException(s"Database $db is not empty. One or more $details exist.")
+ def cannotDropNonemptyDatabaseError(db: String, details: String): Throwable = {
Review comment:
Sorry, I missed the call `cannotDropNonemptyDatabaseError(db, "tables")` and `cannotDropNonemptyDatabaseError(db, "functions")` in `InMemoryCatalog` file. So I think keep origin error message and also mention `use CASCADE`.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #35007:
URL: https://github.com/apache/spark/pull/35007#issuecomment-1000688476
**[Test build #146556 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/146556/testReport)** for PR 35007 at commit [`a881d22`](https://github.com/apache/spark/commit/a881d22d90c2bad4002ad959a1b35a0fa08fc0cb).
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #35007:
URL: https://github.com/apache/spark/pull/35007#issuecomment-1000686493
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/146548/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #35007:
URL: https://github.com/apache/spark/pull/35007#issuecomment-1000761530
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/146556/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #35007:
URL: https://github.com/apache/spark/pull/35007#issuecomment-1000731945
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/51031/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dchvn commented on a change in pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
dchvn commented on a change in pull request #35007:
URL: https://github.com/apache/spark/pull/35007#discussion_r775714218
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -540,8 +540,14 @@ object QueryCompilationErrors {
s"rename temporary view from '$oldName' to '$newName': destination view already exists")
}
- def databaseNotEmptyError(db: String, details: String): Throwable = {
- new AnalysisException(s"Database $db is not empty. One or more $details exist.")
+ def cannotDropNonemptyDatabaseError(db: String, details: String): Throwable = {
Review comment:
Updated. Thank you @cloud-fan!
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dchvn commented on a change in pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
dchvn commented on a change in pull request #35007:
URL: https://github.com/apache/spark/pull/35007#discussion_r774853399
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -540,8 +540,14 @@ object QueryCompilationErrors {
s"rename temporary view from '$oldName' to '$newName': destination view already exists")
}
- def databaseNotEmptyError(db: String, details: String): Throwable = {
- new AnalysisException(s"Database $db is not empty. One or more $details exist.")
+ def cannotDropNonemptyDatabaseError(db: String, details: String): Throwable = {
+ new AnalysisException(s"Cannot drop a non-empty database: $db. One or more $details exist.")
+ }
+
+ def cannotDropNonemptyNamespaceError(namespace: Seq[String]): Throwable = {
+ new AnalysisException(
+ s"Cannot drop a non-empty namespace: ${namespace.quoted}. " +
+ "Use CASCADE option to drop a non-empty namespace.")
Review comment:
Move `cannotDropNonemptyNamespaceError` from `QueryExecutionErrors` to `QueryCompilationErrors` as [SPARK-33539](https://issues.apache.org/jira/browse/SPARK-33539)
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dchvn commented on a change in pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
dchvn commented on a change in pull request #35007:
URL: https://github.com/apache/spark/pull/35007#discussion_r774853132
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -540,8 +540,14 @@ object QueryCompilationErrors {
s"rename temporary view from '$oldName' to '$newName': destination view already exists")
}
- def databaseNotEmptyError(db: String, details: String): Throwable = {
- new AnalysisException(s"Database $db is not empty. One or more $details exist.")
+ def cannotDropNonemptyDatabaseError(db: String, details: String): Throwable = {
+ new AnalysisException(s"Cannot drop a non-empty database: $db. One or more $details exist.")
+ }
Review comment:
Change the error message of v1 command.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #35007:
URL: https://github.com/apache/spark/pull/35007#issuecomment-1000731945
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/51031/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #35007:
URL: https://github.com/apache/spark/pull/35007#issuecomment-1000669072
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/51023/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #35007:
URL: https://github.com/apache/spark/pull/35007#issuecomment-1000686493
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/146548/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #35007:
URL: https://github.com/apache/spark/pull/35007#issuecomment-1000688476
**[Test build #146556 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/146556/testReport)** for PR 35007 at commit [`a881d22`](https://github.com/apache/spark/commit/a881d22d90c2bad4002ad959a1b35a0fa08fc0cb).
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #35007:
URL: https://github.com/apache/spark/pull/35007#issuecomment-1000708422
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/51031/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #35007:
URL: https://github.com/apache/spark/pull/35007#issuecomment-1000626961
**[Test build #146548 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/146548/testReport)** for PR 35007 at commit [`e1793be`](https://github.com/apache/spark/commit/e1793be57ca6d81a87240ff8b1df959511c639a2).
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dchvn commented on a change in pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
dchvn commented on a change in pull request #35007:
URL: https://github.com/apache/spark/pull/35007#discussion_r774854014
##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala
##########
@@ -196,7 +196,15 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat
db: String,
ignoreIfNotExists: Boolean,
cascade: Boolean): Unit = withClient {
- client.dropDatabase(db, ignoreIfNotExists, cascade)
+ try {
+ client.dropDatabase(db, ignoreIfNotExists, cascade)
+ } catch {
+ 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")
+ } else throw exception
+ }
Review comment:
Try-catch the error from hive catalog and re-throw it with a different error message that matches v1, v2
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #35007:
URL: https://github.com/apache/spark/pull/35007#issuecomment-1000669072
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/51023/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dchvn commented on a change in pull request #35007: [SPARK-37478][SQL][TESTS][FOLLOWUP] Unify v1 and v2 DROP NAMESPACE error
Posted by GitBox <gi...@apache.org>.
dchvn commented on a change in pull request #35007:
URL: https://github.com/apache/spark/pull/35007#discussion_r776591166
##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala
##########
@@ -196,7 +196,15 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat
db: String,
ignoreIfNotExists: Boolean,
cascade: Boolean): Unit = withClient {
- client.dropDatabase(db, ignoreIfNotExists, cascade)
+ try {
+ client.dropDatabase(db, ignoreIfNotExists, cascade)
+ } catch {
+ 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.")
Review comment:
Updated. Thank you @cloud-fan!
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org