Skip to content

Commit 482ba61

Browse files
authored
Merge pull request #1160 from Altinity/bugfix/antalya-25.8/revert_in_for_cluster_requests
Revert support for 'IN' in cluster requests
2 parents ed69896 + 0b1db60 commit 482ba61

File tree

4 files changed

+82
-76
lines changed

4 files changed

+82
-76
lines changed

src/Storages/IStorageCluster.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ QueryProcessingStage::Enum IStorageCluster::getQueryProcessingStage(
573573
"object_storage_cluster_join_mode!='allow' is not supported without allow_experimental_analyzer=true");
574574

575575
auto info = getQueryTreeInfo(query_info.query_tree, context);
576-
if (info.has_join || info.has_cross_join || info.has_local_columns_in_where)
576+
if (info.has_join || info.has_cross_join /*|| info.has_local_columns_in_where*/)
577577
return QueryProcessingStage::Enum::FetchColumns;
578578
}
579579

tests/integration/test_database_iceberg/test.py

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,7 @@ def test_cluster_joins(started_cluster):
724724
FROM {CATALOG_NAME}.`{root_namespace}.{table_name}` AS t1
725725
JOIN {CATALOG_NAME}.`{root_namespace}.{table_name_2}` AS t2
726726
ON t1.tag=t2.id
727+
WHERE t1.tag < 10 AND t2.id < 20
727728
ORDER BY ALL
728729
SETTINGS
729730
object_storage_cluster='cluster_simple',
@@ -733,29 +734,30 @@ def test_cluster_joins(started_cluster):
733734

734735
assert res == "Jack\tSparrow\nJohn\tDow\n"
735736

736-
res = node.query(
737-
f"""
738-
SELECT name
739-
FROM {CATALOG_NAME}.`{root_namespace}.{table_name}`
740-
WHERE tag in (
741-
SELECT id
742-
FROM {CATALOG_NAME}.`{root_namespace}.{table_name_2}`
743-
)
744-
ORDER BY ALL
745-
SETTINGS
746-
object_storage_cluster='cluster_simple',
747-
object_storage_cluster_join_mode='local'
748-
"""
749-
)
750-
751-
assert res == "Jack\nJohn\n"
737+
#res = node.query(
738+
# f"""
739+
# SELECT name
740+
# FROM {CATALOG_NAME}.`{root_namespace}.{table_name}`
741+
# WHERE tag in (
742+
# SELECT id
743+
# FROM {CATALOG_NAME}.`{root_namespace}.{table_name_2}`
744+
# )
745+
# ORDER BY ALL
746+
# SETTINGS
747+
# object_storage_cluster='cluster_simple',
748+
# object_storage_cluster_join_mode='local'
749+
# """
750+
#)
751+
752+
#assert res == "Jack\nJohn\n"
752753

753754
res = node.query(
754755
f"""
755756
SELECT t1.name,t2.second_name
756757
FROM {CATALOG_NAME}.`{root_namespace}.{table_name}` AS t1
757758
JOIN `{table_name_local}` AS t2
758759
ON t1.tag=t2.id
760+
WHERE t1.tag < 10 AND t2.id < 20
759761
ORDER BY ALL
760762
SETTINGS
761763
object_storage_cluster='cluster_simple',
@@ -765,28 +767,29 @@ def test_cluster_joins(started_cluster):
765767

766768
assert res == "Jack\tBlack\nJohn\tSilver\n"
767769

768-
res = node.query(
769-
f"""
770-
SELECT name
771-
FROM {CATALOG_NAME}.`{root_namespace}.{table_name}`
772-
WHERE tag in (
773-
SELECT id
774-
FROM `{table_name_local}`
775-
)
776-
ORDER BY ALL
777-
SETTINGS
778-
object_storage_cluster='cluster_simple',
779-
object_storage_cluster_join_mode='local'
780-
"""
781-
)
782-
783-
assert res == "Jack\nJohn\n"
770+
#res = node.query(
771+
# f"""
772+
# SELECT name
773+
# FROM {CATALOG_NAME}.`{root_namespace}.{table_name}`
774+
# WHERE tag in (
775+
# SELECT id
776+
# FROM `{table_name_local}`
777+
# )
778+
# ORDER BY ALL
779+
# SETTINGS
780+
# object_storage_cluster='cluster_simple',
781+
# object_storage_cluster_join_mode='local'
782+
# """
783+
#)
784+
785+
#assert res == "Jack\nJohn\n"
784786

785787
res = node.query(
786788
f"""
787789
SELECT t1.name,t2.second_name
788790
FROM {CATALOG_NAME}.`{root_namespace}.{table_name}` AS t1
789791
CROSS JOIN `{table_name_local}` AS t2
792+
WHERE t1.tag < 10 AND t2.id < 20
790793
ORDER BY ALL
791794
SETTINGS
792795
object_storage_cluster='cluster_simple',

tests/integration/test_s3_cluster/test.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,19 +1163,19 @@ def test_joins(started_cluster):
11631163
res = list(map(str.split, result5.splitlines()))
11641164
assert len(res) == 6
11651165

1166-
result6 = node.query(
1167-
f"""
1168-
SELECT name FROM
1169-
s3Cluster('cluster_simple',
1170-
'http://minio1:9001/root/data/{{clickhouse,database}}/*', 'minio', '{minio_secret_key}', 'CSV',
1171-
'name String, value UInt32, polygon Array(Array(Tuple(Float64, Float64)))')
1172-
WHERE value IN (SELECT id FROM join_table)
1173-
ORDER BY name
1174-
SETTINGS object_storage_cluster_join_mode='local';
1175-
"""
1176-
)
1177-
res = list(map(str.split, result6.splitlines()))
1178-
assert len(res) == 25
1166+
#result6 = node.query(
1167+
# f"""
1168+
# SELECT name FROM
1169+
# s3Cluster('cluster_simple',
1170+
# 'http://minio1:9001/root/data/{{clickhouse,database}}/*', 'minio', '{minio_secret_key}', 'CSV',
1171+
# 'name String, value UInt32, polygon Array(Array(Tuple(Float64, Float64)))')
1172+
# WHERE value IN (SELECT id FROM join_table)
1173+
# ORDER BY name
1174+
# SETTINGS object_storage_cluster_join_mode='local';
1175+
# """
1176+
#)
1177+
#res = list(map(str.split, result6.splitlines()))
1178+
#assert len(res) == 25
11791179

11801180

11811181
def test_graceful_shutdown(started_cluster):

tests/integration/test_storage_iceberg/test.py

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3623,6 +3623,7 @@ def execute_spark_query(query: str, table_name):
36233623
FROM {creation_expression} AS t1
36243624
JOIN {creation_expression_2} AS t2
36253625
ON t1.tag=t2.id
3626+
WHERE t1.tag < 10 AND t2.id < 20
36263627
ORDER BY ALL
36273628
SETTINGS
36283629
object_storage_cluster='cluster_simple',
@@ -3632,29 +3633,30 @@ def execute_spark_query(query: str, table_name):
36323633

36333634
assert res == "jack\tsparrow\njohn\tdow\n"
36343635

3635-
res = instance.query(
3636-
f"""
3637-
SELECT name
3638-
FROM {creation_expression}
3639-
WHERE tag in (
3640-
SELECT id
3641-
FROM {creation_expression_2}
3642-
)
3643-
ORDER BY ALL
3644-
SETTINGS
3645-
object_storage_cluster='cluster_simple',
3646-
object_storage_cluster_join_mode='local'
3647-
"""
3648-
)
3636+
#res = instance.query(
3637+
# f"""
3638+
# SELECT name
3639+
# FROM {creation_expression}
3640+
# WHERE tag in (
3641+
# SELECT id
3642+
# FROM {creation_expression_2}
3643+
# )
3644+
# ORDER BY ALL
3645+
# SETTINGS
3646+
# object_storage_cluster='cluster_simple',
3647+
# object_storage_cluster_join_mode='local'
3648+
# """
3649+
#)
36493650

3650-
assert res == "jack\njohn\n"
3651+
#assert res == "jack\njohn\n"
36513652

36523653
res = instance.query(
36533654
f"""
36543655
SELECT t1.name,t2.second_name
36553656
FROM {creation_expression} AS t1
36563657
JOIN `{TABLE_NAME_LOCAL}` AS t2
36573658
ON t1.tag=t2.id
3659+
WHERE t1.tag < 10 AND t2.id < 20
36583660
ORDER BY ALL
36593661
SETTINGS
36603662
object_storage_cluster='cluster_simple',
@@ -3664,28 +3666,29 @@ def execute_spark_query(query: str, table_name):
36643666

36653667
assert res == "jack\tblack\njohn\tsilver\n"
36663668

3667-
res = instance.query(
3668-
f"""
3669-
SELECT name
3670-
FROM {creation_expression}
3671-
WHERE tag in (
3672-
SELECT id
3673-
FROM `{TABLE_NAME_LOCAL}`
3674-
)
3675-
ORDER BY ALL
3676-
SETTINGS
3677-
object_storage_cluster='cluster_simple',
3678-
object_storage_cluster_join_mode='local'
3679-
"""
3680-
)
3669+
#res = instance.query(
3670+
# f"""
3671+
# SELECT name
3672+
# FROM {creation_expression}
3673+
# WHERE tag in (
3674+
# SELECT id
3675+
# FROM `{TABLE_NAME_LOCAL}`
3676+
# )
3677+
# ORDER BY ALL
3678+
# SETTINGS
3679+
# object_storage_cluster='cluster_simple',
3680+
# object_storage_cluster_join_mode='local'
3681+
# """
3682+
#)
36813683

3682-
assert res == "jack\njohn\n"
3684+
#assert res == "jack\njohn\n"
36833685

36843686
res = instance.query(
36853687
f"""
36863688
SELECT t1.name,t2.second_name
36873689
FROM {creation_expression} AS t1
36883690
CROSS JOIN `{TABLE_NAME_LOCAL}` AS t2
3691+
WHERE t1.tag < 10 AND t2.id < 20
36893692
ORDER BY ALL
36903693
SETTINGS
36913694
object_storage_cluster='cluster_simple',

0 commit comments

Comments
 (0)