File tree Expand file tree Collapse file tree
tests/integration/test_database_iceberg Expand file tree Collapse file tree Original file line number Diff line number Diff 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
124125namespace FailPoints
Original file line number Diff line number Diff line change 55
66#include < filesystem>
77
8+ #include < Common/FailPoint.h>
9+
810namespace 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
1422namespace 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
Original file line number Diff line number Diff line change @@ -798,3 +798,26 @@ def test_cluster_joins(started_cluster):
798798 )
799799
800800 assert res == "Jack\t Black\n Jack\t Silver\n John\t Black\n John\t Silver\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 )
You can’t perform that action at this time.
0 commit comments