From 06edc0af66130f21122854805483f69d11f1b163 Mon Sep 17 00:00:00 2001 From: Tmonster Date: Fri, 16 Jan 2026 17:07:15 +0100 Subject: [PATCH] fix supported urls for s3tables and glue --- src/include/storage/irc_catalog.hpp | 1 + src/storage/irc_catalog.cpp | 35 ++++++++++++++++--- .../r2_catalog/test_r2_create_table.test | 3 ++ 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/include/storage/irc_catalog.hpp b/src/include/storage/irc_catalog.hpp index cc5577f9c..59dd89014 100644 --- a/src/include/storage/irc_catalog.hpp +++ b/src/include/storage/irc_catalog.hpp @@ -93,6 +93,7 @@ class IRCatalog : public Catalog { DatabaseSize GetDatabaseSize(ClientContext &context) override; void AddDefaultSupportedEndpoints(); void AddS3TablesEndpoints(); + void AddGlueEndpoints(); //! Whether or not this is an in-memory Iceberg database bool InMemory() override; string GetDBPath() override; diff --git a/src/storage/irc_catalog.cpp b/src/storage/irc_catalog.cpp index f2f19d061..bf2278e77 100644 --- a/src/storage/irc_catalog.cpp +++ b/src/storage/irc_catalog.cpp @@ -263,12 +263,36 @@ void IRCatalog::AddS3TablesEndpoints() { supported_urls.insert("POST /v1/{prefix}/namespaces/{namespace}/tables/{table}"); // drop table from a catalog supported_urls.insert("DELETE /v1/{prefix}/namespaces/{namespace}/tables/{table}"); - // table exists - supported_urls.insert("HEAD /v1/{prefix}/namespaces/{namespace}/tables/{table}"); // Rename a table from one identifier to another. supported_urls.insert("POST /v1/{prefix}/tables/rename"); - // commit updates to multiple tables in an atomic transaction - supported_urls.insert("POST /v1/{prefix}/transactions/commit"); + // table exists + supported_urls.insert("HEAD /v1/{prefix}/namespaces/{namespace}/tables/{table}"); + // namespace exists + supported_urls.insert("HEAD /v1/{prefix}/namespaces/{namespace}"); +} + +void IRCatalog::AddGlueEndpoints() { + // insert namespaces based on REST API spec. + // List namespaces + supported_urls.insert("GET /v1/{prefix}/namespaces"); + // create namespace + supported_urls.insert("POST /v1/{prefix}/namespaces"); + // Load metadata for a Namespace + supported_urls.insert("GET /v1/{prefix}/namespaces/{namespace}"); + // Drop a namespace + supported_urls.insert("DELETE /v1/{prefix}/namespaces/{namespace}"); + // list all table identifiers + supported_urls.insert("GET /v1/{prefix}/namespaces/{namespace}/tables"); + // create table in the namespace + supported_urls.insert("POST /v1/{prefix}/namespaces/{namespace}/tables"); + // get table from the catalog + supported_urls.insert("GET /v1/{prefix}/namespaces/{namespace}/tables/{table}"); + // table exists + supported_urls.insert("HEAD /v1/{prefix}/namespaces/{namespace}/tables/{table}"); + // commit updates to a table + supported_urls.insert("POST /v1/{prefix}/namespaces/{namespace}/tables/{table}"); + // drop table from a catalog + supported_urls.insert("DELETE /v1/{prefix}/namespaces/{namespace}/tables/{table}"); } void IRCatalog::GetConfig(ClientContext &context, IcebergEndpointType &endpoint_type) { @@ -305,6 +329,9 @@ void IRCatalog::GetConfig(ClientContext &context, IcebergEndpointType &endpoint_ if (!catalog_config.has_endpoints && endpoint_type == IcebergEndpointType::AWS_S3TABLES) { supported_urls.clear(); AddS3TablesEndpoints(); + } else if (!catalog_config.has_endpoints && endpoint_type == IcebergEndpointType::AWS_GLUE) { + supported_urls.clear(); + AddGlueEndpoints(); } else if (!catalog_config.has_endpoints) { AddDefaultSupportedEndpoints(); } diff --git a/test/sql/cloud/r2_catalog/test_r2_create_table.test b/test/sql/cloud/r2_catalog/test_r2_create_table.test index 998ea1419..da5d57cf6 100644 --- a/test/sql/cloud/r2_catalog/test_r2_create_table.test +++ b/test/sql/cloud/r2_catalog/test_r2_create_table.test @@ -38,6 +38,9 @@ create schema IF NOT EXISTS my_datalake.test_create; statement ok use my_datalake.test_create; +statement ok +drop table if exists test_basic_create; + statement ok create table test_basic_create (a int);