Skip to content

Commit cbc4d68

Browse files
kyleconroyclaude
andcommitted
Handle UUID clause in CREATE MATERIALIZED VIEW
The parser was not handling the UUID clause in CREATE MATERIALIZED VIEW statements, causing the rest of the statement to be skipped. Added UUID handling similar to how CREATE TABLE handles it. Fixes: - 00510_materizlized_view_and_deduplication_zookeeper stmt9, stmt10 - 00609_mv_index_in_in stmt7 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 660438e commit cbc4d68

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

.claude/settings.local.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(go run:*)",
5+
"Bash(go test:*)"
6+
]
7+
}
8+
}

parser/parser.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2761,6 +2761,15 @@ func (p *Parser) parseCreateView(create *ast.CreateQuery) {
27612761
}
27622762
}
27632763

2764+
// Handle UUID clause (CREATE MATERIALIZED VIEW name UUID 'uuid-value' ...)
2765+
// The UUID is not shown in EXPLAIN AST output, but we need to skip it
2766+
if p.currentIs(token.IDENT) && strings.ToUpper(p.current.Value) == "UUID" {
2767+
p.nextToken() // skip UUID
2768+
if p.currentIs(token.STRING) {
2769+
p.nextToken() // skip the UUID value
2770+
}
2771+
}
2772+
27642773
// Parse column definitions (e.g., CREATE VIEW v (x UInt64) AS SELECT ...)
27652774
// For MATERIALIZED VIEW, this can also include INDEX, PROJECTION, and PRIMARY KEY
27662775
if p.currentIs(token.LPAREN) {
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
{
2-
"explain_todo": {
3-
"stmt10": true,
4-
"stmt9": true
5-
}
6-
}
1+
{}
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
{
2-
"explain_todo": {
3-
"stmt7": true
4-
}
5-
}
1+
{}

0 commit comments

Comments
 (0)