Skip to content

Commit f9c043f

Browse files
committed
Add ANY/ALL subquery operator normalization
- Map anyMatch to in (for expr == any subquery) - Map allMatch to notIn (for expr != all subquery) These SQL standard comparison operators with subqueries are normalized to ClickHouse's IN/NOT IN functions in EXPLAIN AST output. Fixes 5 statements in 02007_test_any_all_operators test.
1 parent 63368b8 commit f9c043f

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

internal/explain/format.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,9 @@ func NormalizeFunctionName(name string) string {
294294
"greatest": "greatest",
295295
"least": "least",
296296
"concat_ws": "concat",
297+
// SQL standard ANY/ALL subquery operators
298+
"anymatch": "in",
299+
"allmatch": "notIn",
297300
}
298301
if n, ok := normalized[strings.ToLower(name)]; ok {
299302
return n
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"explain_todo": {
3-
"stmt1": true,
43
"stmt10": true,
54
"stmt11": true,
65
"stmt12": true,
@@ -11,14 +10,10 @@
1110
"stmt17": true,
1211
"stmt18": true,
1312
"stmt19": true,
14-
"stmt2": true,
1513
"stmt20": true,
16-
"stmt3": true,
17-
"stmt4": true,
1814
"stmt5": true,
1915
"stmt6": true,
2016
"stmt7": true,
21-
"stmt8": true,
22-
"stmt9": true
17+
"stmt8": true
2318
}
2419
}

0 commit comments

Comments
 (0)