Skip to content

Commit 51e9430

Browse files
authored
Merge pull request #448 from Tishj/disable_cascade_for_table_and_schema
Disable drops of all types with `CASCADE` for now
2 parents b6f589c + b90f8b0 commit 51e9430

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

src/storage/irc_catalog.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ optional_ptr<CatalogEntry> IRCatalog::CreateSchema(CatalogTransaction transactio
109109
}
110110

111111
void IRCatalog::DropSchema(ClientContext &context, DropInfo &info) {
112+
if (info.cascade) {
113+
throw NotImplementedException(
114+
"DROP SCHEMA <schema_name> CASCADE is not supported for Iceberg schemas currently");
115+
}
112116
vector<string> namespace_items;
113117
auto namespace_identifier = IRCAPI::ParseSchemaName(info.name);
114118
namespace_items.push_back(IRCAPI::GetEncodedSchemaName(namespace_identifier));

src/storage/irc_schema_entry.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ void IRCSchemaEntry::DropEntry(ClientContext &context, DropInfo &info) {
7272
if (table_info_it == tables.entries.end()) {
7373
throw InvalidInputException("Table %s does not exist");
7474
}
75+
if (info.cascade) {
76+
throw NotImplementedException("DROP TABLE <table_name> CASCADE is not supported for Iceberg tables currently");
77+
}
7578
auto &table_entry = table_info_it->second;
7679
auto lookupInfo = EntryLookupInfo(CatalogType::TABLE_ENTRY, table_name);
7780
auto catalog_transaction = CatalogTransaction::GetSystemCatalogTransaction(context);
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# name: test/sql/local/irc/test_cascade.test
2+
# group: [irc]
3+
4+
require-env ICEBERG_SERVER_AVAILABLE
5+
6+
require avro
7+
8+
require parquet
9+
10+
require iceberg
11+
12+
require httpfs
13+
14+
require aws
15+
16+
# Do not ignore 'HTTP' error messages!
17+
set ignore_error_messages
18+
19+
statement ok
20+
CREATE SECRET local_catalog_secret (
21+
TYPE S3,
22+
KEY_ID 'admin',
23+
SECRET 'password',
24+
ENDPOINT '127.0.0.1:9000',
25+
URL_STYLE 'path',
26+
USE_SSL 0
27+
);
28+
29+
statement ok
30+
ATTACH '' AS my_datalake (
31+
TYPE ICEBERG,
32+
CLIENT_ID 'admin',
33+
CLIENT_SECRET 'password',
34+
ENDPOINT 'http://127.0.0.1:8181'
35+
);
36+
37+
statement error
38+
DROP SCHEMA my_datalake.default CASCADE;
39+
----
40+
Not implemented Error: DROP SCHEMA <schema_name> CASCADE is not supported for Iceberg schemas currently
41+
42+
statement error
43+
DROP TABLE my_datalake.default.empty_table CASCADE;
44+
----
45+
Not implemented Error: DROP TABLE <table_name> CASCADE is not supported for Iceberg tables currently

0 commit comments

Comments
 (0)