Skip to content

Commit cd9ece0

Browse files
committed
Revert test_s3_cluster, test_storage_azure_blob_storage to upstream versions
1 parent 1ab258b commit cd9ece0

File tree

2 files changed

+3
-151
lines changed

2 files changed

+3
-151
lines changed

tests/integration/test_s3_cluster/test.py

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def started_cluster():
7373
"s0_0_0",
7474
main_configs=["configs/cluster.xml", "configs/named_collections.xml"],
7575
user_configs=["configs/users.xml"],
76-
macros={"replica": "replica1", "shard": "shard1"},
76+
macros={"replica": "node1", "shard": "shard1"},
7777
with_minio=True,
7878
with_zookeeper=True,
7979
)
@@ -413,20 +413,6 @@ def test_cluster_with_header(started_cluster):
413413
)
414414
== "SomeValue\n"
415415
)
416-
assert (
417-
node.query(
418-
"""SELECT * from s3('http://resolver:8080/bucket/key.csv', headers(MyCustomHeader = 'SomeValue'))
419-
SETTINGS object_storage_cluster = 'cluster_simple'"""
420-
)
421-
== "SomeValue\n"
422-
)
423-
assert (
424-
node.query(
425-
"""SELECT * from s3('http://resolver:8080/bucket/key.csv', headers(MyCustomHeader = 'SomeValue'), 'CSV')
426-
SETTINGS object_storage_cluster = 'cluster_simple'"""
427-
)
428-
== "SomeValue\n"
429-
)
430416

431417

432418
def test_cluster_with_named_collection(started_cluster):
@@ -446,20 +432,6 @@ def test_cluster_with_named_collection(started_cluster):
446432

447433
assert TSV(pure_s3) == TSV(s3_cluster)
448434

449-
s3_cluster = node.query(
450-
"""SELECT * from s3(test_s3) ORDER BY (c1, c2, c3)
451-
SETTINGS object_storage_cluster = 'cluster_simple'"""
452-
)
453-
454-
assert TSV(pure_s3) == TSV(s3_cluster)
455-
456-
s3_cluster = node.query(
457-
"""SELECT * from s3(test_s3, structure='auto') ORDER BY (c1, c2, c3)
458-
SETTINGS object_storage_cluster = 'cluster_simple'"""
459-
)
460-
461-
assert TSV(pure_s3) == TSV(s3_cluster)
462-
463435

464436
def test_cluster_format_detection(started_cluster):
465437
node = started_cluster.instances["s0_0_0"]

tests/integration/test_storage_azure_blob_storage/test_cluster.py

Lines changed: 2 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import random
99
import threading
1010
import time
11-
import uuid
1211

1312
import pytest
1413
from azure.storage.blob import BlobServiceClient
@@ -77,131 +76,21 @@ def test_select_all(cluster):
7776
)
7877
print(get_azure_file_content("test_cluster_select_all.csv", port))
7978

80-
query_id_pure = str(uuid.uuid4())
8179
pure_azure = azure_query(
8280
node,
8381
f"SELECT * from azureBlobStorage('{storage_account_url}', 'cont', 'test_cluster_select_all.csv', 'devstoreaccount1',"
8482
f"'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==', 'CSV','auto')",
85-
query_id=query_id_pure,
8683
)
8784
print(pure_azure)
88-
query_id_distributed = str(uuid.uuid4())
8985
distributed_azure = azure_query(
9086
node,
9187
f"SELECT * from azureBlobStorageCluster('simple_cluster', '{storage_account_url}', 'cont', 'test_cluster_select_all.csv', 'devstoreaccount1',"
9288
f"'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==', 'CSV',"
93-
f"'auto')",
94-
query_id=query_id_distributed,
89+
f"'auto')"
90+
"",
9591
)
9692
print(distributed_azure)
97-
query_id_distributed_alt_syntax = str(uuid.uuid4())
98-
distributed_azure_alt_syntax = azure_query(
99-
node,
100-
f"SELECT * from azureBlobStorage('{storage_account_url}', 'cont', 'test_cluster_select_all.csv', 'devstoreaccount1',"
101-
f"'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==', 'CSV',"
102-
f"'auto') "
103-
f"SETTINGS object_storage_cluster='simple_cluster'",
104-
query_id=query_id_distributed_alt_syntax,
105-
)
106-
print(distributed_azure_alt_syntax)
107-
azure_query(
108-
node,
109-
f"""
110-
DROP TABLE IF EXISTS azure_engine_table_single_node;
111-
CREATE TABLE azure_engine_table_single_node
112-
(key UInt64, data String)
113-
ENGINE=AzureBlobStorage(
114-
'{storage_account_url}',
115-
'cont',
116-
'test_cluster_select_all.csv',
117-
'devstoreaccount1',
118-
'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==',
119-
'CSV',
120-
'auto'
121-
)
122-
""",
123-
)
124-
query_id_engine_single_node = str(uuid.uuid4())
125-
azure_engine_single_node = azure_query(
126-
node,
127-
"SELECT * FROM azure_engine_table_single_node",
128-
query_id=query_id_engine_single_node,
129-
)
130-
azure_query(
131-
node,
132-
f"""
133-
DROP TABLE IF EXISTS azure_engine_table_distributed;
134-
CREATE TABLE azure_engine_table_distributed
135-
(key UInt64, data String)
136-
ENGINE=AzureBlobStorage(
137-
'{storage_account_url}',
138-
'cont',
139-
'test_cluster_select_all.csv',
140-
'devstoreaccount1',
141-
'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==',
142-
'CSV',
143-
'auto'
144-
)
145-
SETTINGS object_storage_cluster='simple_cluster'
146-
""",
147-
)
148-
query_id_engine_distributed = str(uuid.uuid4())
149-
azure_engine_distributed = azure_query(
150-
node,
151-
"SELECT * FROM azure_engine_table_distributed",
152-
query_id=query_id_engine_distributed,
153-
)
15493
assert TSV(pure_azure) == TSV(distributed_azure)
155-
assert TSV(pure_azure) == TSV(distributed_azure_alt_syntax)
156-
assert TSV(pure_azure) == TSV(azure_engine_single_node)
157-
assert TSV(pure_azure) == TSV(azure_engine_distributed)
158-
for _, node_ in cluster.instances.items():
159-
node_.query("SYSTEM FLUSH LOGS")
160-
nodes_pure = node.query(
161-
f"""
162-
SELECT uniq(hostname)
163-
FROM clusterAllReplicas('simple_cluster', system.query_log)
164-
WHERE type='QueryFinish'
165-
AND initial_query_id='{query_id_pure}'
166-
""",
167-
)
168-
assert int(nodes_pure) == 1
169-
nodes_distributed = node.query(
170-
f"""
171-
SELECT uniq(hostname)
172-
FROM clusterAllReplicas('simple_cluster', system.query_log)
173-
WHERE type='QueryFinish'
174-
AND initial_query_id='{query_id_distributed}'
175-
""",
176-
)
177-
assert int(nodes_distributed) == 3
178-
nodes_distributed_alt_syntax = node.query(
179-
f"""
180-
SELECT uniq(hostname)
181-
FROM clusterAllReplicas('simple_cluster', system.query_log)
182-
WHERE type='QueryFinish'
183-
AND initial_query_id='{query_id_distributed_alt_syntax}'
184-
""",
185-
)
186-
assert int(nodes_distributed_alt_syntax) == 3
187-
nodes_engine_single_node = node.query(
188-
f"""
189-
SELECT uniq(hostname)
190-
FROM clusterAllReplicas('simple_cluster', system.query_log)
191-
WHERE type='QueryFinish'
192-
AND initial_query_id='{query_id_engine_single_node}'
193-
""",
194-
)
195-
assert int(nodes_engine_single_node) == 1
196-
nodes_engine_distributed = node.query(
197-
f"""
198-
SELECT uniq(hostname)
199-
FROM clusterAllReplicas('simple_cluster', system.query_log)
200-
WHERE type='QueryFinish'
201-
AND initial_query_id='{query_id_engine_distributed}'
202-
""",
203-
)
204-
assert int(nodes_engine_distributed) == 3
20594

20695

20796
def test_count(cluster):
@@ -231,16 +120,7 @@ def test_count(cluster):
231120
f"'auto', 'key UInt64')",
232121
)
233122
print(distributed_azure)
234-
distributed_azure_alt_syntax = azure_query(
235-
node,
236-
f"SELECT count(*) from azureBlobStorage('{storage_account_url}', 'cont', 'test_cluster_count.csv', "
237-
f"'devstoreaccount1','Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==', 'CSV',"
238-
f"'auto', 'key UInt64')"
239-
f"SETTINGS object_storage_cluster='simple_cluster'",
240-
)
241-
print(distributed_azure_alt_syntax)
242123
assert TSV(pure_azure) == TSV(distributed_azure)
243-
assert TSV(pure_azure) == TSV(distributed_azure_alt_syntax)
244124

245125

246126
def test_union_all(cluster):

0 commit comments

Comments
 (0)