Commit b218c3d
Support CREATE INDEX expression without parentheses
ClickHouse allows CREATE INDEX without parentheses around the expression:
CREATE INDEX idx ON tbl date(ts) TYPE MinMax
This commit:
- Parses unparenthesized expressions in CREATE INDEX
- Tracks whether columns were parenthesized for correct EXPLAIN output:
- Single column in parens: Identifier
- Multiple columns in parens: empty Function tuple
- Unparenthesized expression: output directly
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 5121d5c commit b218c3d
4 files changed
Lines changed: 38 additions & 19 deletions
File tree
- ast
- internal/explain
- parser
- testdata/02487_create_index_normalize_functions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1283 | 1283 | | |
1284 | 1284 | | |
1285 | 1285 | | |
1286 | | - | |
1287 | | - | |
1288 | | - | |
1289 | | - | |
1290 | | - | |
1291 | | - | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
1292 | 1293 | | |
1293 | 1294 | | |
1294 | 1295 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2461 | 2461 | | |
2462 | 2462 | | |
2463 | 2463 | | |
2464 | | - | |
2465 | | - | |
2466 | | - | |
2467 | | - | |
2468 | | - | |
| 2464 | + | |
| 2465 | + | |
| 2466 | + | |
| 2467 | + | |
| 2468 | + | |
| 2469 | + | |
| 2470 | + | |
| 2471 | + | |
| 2472 | + | |
| 2473 | + | |
2469 | 2474 | | |
2470 | | - | |
| 2475 | + | |
2471 | 2476 | | |
2472 | 2477 | | |
2473 | 2478 | | |
| 2479 | + | |
| 2480 | + | |
| 2481 | + | |
| 2482 | + | |
| 2483 | + | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
| 2488 | + | |
2474 | 2489 | | |
2475 | | - | |
| 2490 | + | |
2476 | 2491 | | |
2477 | 2492 | | |
2478 | 2493 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2352 | 2352 | | |
2353 | 2353 | | |
2354 | 2354 | | |
2355 | | - | |
| 2355 | + | |
2356 | 2356 | | |
| 2357 | + | |
2357 | 2358 | | |
2358 | 2359 | | |
2359 | 2360 | | |
| |||
2375 | 2376 | | |
2376 | 2377 | | |
2377 | 2378 | | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
2378 | 2385 | | |
2379 | 2386 | | |
2380 | 2387 | | |
| |||
Lines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
| 1 | + | |
0 commit comments