MaxGekk commented on code in PR #43479:
URL: https://github.com/apache/spark/pull/43479#discussion_r1367943424
##########
common/utils/src/main/resources/error/error-classes.json:
##########
@@ -1553,6 +1553,11 @@
},
"sqlState" : "HY109"
},
+ "INVALID_DATABASE_NAME" : {
Review Comment:
Can't you re-use the existing error class:
`INVALID_SCHEMA_OR_RELATION_NAME`? If not, could you make it more specific.
##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/CreateNamespaceSuite.scala:
##########
@@ -25,4 +26,15 @@ import org.apache.spark.sql.execution.command.v1
*/
class CreateNamespaceSuite extends v1.CreateNamespaceSuiteBase with
CommandSuiteBase {
override def commandVersion: String =
super[CreateNamespaceSuiteBase].commandVersion
+
+ test("INVALID_DATABASE_NAME") {
+ val namespace = "ns1.ns2"
+ checkError(
+ exception = intercept[AnalysisException] {
+ sql(s"CREATE NAMESPACE $catalog.$namespace")
Review Comment:
When an user observes the error `The database name is not valid:`, not clear
why it is invalid. We should provide some clues.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]