nastra commented on issue #14263:
URL: https://github.com/apache/iceberg/issues/14263#issuecomment-3589001064
I took a quick look and the issue isn't at the REST layer. When a namespace
with a space is URL encoded, you'll get `a+b` and when it's URL decoded, you'll
get the original `a b` namespace. However, not every engine actually supports
spaces in namespace names. For example, **Hive** and the
**SparkSessionCatalog** don't support spaces as can be seen in this validation:
```
[INVALID_SCHEMA_OR_RELATION_NAME] `a b` is not a valid name for
tables/schemas. Valid names only contain alphabet characters, numbers and _.
SQLSTATE: 42602
org.apache.spark.sql.AnalysisException: [INVALID_SCHEMA_OR_RELATION_NAME] `a
b` is not a valid name for tables/schemas. Valid names only contain alphabet
characters, numbers and _. SQLSTATE: 42602
at
org.apache.spark.sql.errors.QueryCompilationErrors$.invalidNameForTableOrDatabaseError(QueryCompilationErrors.scala:1143)
at
org.apache.spark.sql.catalyst.catalog.SessionCatalog.validateName(SessionCatalog.scala:155)
at
org.apache.spark.sql.catalyst.catalog.SessionCatalog.createDatabase(SessionCatalog.scala:293)
at
org.apache.spark.sql.execution.datasources.v2.V2SessionCatalog.createNamespace(V2SessionCatalog.scala:424)
at
org.apache.iceberg.spark.SparkSessionCatalog.createNamespace(SparkSessionCatalog.java:123)
at
org.apache.spark.sql.execution.datasources.v2.CreateNamespaceExec.run(CreateNamespaceExec.scala:49)
```
```
Failed to create namespace a b in Hive Metastore
java.lang.RuntimeException: Failed to create namespace a b in Hive Metastore
at
org.apache.iceberg.hive.HiveCatalog.createNamespace(HiveCatalog.java:507)
at
org.apache.iceberg.spark.SparkCatalog.createNamespace(SparkCatalog.java:499)
at
org.apache.spark.sql.execution.datasources.v2.CreateNamespaceExec.run(CreateNamespaceExec.scala:49)
```
--
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]