Skip to content

Commit dbcffed

Browse files
ianton-ruEnmk
authored andcommitted
Rename settings
1 parent 91683b1 commit dbcffed

File tree

8 files changed

+39
-39
lines changed

8 files changed

+39
-39
lines changed

src/Core/Settings.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5925,10 +5925,10 @@ Allow to create database with Engine=MaterializedPostgreSQL(...).
59255925
DECLARE(Bool, allow_experimental_query_deduplication, false, R"(
59265926
Experimental data deduplication for SELECT queries based on part UUIDs
59275927
)", EXPERIMENTAL) \
5928-
DECLARE(String, object_storage_cluster_function_cluster, "", R"(
5928+
DECLARE(String, object_storage_cluster, "", R"(
59295929
Cluster to make distributed requests to object storages with alternative syntax.
59305930
)", EXPERIMENTAL) \
5931-
DECLARE(UInt64, object_storage_cluster_function_max_hosts, 0, R"(
5931+
DECLARE(UInt64, object_storage_max_nodes, 0, R"(
59325932
Limit for hosts used for request in object storage cluster table functions - azureBlobStorageCluster, s3Cluster, hdfsCluster, etc.
59335933
Possible values:
59345934
- Positive integer.

src/Core/SettingsChangesHistory.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ static std::initializer_list<std::pair<ClickHouseVersion, SettingsChangesHistory
7171
{"http_response_headers", "", "", "New setting."},
7272
{"parallel_replicas_index_analysis_only_on_coordinator", true, true, "Index analysis done only on replica-coordinator and skipped on other replicas. Effective only with enabled parallel_replicas_local_plan"}, // enabling it was moved to 24.10
7373
{"least_greatest_legacy_null_behavior", true, false, "New setting"},
74-
{"object_storage_cluster_function_cluster", "", "", "New setting"},
75-
{"object_storage_cluster_function_max_hosts", 0, 0, "New setting"},
74+
{"object_storage_cluster", "", "", "New setting"},
75+
{"object_storage_max_nodes", 0, 0, "New setting"},
7676
}
7777
},
7878
{"24.11",

src/TableFunctions/TableFunctionObjectStorageClusterFallback.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace DB
99

1010
namespace Setting
1111
{
12-
extern const SettingsString object_storage_cluster_function_cluster;
12+
extern const SettingsString object_storage_cluster;
1313
}
1414

1515
namespace ErrorCodes
@@ -85,11 +85,11 @@ void TableFunctionObjectStorageClusterFallback<Definition, Base>::parseArguments
8585

8686
const auto & settings = context->getSettingsRef();
8787

88-
is_cluster_function = !settings[Setting::object_storage_cluster_function_cluster].value.empty();
88+
is_cluster_function = !settings[Setting::object_storage_cluster].value.empty();
8989

9090
if (is_cluster_function)
9191
{
92-
ASTPtr cluster_name_arg = std::make_shared<ASTLiteral>(settings[Setting::object_storage_cluster_function_cluster].value);
92+
ASTPtr cluster_name_arg = std::make_shared<ASTLiteral>(settings[Setting::object_storage_cluster].value);
9393
args.insert(args.begin(), cluster_name_arg);
9494
BaseCluster::parseArgumentsImpl(args, context);
9595
args.erase(args.begin());
@@ -159,7 +159,7 @@ void registerTableFunctionObjectStorageClusterFallback(TableFunctionFactory & fa
159159
.description=R"(The table function can be used to read the data stored on S3 in parallel for many nodes in a specified cluster or from single node.)",
160160
.examples{
161161
{"s3", "SELECT * FROM s3(url, format, structure)", ""},
162-
{"s3", "SELECT * FROM s3(url, format, structure) SETTINGS object_storage_cluster_function_cluster='cluster'", ""}
162+
{"s3", "SELECT * FROM s3(url, format, structure) SETTINGS object_storage_cluster='cluster'", ""}
163163
},
164164
},
165165
.allow_readonly = false
@@ -182,7 +182,7 @@ void registerTableFunctionObjectStorageClusterFallback(TableFunctionFactory & fa
182182
"azureBlobStorage",
183183
"SELECT * FROM azureBlobStorage(connection_string|storage_account_url, container_name, blobpath, "
184184
"[account_name, account_key, format, compression, structure]) "
185-
"SETTINGS object_storage_cluster_function_cluster='cluster'", ""
185+
"SETTINGS object_storage_cluster='cluster'", ""
186186
},
187187
}
188188
},
@@ -204,7 +204,7 @@ void registerTableFunctionObjectStorageClusterFallback(TableFunctionFactory & fa
204204
{
205205
"hdfs",
206206
"SELECT * FROM hdfs(url, format, compression, structure]) "
207-
"SETTINGS object_storage_cluster_function_cluster='cluster'", ""
207+
"SETTINGS object_storage_cluster='cluster'", ""
208208
},
209209
}
210210
},
@@ -226,7 +226,7 @@ void registerTableFunctionObjectStorageClusterFallback(TableFunctionFactory & fa
226226
{
227227
"icebergS3",
228228
"SELECT * FROM icebergS3(url, access_key_id, secret_access_key) "
229-
"SETTINGS object_storage_cluster_function_cluster='cluster'", ""
229+
"SETTINGS object_storage_cluster='cluster'", ""
230230
},
231231
}
232232
},
@@ -248,7 +248,7 @@ void registerTableFunctionObjectStorageClusterFallback(TableFunctionFactory & fa
248248
{
249249
"icebergAzure",
250250
"SELECT * FROM icebergAzure(url, access_key_id, secret_access_key) "
251-
"SETTINGS object_storage_cluster_function_cluster='cluster'", ""
251+
"SETTINGS object_storage_cluster='cluster'", ""
252252
},
253253
}
254254
},
@@ -269,7 +269,7 @@ void registerTableFunctionObjectStorageClusterFallback(TableFunctionFactory & fa
269269
},
270270
{
271271
"icebergHDFS",
272-
"SELECT * FROM icebergHDFS(url) SETTINGS object_storage_cluster_function_cluster='cluster'", ""
272+
"SELECT * FROM icebergHDFS(url) SETTINGS object_storage_cluster='cluster'", ""
273273
},
274274
}
275275
},
@@ -291,7 +291,7 @@ void registerTableFunctionObjectStorageClusterFallback(TableFunctionFactory & fa
291291
{
292292
"deltaLake",
293293
"SELECT * FROM deltaLake(url, access_key_id, secret_access_key) "
294-
"SETTINGS object_storage_cluster_function_cluster='cluster'", ""
294+
"SETTINGS object_storage_cluster='cluster'", ""
295295
},
296296
}
297297
},
@@ -312,7 +312,7 @@ void registerTableFunctionObjectStorageClusterFallback(TableFunctionFactory & fa
312312
},
313313
{
314314
"hudi",
315-
"SELECT * FROM hudi(url, access_key_id, secret_access_key) SETTINGS object_storage_cluster_function_cluster='cluster'", ""
315+
"SELECT * FROM hudi(url, access_key_id, secret_access_key) SETTINGS object_storage_cluster='cluster'", ""
316316
},
317317
}
318318
},

src/TableFunctions/TableFunctionObjectStorageClusterFallback.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ namespace DB
88
/**
99
* Class implementing s3/hdfs/azureBlobStorage(...) table functions,
1010
* which allow to use simple or distributed function variant based on settings.
11-
* If setting `object_storage_cluster_function_cluster` is empty,
11+
* If setting `object_storage_cluster` is empty,
1212
* simple single-host variant is used, if setting not empty, cluster variant is used.
13-
* `SELECT * FROM s3('s3://...', ...) SETTINGS object_storage_cluster_function_cluster='cluster'`
13+
* `SELECT * FROM s3('s3://...', ...) SETTINGS object_storage_cluster='cluster'`
1414
* is equal to
1515
* `SELECT * FROM s3Cluster('cluster', 's3://...', ...)`
1616
*/

tests/integration/test_s3_cluster/test.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def test_select_all(started_cluster):
129129
SELECT * from s3(
130130
'http://minio1:9001/root/data/{clickhouse,database}/*', 'minio', 'minio123', 'CSV',
131131
'name String, value UInt32, polygon Array(Array(Tuple(Float64, Float64)))') ORDER BY (name, value, polygon)
132-
SETTINGS object_storage_cluster_function_cluster = 'cluster_simple'"""
132+
SETTINGS object_storage_cluster = 'cluster_simple'"""
133133
)
134134

135135
assert TSV(pure_s3) == TSV(s3_distributed)
@@ -160,7 +160,7 @@ def test_count(started_cluster):
160160
'http://minio1:9001/root/data/{clickhouse,database}/*',
161161
'minio', 'minio123', 'CSV',
162162
'name String, value UInt32, polygon Array(Array(Tuple(Float64, Float64)))')
163-
SETTINGS object_storage_cluster_function_cluster = 'cluster_simple'"""
163+
SETTINGS object_storage_cluster = 'cluster_simple'"""
164164
)
165165

166166
assert TSV(pure_s3) == TSV(s3_distributed)
@@ -192,7 +192,7 @@ def test_count_macro(started_cluster):
192192
'http://minio1:9001/root/data/{clickhouse,database}/*',
193193
'minio', 'minio123', 'CSV',
194194
'name String, value UInt32, polygon Array(Array(Tuple(Float64, Float64)))')
195-
SETTINGS object_storage_cluster_function_cluster = 'cluster_simple'"""
195+
SETTINGS object_storage_cluster = 'cluster_simple'"""
196196
)
197197

198198
assert TSV(s3_macro) == TSV(s3_distributed)
@@ -250,7 +250,7 @@ def test_union_all(started_cluster):
250250
'name String, value UInt32, polygon Array(Array(Tuple(Float64, Float64)))')
251251
)
252252
ORDER BY (name, value, polygon)
253-
SETTINGS object_storage_cluster_function_cluster = 'cluster_simple'
253+
SETTINGS object_storage_cluster = 'cluster_simple'
254254
"""
255255
)
256256

@@ -285,7 +285,7 @@ def test_wrong_cluster(started_cluster):
285285
SELECT count(*) from s3(
286286
'http://minio1:9001/root/data/{clickhouse,database}/*',
287287
'minio', 'minio123', 'CSV', 'name String, value UInt32, polygon Array(Array(Tuple(Float64, Float64)))')
288-
SETTINGS object_storage_cluster_function_cluster = 'non_existing_cluster'
288+
SETTINGS object_storage_cluster = 'non_existing_cluster'
289289
"""
290290
)
291291

@@ -329,7 +329,7 @@ def test_skip_unavailable_shards(started_cluster):
329329
SELECT count(*) from s3(
330330
'http://minio1:9001/root/data/clickhouse/part1.csv',
331331
'minio', 'minio123', 'CSV', 'name String, value UInt32, polygon Array(Array(Tuple(Float64, Float64)))')
332-
SETTINGS skip_unavailable_shards = 1, object_storage_cluster_function_cluster = 'cluster_non_existent_port'
332+
SETTINGS skip_unavailable_shards = 1, object_storage_cluster = 'cluster_non_existent_port'
333333
"""
334334
)
335335

@@ -355,7 +355,7 @@ def test_unset_skip_unavailable_shards(started_cluster):
355355
SELECT count(*) from s3(
356356
'http://minio1:9001/root/data/clickhouse/part1.csv',
357357
'minio', 'minio123', 'CSV', 'name String, value UInt32, polygon Array(Array(Tuple(Float64, Float64)))')
358-
SETTINGS object_storage_cluster_function_cluster = 'cluster_non_existent_port'
358+
SETTINGS object_storage_cluster = 'cluster_non_existent_port'
359359
"""
360360
)
361361

@@ -495,14 +495,14 @@ def test_cluster_with_header(started_cluster):
495495
assert (
496496
node.query(
497497
"""SELECT * from s3('http://resolver:8080/bucket/key.csv', headers(MyCustomHeader = 'SomeValue'))
498-
SETTINGS object_storage_cluster_function_cluster = 'cluster_simple'"""
498+
SETTINGS object_storage_cluster = 'cluster_simple'"""
499499
)
500500
== "SomeValue\n"
501501
)
502502
assert (
503503
node.query(
504504
"""SELECT * from s3('http://resolver:8080/bucket/key.csv', headers(MyCustomHeader = 'SomeValue'), 'CSV')
505-
SETTINGS object_storage_cluster_function_cluster = 'cluster_simple'"""
505+
SETTINGS object_storage_cluster = 'cluster_simple'"""
506506
)
507507
== "SomeValue\n"
508508
)
@@ -527,14 +527,14 @@ def test_cluster_with_named_collection(started_cluster):
527527

528528
s3_cluster = node.query(
529529
"""SELECT * from s3(test_s3) ORDER BY (c1, c2, c3)
530-
SETTINGS object_storage_cluster_function_cluster = 'cluster_simple'"""
530+
SETTINGS object_storage_cluster = 'cluster_simple'"""
531531
)
532532

533533
assert TSV(pure_s3) == TSV(s3_cluster)
534534

535535
s3_cluster = node.query(
536536
"""SELECT * from s3(test_s3, structure='auto') ORDER BY (c1, c2, c3)
537-
SETTINGS object_storage_cluster_function_cluster = 'cluster_simple'"""
537+
SETTINGS object_storage_cluster = 'cluster_simple'"""
538538
)
539539

540540
assert TSV(pure_s3) == TSV(s3_cluster)
@@ -571,14 +571,14 @@ def test_cluster_format_detection(started_cluster):
571571

572572
result = node.query(
573573
"""SELECT * FROM s3('http://minio1:9001/root/data/generated/*', 'minio', 'minio123') order by c1, c2
574-
SETTINGS object_storage_cluster_function_cluster = 'cluster_simple'"""
574+
SETTINGS object_storage_cluster = 'cluster_simple'"""
575575
)
576576

577577
assert result == expected_result
578578

579579
result = node.query(
580580
"""SELECT * FROM s3('http://minio1:9001/root/data/generated/*', 'minio', 'minio123', auto, 'a String, b UInt64') order by a, b
581-
SETTINGS object_storage_cluster_function_cluster = 'cluster_simple'"""
581+
SETTINGS object_storage_cluster = 'cluster_simple'"""
582582
)
583583

584584
assert result == expected_result
@@ -633,35 +633,35 @@ def test_cluster_default_expression(started_cluster):
633633

634634
result = node.query(
635635
"""SELECT * FROM s3('http://minio1:9001/root/data/data{1,2,3}', 'minio', 'minio123', 'JSONEachRow', 'id UInt32, date Date DEFAULT 18262') order by id
636-
SETTINGS object_storage_cluster_function_cluster = 'cluster_simple'"""
636+
SETTINGS object_storage_cluster = 'cluster_simple'"""
637637
)
638638

639639
assert result == expected_result
640640

641641
result = node.query(
642642
"""SELECT * FROM s3('http://minio1:9001/root/data/data{1,2,3}', 'minio', 'minio123', 'auto', 'id UInt32, date Date DEFAULT 18262') order by id
643-
SETTINGS object_storage_cluster_function_cluster = 'cluster_simple'"""
643+
SETTINGS object_storage_cluster = 'cluster_simple'"""
644644
)
645645

646646
assert result == expected_result
647647

648648
result = node.query(
649649
"""SELECT * FROM s3('http://minio1:9001/root/data/data{1,2,3}', 'minio', 'minio123', 'JSONEachRow', 'id UInt32, date Date DEFAULT 18262', 'auto') order by id
650-
SETTINGS object_storage_cluster_function_cluster = 'cluster_simple'"""
650+
SETTINGS object_storage_cluster = 'cluster_simple'"""
651651
)
652652

653653
assert result == expected_result
654654

655655
result = node.query(
656656
"""SELECT * FROM s3('http://minio1:9001/root/data/data{1,2,3}', 'minio', 'minio123', 'auto', 'id UInt32, date Date DEFAULT 18262', 'auto') order by id
657-
SETTINGS object_storage_cluster_function_cluster = 'cluster_simple'"""
657+
SETTINGS object_storage_cluster = 'cluster_simple'"""
658658
)
659659

660660
assert result == expected_result
661661

662662
result = node.query(
663663
"""SELECT * FROM s3(test_s3_with_default) order by id
664-
SETTINGS object_storage_cluster_function_cluster = 'cluster_simple'"""
664+
SETTINGS object_storage_cluster = 'cluster_simple'"""
665665
)
666666

667667
assert result == expected_result

tests/integration/test_storage_azure_blob_storage/test_cluster.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def test_select_all(cluster):
100100
f"SELECT * from azureBlobStorage('{storage_account_url}', 'cont', 'test_cluster_select_all.csv', 'devstoreaccount1',"
101101
f"'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==', 'CSV',"
102102
f"'auto') "
103-
f"SETTINGS object_storage_cluster_function_cluster='simple_cluster'",
103+
f"SETTINGS object_storage_cluster='simple_cluster'",
104104
query_id=query_id_distributed_alt_syntax,
105105
)
106106
print(distributed_azure_alt_syntax)
@@ -169,7 +169,7 @@ def test_count(cluster):
169169
f"SELECT count(*) from azureBlobStorage('{storage_account_url}', 'cont', 'test_cluster_count.csv', "
170170
f"'devstoreaccount1','Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==', 'CSV',"
171171
f"'auto', 'key UInt64')"
172-
f"SETTINGS object_storage_cluster_function_cluster='simple_cluster'",
172+
f"SETTINGS object_storage_cluster='simple_cluster'",
173173
)
174174
print(distributed_azure_alt_syntax)
175175
assert TSV(pure_azure) == TSV(distributed_azure)

tests/integration/test_storage_hdfs/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ def test_hdfsCluster(started_cluster):
571571
query_id_cluster_alt_syntax = str(uuid.uuid4())
572572
actual = node1.query(
573573
"select id, _file as file_name, _path as file_path from hdfs('hdfs://hdfs1:9000/test_hdfsCluster/file*', 'TSV', 'id UInt32') order by id",
574-
settings={"object_storage_cluster_function_cluster":"test_cluster_two_shards"},
574+
settings={"object_storage_cluster":"test_cluster_two_shards"},
575575
query_id=query_id_cluster_alt_syntax,
576576
)
577577
assert actual == expected

tests/integration/test_storage_iceberg/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ def add_df(mode):
654654
instance.query(
655655
f"""
656656
SELECT * FROM {table_function_expr}
657-
SETTINGS object_storage_cluster_function_cluster='cluster_simple'
657+
SETTINGS object_storage_cluster='cluster_simple'
658658
""",
659659
query_id=query_id_cluster_alt_syntax,
660660
)

0 commit comments

Comments
 (0)