You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "mthirani2021 (via GitHub)" <gi...@apache.org> on 2025/10/06 18:15:31 UTC
[I] Encoding of Namespace having space to + [iceberg]
mthirani2021 opened a new issue, #14263:
URL: https://github.com/apache/iceberg/issues/14263
### Apache Iceberg version
1.10.0 (latest release)
### Query engine
Dremio
### Please describe the bug ๐
Problem: Trying to create a Namespace (NS) with a space in Polaris Catalog via Iceberg REST Utils. Loading the Namespace Metadata from Dremio Query Engine, throws error "Namespace does not exists"
<img width="383" height="44" alt="Image" src="https://github.com/user-attachments/assets/a280e47f-c173-46f2-a0de-731ba62cd4f5" />
How to Reproduce it:
1. Start the Dremio env in local
2. Spin up the Dremio Catalog server (using Polaris) for Enterprise version (with S3 or any storage provider)
3. Add the Dremio Catalog as a source
4. Try to create a folder with space. For e.g: "f 2"
Stack:
```
org.apache.iceberg.exceptions.NoSuchNamespaceException: Namespace does not exist: f+2 โ
โ at org.apache.iceberg.rest.ErrorHandlers$NamespaceErrorHandler.accept(ErrorHandlers.java:185) โ
โ at org.apache.iceberg.rest.ErrorHandlers$NamespaceErrorHandler.accept(ErrorHandlers.java:173) โ
โ at org.apache.iceberg.rest.HTTPClient.throwFailure(HTTPClient.java:240) โ
โ at org.apache.iceberg.rest.HTTPClient.execute(HTTPClient.java:336) โ
โ at org.apache.iceberg.rest.HTTPClient.execute(HTTPClient.java:297) โ
โ at org.apache.iceberg.rest.BaseHTTPClient.get(BaseHTTPClient.java:77) โ
โ at com.dremio.rest.catalog.impl.DremioCatalogRESTClientLogger.lambda$get$2(DremioCatalogRESTClientLogger.java:72) โ
โ at com.dremio.rest.catalog.impl.DremioCatalogRESTClientLogger.logRestCall(DremioCatalogRESTClientLogger.java:111) โ
โ at com.dremio.rest.catalog.impl.DremioCatalogRESTClientLogger.get(DremioCatalogRESTClientLogger.java:70) โ
โ at org.apache.iceberg.rest.RESTClient.get(RESTClient.java:97) โ
โ at org.apache.iceberg.rest.RESTClient.get(RESTClient.java:80) โ
โ at com.dremio.rest.catalog.impl.DremioRESTCatalog.loadNamespaceMetadata(DremioRESTCatalog.java:825)
```
From the DremioCatalog server logs, looks like space is converted to `+`:
`[06/Oct/2025:10:55:21 -0400] "GET /api/catalog/v1/default/namespaces/f+2 HTTP/1.1" 404 98`
Actual encoding of the space to `+` is happened at this LOC in Iceberg library and looks like this was a pre-existing bug to me.
[iceberg/core/src/main/java/org/apache/iceberg/rest/RESTUtil.java at main ยท apache/iceberg](https://github.com/apache/iceberg/blob/main/core/src/main/java/org/apache/iceberg/rest/RESTUtil.java#L180)
[iceberg/core/src/main/java/org/apache/iceberg/rest/RESTUtil.java at main ยท apache/iceberg](https://github.com/apache/iceberg/blob/main/core/src/main/java/org/apache/iceberg/rest/RESTUtil.java#L147)
FYI: Can still create NS in Polaris Catalog which has a space in it even it complains that. So I tried using REST API in plain and it worked:
<img width="647" height="476" alt="Image" src="https://github.com/user-attachments/assets/bd960ba5-9b3e-4d68-b33b-ae2d0d9e4279" />
### Willingness to contribute
- [ ] I can contribute a fix for this bug independently
- [x] I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- [x] I cannot contribute a fix for this bug at this time
--
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-unsubscribe@iceberg.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Encoding of Namespace having space to + [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Encoding of Namespace having space to + [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on issue #14263:
URL: https://github.com/apache/iceberg/issues/14263#issuecomment-3631074959
@omarsmak I was not able to reproduce this issue with the REST server from Iceberg's quickstart example and I don't see an error in the encoding/decoding of the REST client (see also my previous comment). Is this issue reproducible with Polaris?
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Encoding of Namespace having space to + [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #14263:
URL: https://github.com/apache/iceberg/issues/14263#issuecomment-4644642887
This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Encoding of Namespace having space to + [iceberg]
Posted by "omarsmak (via GitHub)" <gi...@apache.org>.
omarsmak commented on issue #14263:
URL: https://github.com/apache/iceberg/issues/14263#issuecomment-3631043106
@nastra I don't think we are saying the issue is at the REST layer but rather we think it is at the Iceberg REST client layer in https://github.com/apache/iceberg/blob/main/core/src/main/java/org/apache/iceberg/rest/RESTUtil.java#L147
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Encoding of Namespace having space to + [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #14263: Encoding of Namespace having space to +
URL: https://github.com/apache/iceberg/issues/14263
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Encoding of Namespace having space to + [iceberg]
Posted by "ajantha-bhat (via GitHub)" <gi...@apache.org>.
ajantha-bhat commented on issue #14263:
URL: https://github.com/apache/iceberg/issues/14263#issuecomment-3587959576
@nastra: Thoughts?
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Encoding of Namespace having space to + [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on issue #14263:
URL: https://github.com/apache/iceberg/issues/14263#issuecomment-3588910690
It's not entirely clear whether this issue is caused by Iceberg itself. So it would be good to have a reproducible test in Iceberg for this in `CatalogTests`/`TestRESTUtil` but also in a Spark test
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Encoding of Namespace having space to + [iceberg]
Posted by "mthirani2021 (via GitHub)" <gi...@apache.org>.
mthirani2021 commented on issue #14263:
URL: https://github.com/apache/iceberg/issues/14263#issuecomment-3373202602
@dimas-b @omarsmak
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Encoding of Namespace having space to + [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #14263:
URL: https://github.com/apache/iceberg/issues/14263#issuecomment-4763857926
This issue has been closed because it has not received any activity in the last 14 days since being marked as 'stale'
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org