-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
walk.go
704 lines (630 loc) · 20.1 KB
/
walk.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
// Copyright 2016 The Cockroach Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
// implied. See the License for the specific language governing
// permissions and limitations under the License.
package sql
import (
"bytes"
"context"
"fmt"
"reflect"
"strconv"
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
"github.com/cockroachdb/cockroach/pkg/sql/sqlbase"
"github.com/cockroachdb/cockroach/pkg/util"
)
type observeVerbosity int
const (
observeMetadata observeVerbosity = iota
observeAlways
)
// planObserver is the interface to implement by components that need
// to visit a planNode tree.
// Used mainly by EXPLAIN, but also for the collector of back-references
// for view definitions.
type planObserver struct {
// replaceNode is invoked upon entering a tree node. It can replace the
// current planNode in the tree by returning a non-nil planNode. Returning
// nil will continue the recursion and not modify the current node.
replaceNode func(ctx context.Context, nodeName string, plan planNode) (planNode, error)
// enterNode is invoked upon entering a tree node. It can return false to
// stop the recursion at this node.
enterNode func(ctx context.Context, nodeName string, plan planNode) (bool, error)
// expr is invoked for each expression field in each node.
expr func(verbosity observeVerbosity, nodeName, fieldName string, n int, expr tree.Expr)
// attr is invoked for non-expression metadata in each node.
attr func(nodeName, fieldName, attr string)
// leaveNode is invoked upon leaving a tree node.
leaveNode func(nodeName string, plan planNode) error
}
// walkPlan performs a depth-first traversal of the plan given as
// argument, informing the planObserver of the node details at each
// level.
func walkPlan(ctx context.Context, plan planNode, observer planObserver) error {
v := makePlanVisitor(ctx, observer)
v.visit(plan)
return v.err
}
// planVisitor is the support structure for walkPlan().
type planVisitor struct {
observer planObserver
ctx context.Context
err error
}
// makePlanVisitor creates a planVisitor instance.
// ctx will be stored in the planVisitor and used when visiting planNode's and
// expressions..
func makePlanVisitor(ctx context.Context, observer planObserver) planVisitor {
return planVisitor{observer: observer, ctx: ctx}
}
// visit is the recursive function that supports walkPlan().
func (v *planVisitor) visit(plan planNode) planNode {
if v.err != nil {
return plan
}
name := nodeName(plan)
if v.observer.replaceNode != nil {
newNode, err := v.observer.replaceNode(v.ctx, name, plan)
if err != nil {
v.err = err
return plan
}
if newNode != nil {
return newNode
}
}
v.visitInternal(plan, name)
return plan
}
// visitConcrete is like visit, but provided for the case where a planNode is
// trying to recurse into a concrete planNode type, and not a planNode
// interface.
func (v *planVisitor) visitConcrete(plan planNode) {
if v.err != nil {
return
}
name := nodeName(plan)
v.visitInternal(plan, name)
}
func (v *planVisitor) visitInternal(plan planNode, name string) {
if v.err != nil {
return
}
recurse := true
if v.observer.enterNode != nil {
recurse, v.err = v.observer.enterNode(v.ctx, name, plan)
if v.err != nil {
return
}
}
if v.observer.leaveNode != nil {
defer func() {
if v.err != nil {
return
}
v.err = v.observer.leaveNode(name, plan)
}()
}
if !recurse {
return
}
switch n := plan.(type) {
case *valuesNode:
if v.observer.attr != nil {
suffix := "not yet populated"
if n.rows != nil {
suffix = fmt.Sprintf("%d row%s",
n.rows.Len(), util.Pluralize(int64(n.rows.Len())))
} else if n.tuples != nil {
suffix = fmt.Sprintf("%d row%s",
len(n.tuples), util.Pluralize(int64(len(n.tuples))))
}
description := fmt.Sprintf("%d column%s, %s",
len(n.columns), util.Pluralize(int64(len(n.columns))), suffix)
v.observer.attr(name, "size", description)
}
if v.observer.expr != nil {
for i, tuple := range n.tuples {
for j, expr := range tuple {
if n.columns[j].Omitted {
continue
}
var fieldName string
if v.observer.attr != nil {
fieldName = fmt.Sprintf("row %d, expr", i)
}
v.metadataExpr(name, fieldName, j, expr)
}
}
}
case *scanNode:
if v.observer.attr != nil {
v.observer.attr(name, "table", fmt.Sprintf("%s@%s", n.desc.Name, n.index.Name))
if n.noIndexJoin {
v.observer.attr(name, "hint", "no index join")
}
if n.specifiedIndex != nil {
v.observer.attr(name, "hint", fmt.Sprintf("force index @%s", n.specifiedIndex.Name))
}
spans := sqlbase.PrettySpans(n.index, n.spans, 2)
if spans != "" {
if spans == "-" {
spans = "ALL"
}
v.observer.attr(name, "spans", spans)
}
if n.hardLimit > 0 && isFilterTrue(n.filter) {
v.observer.attr(name, "limit", fmt.Sprintf("%d", n.hardLimit))
}
}
if v.observer.expr != nil {
v.expr(name, "filter", -1, n.filter)
}
case *filterNode:
if v.observer.expr != nil {
v.expr(name, "filter", -1, n.filter)
}
n.source.plan = v.visit(n.source.plan)
case *renderNode:
if v.observer.expr != nil {
for i, r := range n.render {
v.metadataExpr(name, "render", i, r)
}
}
n.source.plan = v.visit(n.source.plan)
case *indexJoinNode:
v.visitConcrete(n.index)
v.visitConcrete(n.table)
case *lookupJoinNode:
if v.observer.attr != nil {
v.observer.attr(name, "type", joinTypeStr(n.joinType))
}
if v.observer.expr != nil && n.onCond != nil && n.onCond != tree.DBoolTrue {
v.expr(name, "pred", -1, n.onCond)
}
n.input = v.visit(n.input)
v.visitConcrete(n.table)
case *joinNode:
if v.observer.attr != nil {
jType := joinTypeStr(n.joinType)
if n.joinType == sqlbase.InnerJoin && len(n.pred.leftColNames) == 0 && n.pred.onCond == nil {
jType = "cross"
}
v.observer.attr(name, "type", jType)
if len(n.pred.leftColNames) > 0 {
f := tree.NewFmtCtxWithBuf(tree.FmtSimple)
f.WriteByte('(')
f.FormatNode(&n.pred.leftColNames)
f.WriteString(") = (")
f.FormatNode(&n.pred.rightColNames)
f.WriteByte(')')
v.observer.attr(name, "equality", f.CloseAndGetString())
}
if len(n.mergeJoinOrdering) > 0 {
// The ordering refers to equality columns
eqCols := make(sqlbase.ResultColumns, len(n.pred.leftEqualityIndices))
for i := range eqCols {
eqCols[i].Name = fmt.Sprintf("(%s=%s)", n.pred.leftColNames[i], n.pred.rightColNames[i])
}
var order physicalProps
for _, o := range n.mergeJoinOrdering {
order.addOrderColumn(o.ColIdx, o.Direction)
}
v.observer.attr(name, "mergeJoinOrder", order.AsString(eqCols))
}
}
if v.observer.expr != nil {
v.expr(name, "pred", -1, n.pred.onCond)
}
n.left.plan = v.visit(n.left.plan)
n.right.plan = v.visit(n.right.plan)
case *limitNode:
if v.observer.expr != nil {
v.expr(name, "count", -1, n.countExpr)
v.expr(name, "offset", -1, n.offsetExpr)
}
n.plan = v.visit(n.plan)
case *distinctNode:
if v.observer.attr == nil {
n.plan = v.visit(n.plan)
break
}
if !n.distinctOnColIdxs.Empty() {
var buf bytes.Buffer
prefix := ""
columns := planColumns(n.plan)
n.distinctOnColIdxs.ForEach(func(col int) {
buf.WriteString(prefix)
buf.WriteString(columns[col].Name)
prefix = ", "
})
v.observer.attr(name, "distinct on", buf.String())
}
if !n.columnsInOrder.Empty() {
var buf bytes.Buffer
prefix := ""
columns := planColumns(n.plan)
for i, ok := n.columnsInOrder.Next(0); ok; i, ok = n.columnsInOrder.Next(i + 1) {
buf.WriteString(prefix)
buf.WriteString(columns[i].Name)
prefix = ", "
}
v.observer.attr(name, "order key", buf.String())
}
n.plan = v.visit(n.plan)
case *sortNode:
if v.observer.attr != nil {
var columns sqlbase.ResultColumns
if n.plan != nil {
columns = planColumns(n.plan)
}
// We use n.ordering and not plan.Ordering() because
// plan.Ordering() does not include the added sort columns not
// present in the output.
var order physicalProps
for _, o := range n.ordering {
order.addOrderColumn(o.ColIdx, o.Direction)
}
v.observer.attr(name, "order", order.AsString(columns))
switch ss := n.run.sortStrategy.(type) {
case *iterativeSortStrategy:
v.observer.attr(name, "strategy", "iterative")
case *sortTopKStrategy:
v.observer.attr(name, "strategy", fmt.Sprintf("top %d", ss.topK))
}
}
n.plan = v.visit(n.plan)
case *groupNode:
if v.observer.attr != nil {
inputCols := planColumns(n.plan)
for i, agg := range n.funcs {
var buf bytes.Buffer
if groupingCol, ok := n.aggIsGroupingColumn(i); ok {
buf.WriteString(inputCols[groupingCol].Name)
} else {
fmt.Fprintf(&buf, "%s(", agg.funcName)
if agg.argRenderIdx != noRenderIdx {
if agg.isDistinct() {
buf.WriteString("DISTINCT ")
}
buf.WriteString(inputCols[agg.argRenderIdx].Name)
}
buf.WriteByte(')')
if agg.filterRenderIdx != noRenderIdx {
fmt.Fprintf(&buf, " FILTER (WHERE %s)", inputCols[agg.filterRenderIdx].Name)
}
}
v.observer.attr(name, fmt.Sprintf("aggregate %d", i), buf.String())
}
if len(n.groupCols) > 0 {
v.observer.attr(name, "group by", colListStr(n.groupCols))
}
if len(n.orderedGroupCols) > 0 {
v.observer.attr(name, "ordered", colListStr(n.orderedGroupCols))
}
if n.isScalar {
v.observer.attr(name, "scalar", "")
}
}
n.plan = v.visit(n.plan)
case *windowNode:
if v.observer.expr != nil {
for i, agg := range n.funcs {
v.metadataExpr(name, "window", i, agg.expr)
}
for i, rexpr := range n.windowRender {
v.metadataExpr(name, "render", i, rexpr)
}
}
n.plan = v.visit(n.plan)
case *unionNode:
n.left = v.visit(n.left)
n.right = v.visit(n.right)
case *splitNode:
n.rows = v.visit(n.rows)
case *relocateNode:
n.rows = v.visit(n.rows)
case *insertNode:
if v.observer.attr != nil {
var buf bytes.Buffer
buf.WriteString(n.run.ti.tableDesc().Name)
buf.WriteByte('(')
for i, col := range n.run.insertCols {
if i > 0 {
buf.WriteString(", ")
}
buf.WriteString(col.Name)
}
buf.WriteByte(')')
v.observer.attr(name, "into", buf.String())
}
if v.observer.expr != nil {
for i, dexpr := range n.run.defaultExprs {
v.metadataExpr(name, "default", i, dexpr)
}
for i, cexpr := range n.run.checkHelper.Exprs {
v.metadataExpr(name, "check", i, cexpr)
}
}
n.source = v.visit(n.source)
case *upsertNode:
if v.observer.attr != nil {
var buf bytes.Buffer
buf.WriteString(n.run.tw.tableDesc().Name)
buf.WriteByte('(')
for i, col := range n.run.insertCols {
if i > 0 {
buf.WriteString(", ")
}
buf.WriteString(col.Name)
}
buf.WriteByte(')')
v.observer.attr(name, "into", buf.String())
}
if v.observer.expr != nil {
for i, dexpr := range n.run.defaultExprs {
v.metadataExpr(name, "default", i, dexpr)
}
for i, cexpr := range n.run.checkHelper.Exprs {
v.metadataExpr(name, "check", i, cexpr)
}
n.run.tw.walkExprs(func(d string, i int, e tree.TypedExpr) {
v.metadataExpr(name, d, i, e)
})
}
n.source = v.visit(n.source)
case *updateNode:
if v.observer.attr != nil {
v.observer.attr(name, "table", n.run.tu.tableDesc().Name)
if len(n.run.tu.ru.UpdateCols) > 0 {
var buf bytes.Buffer
for i, col := range n.run.tu.ru.UpdateCols {
if i > 0 {
buf.WriteString(", ")
}
buf.WriteString(col.Name)
}
v.observer.attr(name, "set", buf.String())
}
}
if v.observer.expr != nil {
for i, cexpr := range n.run.computeExprs {
v.metadataExpr(name, "computed", i, cexpr)
}
for i, cexpr := range n.run.checkHelper.Exprs {
v.metadataExpr(name, "check", i, cexpr)
}
}
// An updater has no sub-expressions, so nothing special to do here.
n.source = v.visit(n.source)
case *deleteNode:
if v.observer.attr != nil {
v.observer.attr(name, "from", n.run.td.tableDesc().Name)
}
// A deleter has no sub-expressions, so nothing special to do here.
n.source = v.visit(n.source)
case *serializeNode:
v.visitConcrete(n.source)
case *rowCountNode:
v.visitConcrete(n.source)
case *createTableNode:
if n.n.As() {
n.sourcePlan = v.visit(n.sourcePlan)
}
case *createViewNode:
if v.observer.attr != nil {
v.observer.attr(name, "query", tree.AsStringWithFlags(n.n.AsSource, tree.FmtParsable))
}
case *setVarNode:
if v.observer.expr != nil {
for i, texpr := range n.typedValues {
v.metadataExpr(name, "value", i, texpr)
}
}
case *setClusterSettingNode:
if v.observer.expr != nil && n.value != nil {
v.metadataExpr(name, "value", -1, n.value)
}
case *delayedNode:
if v.observer.attr != nil {
v.observer.attr(name, "source", n.name)
}
if n.plan != nil {
n.plan = v.visit(n.plan)
}
case *explainDistSQLNode:
n.plan = v.visit(n.plan)
case *ordinalityNode:
n.source = v.visit(n.source)
case *spoolNode:
if n.hardLimit > 0 && v.observer.attr != nil {
v.observer.attr(name, "limit", fmt.Sprintf("%d", n.hardLimit))
}
n.source = v.visit(n.source)
case *showTraceReplicaNode:
n.plan = v.visit(n.plan)
case *explainPlanNode:
if v.observer.attr != nil {
v.observer.attr(name, "expanded", strconv.FormatBool(n.expanded))
}
n.plan = v.visit(n.plan)
case *cancelQueriesNode:
n.rows = v.visit(n.rows)
case *cancelSessionsNode:
n.rows = v.visit(n.rows)
case *controlJobsNode:
n.rows = v.visit(n.rows)
case *setZoneConfigNode:
if v.observer.expr != nil {
v.metadataExpr(name, "yaml", -1, n.yamlConfig)
}
case *projectSetNode:
if v.observer.expr != nil {
for i, texpr := range n.exprs {
v.metadataExpr(name, "render", i, texpr)
}
}
n.source = v.visit(n.source)
}
}
// expr wraps observer.expr() and provides it with the current node's
// name.
func (v *planVisitor) expr(nodeName string, fieldName string, n int, expr tree.Expr) {
if v.err != nil {
return
}
v.observer.expr(observeAlways, nodeName, fieldName, n, expr)
}
// metadata wraps observer.expr() and provides it with the current node's
// name, with verbosity = metadata.
func (v *planVisitor) metadataExpr(nodeName string, fieldName string, n int, expr tree.Expr) {
if v.err != nil {
return
}
v.observer.expr(observeMetadata, nodeName, fieldName, n, expr)
}
// nodeName returns the name of the given planNode as string. The
// node's current state is taken into account, e.g. sortNode has
// either name "sort" or "nosort" depending on whether sorting is
// needed.
func nodeName(plan planNode) string {
// Some nodes have custom names depending on attributes.
switch n := plan.(type) {
case *sortNode:
if !n.needSort {
return "nosort"
}
case *scanNode:
if n.reverse {
return "revscan"
}
case *unionNode:
if n.emitAll {
return "append"
}
}
name, ok := planNodeNames[reflect.TypeOf(plan)]
if !ok {
panic(fmt.Sprintf("name missing for type %T", plan))
}
return name
}
func joinTypeStr(t sqlbase.JoinType) string {
switch t {
case sqlbase.InnerJoin:
return "inner"
case sqlbase.LeftOuterJoin:
return "left outer"
case sqlbase.RightOuterJoin:
return "right outer"
case sqlbase.FullOuterJoin:
return "full outer"
case sqlbase.LeftSemiJoin:
return "semi"
case sqlbase.LeftAntiJoin:
return "anti"
}
panic(fmt.Sprintf("unknown join type %s", t))
}
func colListStr(cols []int) string {
// Display the columns as @1-@x if possible.
shorthand := true
for i, idx := range cols {
if idx != i {
shorthand = false
break
}
}
if shorthand && len(cols) > 1 {
return fmt.Sprintf("@1-@%d", len(cols))
}
var buf bytes.Buffer
for i, idx := range cols {
if i > 0 {
buf.WriteByte(',')
}
fmt.Fprintf(&buf, "@%d", idx+1)
}
return buf.String()
}
// planNodeNames is the mapping from node type to strings. The
// strings are constant and not precomputed so that the type names can
// be changed without changing the output of "EXPLAIN".
var planNodeNames = map[reflect.Type]string{
reflect.TypeOf(&alterIndexNode{}): "alter index",
reflect.TypeOf(&alterSequenceNode{}): "alter sequence",
reflect.TypeOf(&alterTableNode{}): "alter table",
reflect.TypeOf(&alterUserSetPasswordNode{}): "alter user",
reflect.TypeOf(&cancelQueriesNode{}): "cancel queries",
reflect.TypeOf(&cancelSessionsNode{}): "cancel sessions",
reflect.TypeOf(&controlJobsNode{}): "control jobs",
reflect.TypeOf(&createDatabaseNode{}): "create database",
reflect.TypeOf(&createIndexNode{}): "create index",
reflect.TypeOf(&createSequenceNode{}): "create sequence",
reflect.TypeOf(&createStatsNode{}): "create statistics",
reflect.TypeOf(&createTableNode{}): "create table",
reflect.TypeOf(&CreateUserNode{}): "create user/role",
reflect.TypeOf(&createViewNode{}): "create view",
reflect.TypeOf(&delayedNode{}): "virtual table",
reflect.TypeOf(&deleteNode{}): "delete",
reflect.TypeOf(&distinctNode{}): "distinct",
reflect.TypeOf(&dropDatabaseNode{}): "drop database",
reflect.TypeOf(&dropIndexNode{}): "drop index",
reflect.TypeOf(&dropSequenceNode{}): "drop sequence",
reflect.TypeOf(&dropTableNode{}): "drop table",
reflect.TypeOf(&DropUserNode{}): "drop user/role",
reflect.TypeOf(&dropViewNode{}): "drop view",
reflect.TypeOf(&explainDistSQLNode{}): "explain distsql",
reflect.TypeOf(&explainPlanNode{}): "explain plan",
reflect.TypeOf(&filterNode{}): "filter",
reflect.TypeOf(&groupNode{}): "group",
reflect.TypeOf(&hookFnNode{}): "plugin",
reflect.TypeOf(&indexJoinNode{}): "index-join",
reflect.TypeOf(&insertNode{}): "insert",
reflect.TypeOf(&joinNode{}): "join",
reflect.TypeOf(&limitNode{}): "limit",
reflect.TypeOf(&lookupJoinNode{}): "lookup-join",
reflect.TypeOf(&ordinalityNode{}): "ordinality",
reflect.TypeOf(&projectSetNode{}): "project set",
reflect.TypeOf(&relocateNode{}): "relocate",
reflect.TypeOf(&renameColumnNode{}): "rename column",
reflect.TypeOf(&renameDatabaseNode{}): "rename database",
reflect.TypeOf(&renameIndexNode{}): "rename index",
reflect.TypeOf(&renameTableNode{}): "rename table",
reflect.TypeOf(&renderNode{}): "render",
reflect.TypeOf(&rowCountNode{}): "count",
reflect.TypeOf(&rowSourceToPlanNode{}): "row source to plan node",
reflect.TypeOf(&scanNode{}): "scan",
reflect.TypeOf(&scatterNode{}): "scatter",
reflect.TypeOf(&scrubNode{}): "scrub",
reflect.TypeOf(&sequenceSelectNode{}): "sequence select",
reflect.TypeOf(&serializeNode{}): "run",
reflect.TypeOf(&setClusterSettingNode{}): "set cluster setting",
reflect.TypeOf(&setVarNode{}): "set",
reflect.TypeOf(&setZoneConfigNode{}): "configure zone",
reflect.TypeOf(&showFingerprintsNode{}): "showFingerprints",
reflect.TypeOf(&showRangesNode{}): "showRanges",
reflect.TypeOf(&showTraceNode{}): "show trace for",
reflect.TypeOf(&showTraceReplicaNode{}): "replica trace",
reflect.TypeOf(&showZoneConfigNode{}): "show zone configuration",
reflect.TypeOf(&sortNode{}): "sort",
reflect.TypeOf(&splitNode{}): "split",
reflect.TypeOf(&spoolNode{}): "spool",
reflect.TypeOf(&truncateNode{}): "truncate",
reflect.TypeOf(&unaryNode{}): "emptyrow",
reflect.TypeOf(&unionNode{}): "union",
reflect.TypeOf(&updateNode{}): "update",
reflect.TypeOf(&upsertNode{}): "upsert",
reflect.TypeOf(&valuesNode{}): "values",
reflect.TypeOf(&windowNode{}): "window",
reflect.TypeOf(&zeroNode{}): "norows",
}