Skip to content

Commit c55e2eb

Browse files
authored
Merge pull request #659 from duckdb/v1.4-andium
V1.4 andium
2 parents a80ca84 + 1095c1f commit c55e2eb

3 files changed

Lines changed: 35 additions & 4 deletions

File tree

src/include/storage/irc_catalog.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ class IRCatalog : public Catalog {
9393
DatabaseSize GetDatabaseSize(ClientContext &context) override;
9494
void AddDefaultSupportedEndpoints();
9595
void AddS3TablesEndpoints();
96+
void AddGlueEndpoints();
9697
//! Whether or not this is an in-memory Iceberg database
9798
bool InMemory() override;
9899
string GetDBPath() override;

src/storage/irc_catalog.cpp

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,36 @@ void IRCatalog::AddS3TablesEndpoints() {
263263
supported_urls.insert("POST /v1/{prefix}/namespaces/{namespace}/tables/{table}");
264264
// drop table from a catalog
265265
supported_urls.insert("DELETE /v1/{prefix}/namespaces/{namespace}/tables/{table}");
266-
// table exists
267-
supported_urls.insert("HEAD /v1/{prefix}/namespaces/{namespace}/tables/{table}");
268266
// Rename a table from one identifier to another.
269267
supported_urls.insert("POST /v1/{prefix}/tables/rename");
270-
// commit updates to multiple tables in an atomic transaction
271-
supported_urls.insert("POST /v1/{prefix}/transactions/commit");
268+
// table exists
269+
supported_urls.insert("HEAD /v1/{prefix}/namespaces/{namespace}/tables/{table}");
270+
// namespace exists
271+
supported_urls.insert("HEAD /v1/{prefix}/namespaces/{namespace}");
272+
}
273+
274+
void IRCatalog::AddGlueEndpoints() {
275+
// insert namespaces based on REST API spec.
276+
// List namespaces
277+
supported_urls.insert("GET /v1/{prefix}/namespaces");
278+
// create namespace
279+
supported_urls.insert("POST /v1/{prefix}/namespaces");
280+
// Load metadata for a Namespace
281+
supported_urls.insert("GET /v1/{prefix}/namespaces/{namespace}");
282+
// Drop a namespace
283+
supported_urls.insert("DELETE /v1/{prefix}/namespaces/{namespace}");
284+
// list all table identifiers
285+
supported_urls.insert("GET /v1/{prefix}/namespaces/{namespace}/tables");
286+
// create table in the namespace
287+
supported_urls.insert("POST /v1/{prefix}/namespaces/{namespace}/tables");
288+
// get table from the catalog
289+
supported_urls.insert("GET /v1/{prefix}/namespaces/{namespace}/tables/{table}");
290+
// table exists
291+
supported_urls.insert("HEAD /v1/{prefix}/namespaces/{namespace}/tables/{table}");
292+
// commit updates to a table
293+
supported_urls.insert("POST /v1/{prefix}/namespaces/{namespace}/tables/{table}");
294+
// drop table from a catalog
295+
supported_urls.insert("DELETE /v1/{prefix}/namespaces/{namespace}/tables/{table}");
272296
}
273297

274298
void IRCatalog::GetConfig(ClientContext &context, IcebergEndpointType &endpoint_type) {
@@ -305,6 +329,9 @@ void IRCatalog::GetConfig(ClientContext &context, IcebergEndpointType &endpoint_
305329
if (!catalog_config.has_endpoints && endpoint_type == IcebergEndpointType::AWS_S3TABLES) {
306330
supported_urls.clear();
307331
AddS3TablesEndpoints();
332+
} else if (!catalog_config.has_endpoints && endpoint_type == IcebergEndpointType::AWS_GLUE) {
333+
supported_urls.clear();
334+
AddGlueEndpoints();
308335
} else if (!catalog_config.has_endpoints) {
309336
AddDefaultSupportedEndpoints();
310337
}

test/sql/cloud/r2_catalog/test_r2_create_table.test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ create schema IF NOT EXISTS my_datalake.test_create;
3838
statement ok
3939
use my_datalake.test_create;
4040

41+
statement ok
42+
drop table if exists test_basic_create;
43+
4144
statement ok
4245
create table test_basic_create (a int);
4346

0 commit comments

Comments
 (0)