Skip to content

Commit 49aa6c6

Browse files
committed
URL encode for Iceberg table names
1 parent 2fd834e commit 49aa6c6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Databases/DataLake/RestCatalog.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ DB::ReadWriteBufferFromHTTPPtr RestCatalog::createReadBuffer(
272272
{
273273
const auto & context = getContext();
274274

275-
Poco::URI url(base_url / endpoint);
275+
Poco::URI url(base_url / endpoint, false);
276276
if (!params.empty())
277277
url.setQueryParameters(params);
278278

@@ -511,7 +511,9 @@ DB::Names RestCatalog::parseTables(DB::ReadBuffer & buf, const std::string & bas
511511
for (size_t i = 0; i < identifiers_object->size(); ++i)
512512
{
513513
const auto current_table_json = identifiers_object->get(static_cast<int>(i)).extract<Poco::JSON::Object::Ptr>();
514-
const auto table_name = current_table_json->get("name").extract<String>();
514+
const auto table_name_raw = current_table_json->get("name").extract<String>();
515+
std::string table_name;
516+
Poco::URI::encode(table_name_raw, "/", table_name);
515517

516518
tables.push_back(base_namespace + "." + table_name);
517519
if (limit && tables.size() >= limit)

0 commit comments

Comments
 (0)