Skip to content

Requests sent to an Iceberg REST catalog are percent-encoded #86626

@FredKhayat

Description

@FredKhayat

Describe the unexpected behaviour

Consider the following query:

SELECT * FROM iceberg_catalog.`namespace.my%2Ftable`

The requests sent to the Iceberg Catalog are percent-encoded before being sent, which means that the table name my%2Ftable will be transformed to my/table.

This behaviour is different from other Iceberg clients, which do not percent-encode table names (ex: PyIceberg).

Which ClickHouse versions are affected?

All versions that support REST Catalogs

Potential Patch:

diff --git a/src/Databases/DataLake/RestCatalog.cpp b/src/Databases/DataLake/RestCatalog.cpp
index de7f8a587c6..1b2abc5b4c2 100644
--- a/src/Databases/DataLake/RestCatalog.cpp
+++ b/src/Databases/DataLake/RestCatalog.cpp
@@ -272,7 +272,7 @@ DB::ReadWriteBufferFromHTTPPtr RestCatalog::createReadBuffer(
 {
     const auto & context = getContext();
 
-    Poco::URI url(base_url / endpoint);
+    Poco::URI url(base_url / endpoint, false);
     if (!params.empty())
         url.setQueryParameters(params);
 

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp-datalakeData lake table formats (Iceberg/Delta/Hudi) integration.unexpected behaviourResult is unexpected, but not entirely wrong at the same time.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions