Skip to content

Commit aed95c0

Browse files
kyleconroyclaude
andcommitted
Map CLEAR_PROJECTION to DROP_PROJECTION in EXPLAIN AST output
ClickHouse EXPLAIN AST normalizes CLEAR PROJECTION to DROP_PROJECTION, similar to how CLEAR_COLUMN→DROP_COLUMN and CLEAR_INDEX→DROP_INDEX are already mapped. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 242667a commit aed95c0

3 files changed

Lines changed: 6 additions & 10 deletions

File tree

internal/explain/statements.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,6 +1684,10 @@ func explainAlterCommand(sb *strings.Builder, cmd *ast.AlterCommand, indent stri
16841684
if cmdType == ast.AlterClearIndex {
16851685
cmdType = ast.AlterDropIndex
16861686
}
1687+
// CLEAR_PROJECTION is shown as DROP_PROJECTION in EXPLAIN AST
1688+
if cmdType == ast.AlterClearProjection {
1689+
cmdType = ast.AlterDropProjection
1690+
}
16871691
// DELETE_WHERE is shown as DELETE in EXPLAIN AST
16881692
if cmdType == ast.AlterDeleteWhere {
16891693
cmdType = "DELETE"
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
{
2-
"explain_todo": {
3-
"stmt8": true
4-
}
5-
}
1+
{}
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
{
2-
"explain_todo": {
3-
"stmt19": true
4-
}
5-
}
1+
{}

0 commit comments

Comments
 (0)