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
   
![image](https://github.com/apache/iceberg/assets/10043464/5908a025-9e0d-4f8d-a30c-45ae8db566e9)
   
   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
   
![image](https://github.com/apache/iceberg/assets/10043464/2a18f138-d3ea-4fd6-a918-45e7c0844ca1)


-- 
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: issues-unsubscr...@iceberg.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to