Skip to content

Commit 73350a4

Browse files
committed
Handle engine parentheses in Explain output
When an engine has parentheses (like MergeTree()), output it with children count and empty ExpressionList, matching ClickHouse's format. Tests improved to 5090 passing (~74.6% of 6824).
1 parent 3ad6dc0 commit 73350a4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

internal/explain/statements.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ func explainCreateQuery(sb *strings.Builder, n *ast.CreateQuery, indent string,
4848
}
4949
fmt.Fprintf(sb, "%s Storage definition (children %d)\n", indent, storageChildren)
5050
if n.Engine != nil {
51-
fmt.Fprintf(sb, "%s Function %s\n", indent, n.Engine.Name)
51+
if n.Engine.HasParentheses {
52+
fmt.Fprintf(sb, "%s Function %s (children %d)\n", indent, n.Engine.Name, 1)
53+
fmt.Fprintf(sb, "%s ExpressionList\n", indent)
54+
} else {
55+
fmt.Fprintf(sb, "%s Function %s\n", indent, n.Engine.Name)
56+
}
5257
}
5358
if len(n.OrderBy) > 0 {
5459
if len(n.OrderBy) == 1 {

0 commit comments

Comments
 (0)