Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/include/storage/irc_catalog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
35 changes: 31 additions & 4 deletions src/storage/irc_catalog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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();
}
Expand Down
3 changes: 3 additions & 0 deletions test/sql/cloud/r2_catalog/test_r2_create_table.test
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Loading