Skip to content

Commit 7bd21f3

Browse files
authored
Merge branch 'antalya-25.8' into mkmkme/dot-issue
2 parents 6ce83f0 + b3375be commit 7bd21f3

3 files changed

Lines changed: 40 additions & 3 deletions

File tree

src/Common/FailPoint.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ static struct InitFiu
118118
REGULAR(sleep_in_logs_flush) \
119119
ONCE(smt_commit_exception_before_op) \
120120
ONCE(backup_add_empty_memory_table) \
121-
REGULAR(refresh_task_stop_racing_for_running_refresh)
121+
REGULAR(refresh_task_stop_racing_for_running_refresh) \
122+
ONCE(database_iceberg_gcs)
122123

123124

124125
namespace FailPoints

src/Databases/DataLake/ICatalog.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@
55

66
#include <filesystem>
77

8+
#include <Common/FailPoint.h>
9+
810
namespace DB::ErrorCodes
911
{
1012
extern const int NOT_IMPLEMENTED;
1113
extern const int LOGICAL_ERROR;
14+
extern const int BAD_ARGUMENTS;
15+
}
16+
17+
namespace DB::FailPoints
18+
{
19+
extern const char database_iceberg_gcs[];
1220
}
1321

1422
namespace DataLake
@@ -49,9 +57,14 @@ StorageType parseStorageTypeFromString(const std::string & type)
4957
}
5058
if (capitalize_first_letter(storage_type_str) == "File")
5159
storage_type_str = "Local";
52-
53-
if (capitalize_first_letter(storage_type_str) == "S3a")
60+
else if (capitalize_first_letter(storage_type_str) == "S3a" || storage_type_str == "oss" || storage_type_str == "gs")
61+
{
62+
fiu_do_on(DB::FailPoints::database_iceberg_gcs,
63+
{
64+
throw DB::Exception(DB::ErrorCodes::BAD_ARGUMENTS, "Google cloud storage converts to S3");
65+
});
5466
storage_type_str = "S3";
67+
}
5568

5669
auto storage_type = magic_enum::enum_cast<StorageType>(capitalize_first_letter(storage_type_str));
5770

tests/integration/test_database_iceberg/test.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,3 +798,26 @@ def test_cluster_joins(started_cluster):
798798
)
799799

800800
assert res == "Jack\tBlack\nJack\tSilver\nJohn\tBlack\nJohn\tSilver\n"
801+
802+
def test_gcs(started_cluster):
803+
node = started_cluster.instances["node1"]
804+
805+
node.query("SYSTEM ENABLE FAILPOINT database_iceberg_gcs")
806+
node.query(
807+
f"""
808+
DROP DATABASE IF EXISTS {CATALOG_NAME};
809+
SET allow_database_iceberg = 1;
810+
"""
811+
)
812+
813+
with pytest.raises(Exception) as err:
814+
node.query(
815+
f"""
816+
CREATE DATABASE {CATALOG_NAME}
817+
ENGINE = DataLakeCatalog('http://rest:8181/v1', 'gcs', 'dummy')
818+
SETTINGS
819+
catalog_type = 'rest',
820+
warehouse = 'demo',
821+
"""
822+
)
823+
assert "Google cloud storage converts to S3" in str(err.value)

0 commit comments

Comments
 (0)