TCGOGOGO opened a new issue, #9072:
URL: https://github.com/apache/iceberg/issues/9072
### Apache Iceberg version
1.3.1
### Query engine
Spark
### Please describe the bug 🐞
### Steps
1. Deploy an iceberg rest catalog server which wrapped the HadoopCatalog
2. Run spark sql to create a database (namespace)
### Expected
Database created successfully
### Actual
server side throw an expcetion, and below is part of the call stack
**org.apache.iceberg.exceptions.RESTException: Unable to process: Cannot
create namespace xxx: metadata is not supported**
at
org.apache.iceberg.rest.ErrorHandlers$DefaultErrorHandler.accept(ErrorHandlers.java:169)
at
org.apache.iceberg.rest.ErrorHandlers$NamespaceErrorHandler.accept(ErrorHandlers.java:128)
at
org.apache.iceberg.rest.ErrorHandlers$NamespaceErrorHandler.accept(ErrorHandlers.java:114)
at
org.apache.iceberg.rest.HTTPClient.throwFailure(HTTPClient.java:176)
at org.apache.iceberg.rest.HTTPClient.execute(HTTPClient.java:285)
at org.apache.iceberg.rest.HTTPClient.execute(HTTPClient.java:219)
at org.apache.iceberg.rest.HTTPClient.post(HTTPClient.java:330)
at org.apache.iceberg.rest.RESTClient.post(RESTClient.java:112)
at
org.apache.iceberg.rest.RESTSessionCatalog.createNamespace(RESTSessionCatalog.java:413)
at
org.apache.iceberg.catalog.BaseSessionCatalog$AsCatalog.createNamespace(BaseSessionCatalog.java:128)
at
org.apache.iceberg.rest.RESTCatalog.createNamespace(RESTCatalog.java:213)
at
org.apache.iceberg.spark.SparkCatalog.createNamespace(SparkCatalog.java:396)
at
org.apache.spark.sql.execution.datasources.v2.CreateNamespaceExec.run(CreateNamespaceExec.scala:47)
at
org.apache.spark.sql.execution.datasources.v2.V2CommandExec.result$lzycompute(V2CommandExec.scala:43)
at
org.apache.spark.sql.execution.datasources.v2.V2CommandExec.result(V2CommandExec.scala:43)
at
org.apache.spark.sql.execution.datasources.v2.V2CommandExec.executeCollect(V2CommandExec.scala:49)
### Analysis
There is a validation in HadoopCatalog.java, meta must be empty otherwise
the exception will be thrown

While since spark 3.0, an owner property will be carried by default when the
create namespace function executed, which corresponding to the meta parameters
above, and I think thats why this issue happen
see
https://github.com/apache/spark/blob/branch-3.0/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/CreateNamespaceExec.scala

--
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]