diff --git a/src/TableFunctions/ITableFunctionCluster.h b/src/TableFunctions/ITableFunctionCluster.h index 920f271f0535..028e4388c8f2 100644 --- a/src/TableFunctions/ITableFunctionCluster.h +++ b/src/TableFunctions/ITableFunctionCluster.h @@ -75,6 +75,7 @@ class ITableFunctionCluster : public Base /// Cluster name is always the first cluster_name = checkAndGetLiteralArgument(args[0], "cluster_name"); + /// Remove check cluster existing here /// In query like /// remote('remote_host', xxxCluster('remote_cluster', ...)) diff --git a/tests/integration/test_s3_cluster/configs/cluster1.xml b/tests/integration/test_s3_cluster/configs/cluster1.xml new file mode 100644 index 000000000000..ce96069a070a --- /dev/null +++ b/tests/integration/test_s3_cluster/configs/cluster1.xml @@ -0,0 +1,16 @@ + + + + + + s0_0_1 + 9000 + + + s0_1_0 + 9000 + + + + + diff --git a/tests/integration/test_s3_cluster/test.py b/tests/integration/test_s3_cluster/test.py index 41729af789a9..49964d880ddb 100644 --- a/tests/integration/test_s3_cluster/test.py +++ b/tests/integration/test_s3_cluster/test.py @@ -91,7 +91,7 @@ def started_cluster(): cluster = ClickHouseCluster(__file__) cluster.add_instance( "s0_0_0", - main_configs=["configs/cluster.xml", "configs/named_collections.xml"], + main_configs=["configs/cluster.xml", "configs/named_collections.xml", "configs/cluster1.xml"], user_configs=["configs/users.xml"], macros={"replica": "node1", "shard": "shard1"}, with_minio=True, @@ -1215,6 +1215,29 @@ def test_joins(started_cluster): assert len(res) == 25 +def test_cluster_undefined_on_secondary_nodes(started_cluster): + node = started_cluster.instances["s0_0_0"] + + expected_result = node.query( + f""" + SELECT * from s3( + 'http://minio1:9001/root/data/{{clickhouse,database}}/*', 'minio', '{minio_secret_key}', 'CSV', + 'name String, value UInt32, polygon Array(Array(Tuple(Float64, Float64)))') ORDER BY (name, value, polygon) + """ + ) + + result = node.query( + f""" + SELECT * from s3Cluster( + 'undefined_cluster', + 'http://minio1:9001/root/data/{{clickhouse,database}}/*', 'minio', '{minio_secret_key}', 'CSV', + 'name String, value UInt32, polygon Array(Array(Tuple(Float64, Float64)))') ORDER BY (name, value, polygon) + """ + ) + + assert result == expected_result + + def test_object_storage_remote_initiator(started_cluster): node = started_cluster.instances["s0_0_0"]