Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespace names with dot(.) not supported by JDBC catalog when listing namespaces #11990

Open
mingnuj opened this issue Jan 17, 2025 · 3 comments
Labels
question Further information is requested

Comments

@mingnuj
Copy link

mingnuj commented Jan 17, 2025

Query engine

REST API (JAVA)

Question

I am using the Iceberg REST API(tabulario/iceberg-rest) with PostgreSQL JDBC as the backend catalog. However, I have encountered an issue where namespace names containing . are not supported.

I have verified that namespaces with . are correctly stored and retrieved in the PostgreSQL database. From my observation, the REST API seems to interpret . in namespace names as levels by default.

I could not find any mention in the specification that namespace names with . are disallowed. Moreover, when using double quotes (") in the database, it is possible to use . in namespace names. I think it would be better to allow this in the REST API as well.

PostgreSQL Configuration:

docker run --name rest-postgres-test \
-p 5534:5432 \
-e POSTGRES_PASSWORD=postgres \
-e TZ=Asia/Seoul \
-v ./pgdata:/var/lib/postgresql/data \
-d postgres:latest

REST API Configuration:

docker run \
    -e CATALOG_WAREHOUSE=file://warehouse \
    -e CATALOG_IO__IMPL=org.apache.iceberg.hadoop.HadoopFileIO \
    -e CATALOG_CATALOG__IMPL=org.apache.iceberg.jdbc.JdbcCatalog \
    -e CATALOG_URI=jdbc:postgresql://{LOCAL_IP}:5534/postgres \
    -e CATALOG_JDBC_USER=postgres \
    -e CATALOG_JDBC_PASSWORD=postgres \
    -e REST_PORT=8183 \
    -v ./warehouse:/warehouse \
    -p 8183:8183 \
    tabulario/iceberg-rest:latest

Created [email protected] namespace and test table in that.
Namespace Display in PostgreSQL:

Image
Image

Could you confirm whether this is the intended behavior or a bug? If possible, I would like to request support for namespace names containing ..

@mingnuj mingnuj added the question Further information is requested label Jan 17, 2025
@nastra
Copy link
Contributor

nastra commented Jan 17, 2025

@mingnuj can you please share which issue you ran into? Any stack traces and error messages will help

@mingnuj
Copy link
Author

mingnuj commented Jan 17, 2025

@mingnuj can you please share which issue you ran into? Any stack traces and error messages will help

Thank you for your response. I'm sorry for not clarifying where the issue occurs.

The problem arises when retrieving the namespace.

When I connect to the database and use the listNamespaces operation for get namespace names. The full namespace name is [email protected], but only test@email is returned. As a result, I cannot access the tables within this namespace.

Is there any way to resolve this issue?

@nastra
Copy link
Contributor

nastra commented Jan 17, 2025

I checked and it turns out that this isn't an issue with the REST catalog but rather with the JDBC catalog itself. The problematic piece of code is here:

return Namespace.of(Iterables.toArray(SPLITTER_DOT.split(namespace), String.class));

This can be reproduced by updating

@@ -499,6 +499,8 @@ public abstract class CatalogTests<C extends Catalog & SupportsNamespaces> {
     catalog.createNamespace(withDot);
     assertThat(catalog.namespaceExists(withDot)).as("Namespace should exist").isTrue();

+    assertThat(catalog.listNamespaces()).contains(withDot);
+
     Map<String, String> properties = catalog.loadNamespaceMetadata(withDot);
     assertThat(properties).as("Properties should be accessible").isNotNull();
     assertThat(catalog.dropNamespace(withDot)).as("Dropping the namespace should succeed").isTrue();

and running TestJdbcCatalog locally.

/cc @jbonofre

@nastra nastra changed the title Namespace names with dot(.) not supported in Iceberg REST API Namespace names with dot(.) not supported by JDBC catalog when listing namespaces Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants