Skip to content

Commit dac652f

Browse files
authored
Fix Dictionary range EXPLAIN output to not include children (#93)
1 parent a1a6e64 commit dac652f

File tree

2 files changed

+3
-23
lines changed

2 files changed

+3
-23
lines changed

internal/explain/dictionary.go

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -153,23 +153,7 @@ func explainDictionaryLayout(sb *strings.Builder, n *ast.DictionaryLayout, inden
153153
}
154154

155155
// explainDictionaryRange outputs a dictionary RANGE clause.
156+
// Note: ClickHouse's EXPLAIN does not output children for Dictionary range.
156157
func explainDictionaryRange(sb *strings.Builder, n *ast.DictionaryRange, indent string, depth int) {
157-
children := 0
158-
if n.Min != nil {
159-
children++
160-
}
161-
if n.Max != nil {
162-
children++
163-
}
164-
if children > 0 {
165-
fmt.Fprintf(sb, "%sDictionary range (children %d)\n", indent, children)
166-
if n.Min != nil {
167-
Node(sb, n.Min, depth+1)
168-
}
169-
if n.Max != nil {
170-
Node(sb, n.Max, depth+1)
171-
}
172-
} else {
173-
fmt.Fprintf(sb, "%sDictionary range\n", indent)
174-
}
158+
fmt.Fprintf(sb, "%sDictionary range\n", indent)
175159
}
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
{
2-
"explain_todo": {
3-
"stmt1": true
4-
}
5-
}
1+
{}

0 commit comments

Comments
 (0)