forked from cockroachdb/cockroach
/
processors.pb.go
4648 lines (4520 loc) · 121 KB
/
processors.pb.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
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by protoc-gen-gogo.
// source: cockroach/pkg/sql/distsqlrun/processors.proto
// DO NOT EDIT!
package distsqlrun
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import cockroach_roachpb1 "github.com/cockroachdb/cockroach/pkg/roachpb"
import cockroach_sql_sqlbase1 "github.com/cockroachdb/cockroach/pkg/sql/sqlbase"
import time "time"
import io "io"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
var _ = time.Kitchen
type JoinType int32
const (
JoinType_INNER JoinType = 0
JoinType_LEFT_OUTER JoinType = 1
JoinType_RIGHT_OUTER JoinType = 2
JoinType_FULL_OUTER JoinType = 3
)
var JoinType_name = map[int32]string{
0: "INNER",
1: "LEFT_OUTER",
2: "RIGHT_OUTER",
3: "FULL_OUTER",
}
var JoinType_value = map[string]int32{
"INNER": 0,
"LEFT_OUTER": 1,
"RIGHT_OUTER": 2,
"FULL_OUTER": 3,
}
func (x JoinType) Enum() *JoinType {
p := new(JoinType)
*p = x
return p
}
func (x JoinType) String() string {
return proto.EnumName(JoinType_name, int32(x))
}
func (x *JoinType) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(JoinType_value, data, "JoinType")
if err != nil {
return err
}
*x = JoinType(value)
return nil
}
func (JoinType) EnumDescriptor() ([]byte, []int) { return fileDescriptorProcessors, []int{0} }
// These mirror the aggregate functions supported by sql/parser. See
// sql/parser/aggregate_builtins.go.
type AggregatorSpec_Func int32
const (
// The identity function is set to be the default zero-value function,
// returning the last value added.
AggregatorSpec_IDENT AggregatorSpec_Func = 0
AggregatorSpec_AVG AggregatorSpec_Func = 1
AggregatorSpec_BOOL_AND AggregatorSpec_Func = 2
AggregatorSpec_BOOL_OR AggregatorSpec_Func = 3
AggregatorSpec_CONCAT_AGG AggregatorSpec_Func = 4
AggregatorSpec_COUNT AggregatorSpec_Func = 5
AggregatorSpec_MAX AggregatorSpec_Func = 7
AggregatorSpec_MIN AggregatorSpec_Func = 8
AggregatorSpec_STDDEV AggregatorSpec_Func = 9
AggregatorSpec_SUM AggregatorSpec_Func = 10
AggregatorSpec_SUM_INT AggregatorSpec_Func = 11
AggregatorSpec_VARIANCE AggregatorSpec_Func = 12
)
var AggregatorSpec_Func_name = map[int32]string{
0: "IDENT",
1: "AVG",
2: "BOOL_AND",
3: "BOOL_OR",
4: "CONCAT_AGG",
5: "COUNT",
7: "MAX",
8: "MIN",
9: "STDDEV",
10: "SUM",
11: "SUM_INT",
12: "VARIANCE",
}
var AggregatorSpec_Func_value = map[string]int32{
"IDENT": 0,
"AVG": 1,
"BOOL_AND": 2,
"BOOL_OR": 3,
"CONCAT_AGG": 4,
"COUNT": 5,
"MAX": 7,
"MIN": 8,
"STDDEV": 9,
"SUM": 10,
"SUM_INT": 11,
"VARIANCE": 12,
}
func (x AggregatorSpec_Func) Enum() *AggregatorSpec_Func {
p := new(AggregatorSpec_Func)
*p = x
return p
}
func (x AggregatorSpec_Func) String() string {
return proto.EnumName(AggregatorSpec_Func_name, int32(x))
}
func (x *AggregatorSpec_Func) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(AggregatorSpec_Func_value, data, "AggregatorSpec_Func")
if err != nil {
return err
}
*x = AggregatorSpec_Func(value)
return nil
}
func (AggregatorSpec_Func) EnumDescriptor() ([]byte, []int) {
return fileDescriptorProcessors, []int{12, 0}
}
type BackfillerSpec_Type int32
const (
BackfillerSpec_Invalid BackfillerSpec_Type = 0
BackfillerSpec_Column BackfillerSpec_Type = 1
BackfillerSpec_Index BackfillerSpec_Type = 2
)
var BackfillerSpec_Type_name = map[int32]string{
0: "Invalid",
1: "Column",
2: "Index",
}
var BackfillerSpec_Type_value = map[string]int32{
"Invalid": 0,
"Column": 1,
"Index": 2,
}
func (x BackfillerSpec_Type) Enum() *BackfillerSpec_Type {
p := new(BackfillerSpec_Type)
*p = x
return p
}
func (x BackfillerSpec_Type) String() string {
return proto.EnumName(BackfillerSpec_Type_name, int32(x))
}
func (x *BackfillerSpec_Type) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(BackfillerSpec_Type_value, data, "BackfillerSpec_Type")
if err != nil {
return err
}
*x = BackfillerSpec_Type(value)
return nil
}
func (BackfillerSpec_Type) EnumDescriptor() ([]byte, []int) {
return fileDescriptorProcessors, []int{13, 0}
}
type AlgebraicSetOpSpec_SetOpType int32
const (
AlgebraicSetOpSpec_Except_all AlgebraicSetOpSpec_SetOpType = 0
)
var AlgebraicSetOpSpec_SetOpType_name = map[int32]string{
0: "Except_all",
}
var AlgebraicSetOpSpec_SetOpType_value = map[string]int32{
"Except_all": 0,
}
func (x AlgebraicSetOpSpec_SetOpType) Enum() *AlgebraicSetOpSpec_SetOpType {
p := new(AlgebraicSetOpSpec_SetOpType)
*p = x
return p
}
func (x AlgebraicSetOpSpec_SetOpType) String() string {
return proto.EnumName(AlgebraicSetOpSpec_SetOpType_name, int32(x))
}
func (x *AlgebraicSetOpSpec_SetOpType) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(AlgebraicSetOpSpec_SetOpType_value, data, "AlgebraicSetOpSpec_SetOpType")
if err != nil {
return err
}
*x = AlgebraicSetOpSpec_SetOpType(value)
return nil
}
func (AlgebraicSetOpSpec_SetOpType) EnumDescriptor() ([]byte, []int) {
return fileDescriptorProcessors, []int{15, 0}
}
// Each processor has the following components:
// - one or more input synchronizers; each one merges rows between one or more
// input streams;
//
// - a processor "core" which encapsulates the inner logic of each processor;
//
// - a post-processing stage which allows "inline" post-processing on results
// (like projection or filtering);
//
// - one or more output synchronizers; each one directs rows to one or more
// output streams.
//
//
// == Internal columns ==
//
// The core outputs rows of a certain schema to the post-processing stage. We
// call this the "internal schema" (or "internal columns") and it differs for
// each type of core. Column indices in a PostProcessSpec refers to these
// internal columns. Some columns may be unused by the post-processing stage;
// processor implementations are internally optimized to not produce values for
// such unneded columns.
type ProcessorSpec struct {
// In most cases, there is one input.
Input []InputSyncSpec `protobuf:"bytes,1,rep,name=input" json:"input"`
Core ProcessorCoreUnion `protobuf:"bytes,2,opt,name=core" json:"core"`
Post PostProcessSpec `protobuf:"bytes,4,opt,name=post" json:"post"`
// In most cases, there is one output.
Output []OutputRouterSpec `protobuf:"bytes,3,rep,name=output" json:"output"`
}
func (m *ProcessorSpec) Reset() { *m = ProcessorSpec{} }
func (m *ProcessorSpec) String() string { return proto.CompactTextString(m) }
func (*ProcessorSpec) ProtoMessage() {}
func (*ProcessorSpec) Descriptor() ([]byte, []int) { return fileDescriptorProcessors, []int{0} }
// PostProcessSpec describes the processing required to obtain the output
// (filtering, projection). It operates on the internal schema of the processor
// (see ProcessorSpec).
type PostProcessSpec struct {
// A filtering expression which references the internal columns of the
// processor via ordinal references (@1, @2, etc).
Filter Expression `protobuf:"bytes,1,opt,name=filter" json:"filter"`
// If true, output_columns describes a projection. Used to differentiate
// between an empty projection and no projection.
//
// Cannot be set at the same time with render expressions.
Projection bool `protobuf:"varint,2,opt,name=projection" json:"projection"`
// The output columns describe a projection on the internal set of columns;
// only the columns in this list will be emitted.
//
// Can only be set if projection is true. Cannot be set at the same time with
// render expressions.
OutputColumns []uint32 `protobuf:"varint,3,rep,packed,name=output_columns,json=outputColumns" json:"output_columns,omitempty"`
// If set, the output is the result of rendering these expressions. The
// expressions reference the internal columns of the processor.
//
// Cannot be set at the same time with output columns.
RenderExprs []Expression `protobuf:"bytes,4,rep,name=render_exprs,json=renderExprs" json:"render_exprs"`
// If nonzero, the first <offset> rows will be suppressed.
Offset uint64 `protobuf:"varint,5,opt,name=offset" json:"offset"`
// If nonzero, the processor will stop after emitting this many rows. The rows
// suppressed by <offset>, if any, do not count towards this limit.
Limit uint64 `protobuf:"varint,6,opt,name=limit" json:"limit"`
}
func (m *PostProcessSpec) Reset() { *m = PostProcessSpec{} }
func (m *PostProcessSpec) String() string { return proto.CompactTextString(m) }
func (*PostProcessSpec) ProtoMessage() {}
func (*PostProcessSpec) Descriptor() ([]byte, []int) { return fileDescriptorProcessors, []int{1} }
type ProcessorCoreUnion struct {
Noop *NoopCoreSpec `protobuf:"bytes,1,opt,name=noop" json:"noop,omitempty"`
TableReader *TableReaderSpec `protobuf:"bytes,2,opt,name=tableReader" json:"tableReader,omitempty"`
JoinReader *JoinReaderSpec `protobuf:"bytes,3,opt,name=joinReader" json:"joinReader,omitempty"`
Sorter *SorterSpec `protobuf:"bytes,4,opt,name=sorter" json:"sorter,omitempty"`
Aggregator *AggregatorSpec `protobuf:"bytes,5,opt,name=aggregator" json:"aggregator,omitempty"`
Distinct *DistinctSpec `protobuf:"bytes,7,opt,name=distinct" json:"distinct,omitempty"`
MergeJoiner *MergeJoinerSpec `protobuf:"bytes,8,opt,name=mergeJoiner" json:"mergeJoiner,omitempty"`
HashJoiner *HashJoinerSpec `protobuf:"bytes,9,opt,name=hashJoiner" json:"hashJoiner,omitempty"`
Values *ValuesCoreSpec `protobuf:"bytes,10,opt,name=values" json:"values,omitempty"`
Backfiller *BackfillerSpec `protobuf:"bytes,11,opt,name=backfiller" json:"backfiller,omitempty"`
SetOp *AlgebraicSetOpSpec `protobuf:"bytes,12,opt,name=setOp" json:"setOp,omitempty"`
}
func (m *ProcessorCoreUnion) Reset() { *m = ProcessorCoreUnion{} }
func (m *ProcessorCoreUnion) String() string { return proto.CompactTextString(m) }
func (*ProcessorCoreUnion) ProtoMessage() {}
func (*ProcessorCoreUnion) Descriptor() ([]byte, []int) { return fileDescriptorProcessors, []int{2} }
// NoopCoreSpec indicates a "no-op" processor core. This is used when we just
// need post-processing or when only a synchronizer is required (e.g. at the
// final endpoint).
type NoopCoreSpec struct {
}
func (m *NoopCoreSpec) Reset() { *m = NoopCoreSpec{} }
func (m *NoopCoreSpec) String() string { return proto.CompactTextString(m) }
func (*NoopCoreSpec) ProtoMessage() {}
func (*NoopCoreSpec) Descriptor() ([]byte, []int) { return fileDescriptorProcessors, []int{3} }
// ValuesCoreSpec is the core of a processor that has no inputs and generates
// "pre-canned" rows. This is not intended to be used for very large datasets.
type ValuesCoreSpec struct {
// There is one DatumInfo for each element in a row.
Columns []DatumInfo `protobuf:"bytes,1,rep,name=columns" json:"columns"`
// Each raw block encodes one or more data rows; each datum is encoded
// according to the corresponding DatumInfo.
RawBytes [][]byte `protobuf:"bytes,2,rep,name=raw_bytes,json=rawBytes" json:"raw_bytes,omitempty"`
}
func (m *ValuesCoreSpec) Reset() { *m = ValuesCoreSpec{} }
func (m *ValuesCoreSpec) String() string { return proto.CompactTextString(m) }
func (*ValuesCoreSpec) ProtoMessage() {}
func (*ValuesCoreSpec) Descriptor() ([]byte, []int) { return fileDescriptorProcessors, []int{4} }
type TableReaderSpan struct {
// TODO(radu): the dist_sql APIs should be agnostic to how we map tables to
// KVs. The span should be described as starting and ending lists of values
// for a prefix of the index columns, along with inclusive/exclusive flags.
Span cockroach_roachpb1.Span `protobuf:"bytes,1,opt,name=span" json:"span"`
}
func (m *TableReaderSpan) Reset() { *m = TableReaderSpan{} }
func (m *TableReaderSpan) String() string { return proto.CompactTextString(m) }
func (*TableReaderSpan) ProtoMessage() {}
func (*TableReaderSpan) Descriptor() ([]byte, []int) { return fileDescriptorProcessors, []int{5} }
// TableReaderSpec is the specification for a "table reader". A table reader
// performs KV operations to retrieve rows for a table and outputs the desired
// columns of the rows that pass a filter expression.
//
// The "internal columns" of a TableReader (see ProcessorSpec) are all the
// columns of the table. Internally, only the values for the columns needed by
// the post-processing stage are be populated.
type TableReaderSpec struct {
Table cockroach_sql_sqlbase1.TableDescriptor `protobuf:"bytes,1,opt,name=table" json:"table"`
// If 0, we use the primary index. If non-zero, we use the index_idx-th index,
// i.e. table.indexes[index_idx-1]
IndexIdx uint32 `protobuf:"varint,2,opt,name=index_idx,json=indexIdx" json:"index_idx"`
Reverse bool `protobuf:"varint,3,opt,name=reverse" json:"reverse"`
Spans []TableReaderSpan `protobuf:"bytes,4,rep,name=spans" json:"spans"`
// A hint for how many rows the consumer of the table reader output might
// need. This is used to size the initial KV batches to try to avoid reading
// many more rows than needed by the processor receiving the output.
//
// Not used if there is a limit set in the PostProcessSpec of this processor
// (that value will be used for sizing batches instead).
LimitHint int64 `protobuf:"varint,5,opt,name=limit_hint,json=limitHint" json:"limit_hint"`
}
func (m *TableReaderSpec) Reset() { *m = TableReaderSpec{} }
func (m *TableReaderSpec) String() string { return proto.CompactTextString(m) }
func (*TableReaderSpec) ProtoMessage() {}
func (*TableReaderSpec) Descriptor() ([]byte, []int) { return fileDescriptorProcessors, []int{6} }
// JoinReaderSpec is the specification for a "join reader". A join reader
// performs KV operations to retrieve specific rows that correspond to the
// values in the input stream (join by lookup).
//
// The "internal columns" of a JoinReader (see ProcessorSpec) are all the
// columns of the table. Internally, only the values for the columns needed by
// the post-processing stage are be populated.
type JoinReaderSpec struct {
Table cockroach_sql_sqlbase1.TableDescriptor `protobuf:"bytes,1,opt,name=table" json:"table"`
// If 0, we use the primary index; each row in the input stream has a value
// for each primary key.
// TODO(radu): figure out the correct semantics when joining with an index.
IndexIdx uint32 `protobuf:"varint,2,opt,name=index_idx,json=indexIdx" json:"index_idx"`
}
func (m *JoinReaderSpec) Reset() { *m = JoinReaderSpec{} }
func (m *JoinReaderSpec) String() string { return proto.CompactTextString(m) }
func (*JoinReaderSpec) ProtoMessage() {}
func (*JoinReaderSpec) Descriptor() ([]byte, []int) { return fileDescriptorProcessors, []int{7} }
// SorterSpec is the specification for a "sorting aggregator". A sorting
// aggregator sorts elements in the input stream providing a certain output
// order guarantee regardless of the input ordering. The output ordering is
// according to a configurable set of columns.
//
// The "internal columns" of a Sorter (see ProcessorSpec) are the same as the
// input columns.
type SorterSpec struct {
OutputOrdering Ordering `protobuf:"bytes,1,opt,name=output_ordering,json=outputOrdering" json:"output_ordering"`
// Ordering match length, specifying that the input is already sorted by the
// first 'n' output ordering columns, can be optionally specified for
// possible speed-ups taking advantage of the partial orderings.
OrderingMatchLen uint32 `protobuf:"varint,2,opt,name=ordering_match_len,json=orderingMatchLen" json:"ordering_match_len"`
}
func (m *SorterSpec) Reset() { *m = SorterSpec{} }
func (m *SorterSpec) String() string { return proto.CompactTextString(m) }
func (*SorterSpec) ProtoMessage() {}
func (*SorterSpec) Descriptor() ([]byte, []int) { return fileDescriptorProcessors, []int{8} }
type DistinctSpec struct {
// The ordered columns in the input stream can be optionally specified for
// possible optimizations. The specific ordering (ascending/descending) of
// the column itself is not important nor is the order in which the columns
// are specified.
OrderedColumns []uint32 `protobuf:"varint,1,rep,name=ordered_columns,json=orderedColumns" json:"ordered_columns,omitempty"`
// The distinct columns in the input stream are those columns on which we
// check for distinct rows. If A,B,C are in distinct_columns and there is a
// 4th column D which is not included in distinct_columns, its values are not
// considered, so rows A1,B1,C1,D1 and A1,B1,C1,D2 are considered equal and
// only one of them (the first) is output.
DistinctColumns []uint32 `protobuf:"varint,2,rep,name=distinct_columns,json=distinctColumns" json:"distinct_columns,omitempty"`
}
func (m *DistinctSpec) Reset() { *m = DistinctSpec{} }
func (m *DistinctSpec) String() string { return proto.CompactTextString(m) }
func (*DistinctSpec) ProtoMessage() {}
func (*DistinctSpec) Descriptor() ([]byte, []int) { return fileDescriptorProcessors, []int{9} }
// MergeJoinerSpec is the specification for a merge join processor. The processor
// has two inputs and one output. The inputs must have the same ordering on the
// columns that have equality constraints. For example:
// SELECT * FROM T1 INNER JOIN T2 ON T1.C1 = T2.C5 AND T1.C2 = T2.C4
//
// To perform a merge join, the streams corresponding to T1 and T2 must have the
// same ordering on columns C1, C2 and C5, C4 respectively. For example: C1+,C2-
// and C5+,C4-.
//
// The "internal columns" of a MergeJoiner (see ProcessorSpec) are the
// concatenation of left input columns and right input columns. If the left
// input has N columns and the right input has M columns, the first N columns
// contain values from the left side and the following M columns contain values
// from the right side.
type MergeJoinerSpec struct {
// The streams must be ordered according to the columns that have equality
// constraints. The first column of the left ordering is constrained to be
// equal to the first column in the right ordering and so on. The ordering
// lengths and directions must match.
// In the example above, left ordering describes C1+,C2- and right ordering
// describes C5+,C4-.
LeftOrdering Ordering `protobuf:"bytes,1,opt,name=left_ordering,json=leftOrdering" json:"left_ordering"`
RightOrdering Ordering `protobuf:"bytes,2,opt,name=right_ordering,json=rightOrdering" json:"right_ordering"`
// "ON" expression (in addition to the equality constraints captured by the
// orderings). Assuming that the left stream has N columns and the right
// stream has M columns, in this expression ordinal references @1 to @N refer
// to columns of the left stream and variables @(N+1) to @(N+M) refer to
// columns in the right stream.
OnExpr Expression `protobuf:"bytes,5,opt,name=on_expr,json=onExpr" json:"on_expr"`
Type JoinType `protobuf:"varint,6,opt,name=type,enum=cockroach.sql.distsqlrun.JoinType" json:"type"`
}
func (m *MergeJoinerSpec) Reset() { *m = MergeJoinerSpec{} }
func (m *MergeJoinerSpec) String() string { return proto.CompactTextString(m) }
func (*MergeJoinerSpec) ProtoMessage() {}
func (*MergeJoinerSpec) Descriptor() ([]byte, []int) { return fileDescriptorProcessors, []int{10} }
// HashJoinerSpec is the specification for a hash join processor. The processor
// has two inputs and one output.
//
// The processor works by reading the entire right input and putting it in a hash
// table. Thus, there is no guarantee on the ordering of results that stem only
// from the right input (in the case of RIGHT_OUTER, FULL_OUTER). However, it is
// guaranteed that results that involve the left stream preserve the ordering;
// i.e. all results that stem from left row (i) precede results that stem from
// left row (i+1).
//
// The "internal columns" of a HashJoiner (see ProcessorSpec) are the
// concatenation of left input columns and right input columns. If the left
// input has N columns and the right input has M columns, the first N columns
// contain values from the left side and the following M columns contain values
// from the right side.
type HashJoinerSpec struct {
// The join constraints certain columns from the left stream to equal
// corresponding columns on the right stream. These must have the same length.
LeftEqColumns []uint32 `protobuf:"varint,1,rep,packed,name=left_eq_columns,json=leftEqColumns" json:"left_eq_columns,omitempty"`
RightEqColumns []uint32 `protobuf:"varint,2,rep,packed,name=right_eq_columns,json=rightEqColumns" json:"right_eq_columns,omitempty"`
// "ON" expression (in addition to the equality constraints captured by the
// orderings). Assuming that the left stream has N columns and the right
// stream has M columns, in this expression variables @1 to @N refer to
// columns of the left stream and variables @N to @(N+M) refer to columns in
// the right stream.
OnExpr Expression `protobuf:"bytes,5,opt,name=on_expr,json=onExpr" json:"on_expr"`
Type JoinType `protobuf:"varint,6,opt,name=type,enum=cockroach.sql.distsqlrun.JoinType" json:"type"`
}
func (m *HashJoinerSpec) Reset() { *m = HashJoinerSpec{} }
func (m *HashJoinerSpec) String() string { return proto.CompactTextString(m) }
func (*HashJoinerSpec) ProtoMessage() {}
func (*HashJoinerSpec) Descriptor() ([]byte, []int) { return fileDescriptorProcessors, []int{11} }
// AggregatorSpec is the specification for an "aggregator" (processor core
// type, not the logical plan computation stage). An aggregator performs
// 'aggregation' in the SQL sense in that it groups rows and computes an aggregate
// for each group. The group is configured using the group key. The aggregator
// can be configured with one or more aggregation functions.
//
// The "internal columns" of an Aggregator map 1-1 to the aggregations.
type AggregatorSpec struct {
// The group key is a subset of the columns in the input stream schema on the
// basis of which we define our groups.
GroupCols []uint32 `protobuf:"varint,2,rep,packed,name=group_cols,json=groupCols" json:"group_cols,omitempty"`
Aggregations []AggregatorSpec_Aggregation `protobuf:"bytes,3,rep,name=aggregations" json:"aggregations"`
}
func (m *AggregatorSpec) Reset() { *m = AggregatorSpec{} }
func (m *AggregatorSpec) String() string { return proto.CompactTextString(m) }
func (*AggregatorSpec) ProtoMessage() {}
func (*AggregatorSpec) Descriptor() ([]byte, []int) { return fileDescriptorProcessors, []int{12} }
type AggregatorSpec_Aggregation struct {
Func AggregatorSpec_Func `protobuf:"varint,1,opt,name=func,enum=cockroach.sql.distsqlrun.AggregatorSpec_Func" json:"func"`
// Aggregation functions with distinct = true functions like you would
// expect '<FUNC> DISTINCT' to operate, the default behaviour would be
// the '<FUNC> ALL' operation.
Distinct bool `protobuf:"varint,2,opt,name=distinct" json:"distinct"`
// The column index specifies the argument to the aggregator function.
ColIdx uint32 `protobuf:"varint,3,opt,name=col_idx,json=colIdx" json:"col_idx"`
}
func (m *AggregatorSpec_Aggregation) Reset() { *m = AggregatorSpec_Aggregation{} }
func (m *AggregatorSpec_Aggregation) String() string { return proto.CompactTextString(m) }
func (*AggregatorSpec_Aggregation) ProtoMessage() {}
func (*AggregatorSpec_Aggregation) Descriptor() ([]byte, []int) {
return fileDescriptorProcessors, []int{12, 0}
}
// BackfillerSpec is the specification for a "schema change backfiller".
// The created backfill processor runs a backfill for the first mutations in
// the table descriptor mutation list with the same mutation id and type.
// A backfiller processor performs KV operations to retrieve rows for a
// table and backfills the new indexes/columns contained in the table
// descriptor. It checkpoints its progress by updating the table
// descriptor in the database, and doesn't emit any rows nor support
// any post-processing.
type BackfillerSpec struct {
Type BackfillerSpec_Type `protobuf:"varint,1,opt,name=type,enum=cockroach.sql.distsqlrun.BackfillerSpec_Type" json:"type"`
Table cockroach_sql_sqlbase1.TableDescriptor `protobuf:"bytes,2,opt,name=table" json:"table"`
// Sections of the table to be backfilled.
Spans []TableReaderSpan `protobuf:"bytes,3,rep,name=spans" json:"spans"`
// Run the backfill for approximately this duration.
// The backfill will always process at least one backfill chunk.
Duration time.Duration `protobuf:"varint,4,opt,name=duration,casttype=time.Duration" json:"duration"`
// The backfill involves a complete table scan in chunks,
// where each chunk is a transactional read of a set of rows
// along with a backfill for the rows. This is the maximum number
// of entries backfilled per chunk.
ChunkSize int64 `protobuf:"varint,5,opt,name=chunk_size,json=chunkSize" json:"chunk_size"`
// Any other (leased) table descriptors necessary for the
// backfiller to do its job, such as the descriptors for tables with fk
// relationships to the table being modified.
OtherTables []cockroach_sql_sqlbase1.TableDescriptor `protobuf:"bytes,6,rep,name=other_tables,json=otherTables" json:"other_tables"`
}
func (m *BackfillerSpec) Reset() { *m = BackfillerSpec{} }
func (m *BackfillerSpec) String() string { return proto.CompactTextString(m) }
func (*BackfillerSpec) ProtoMessage() {}
func (*BackfillerSpec) Descriptor() ([]byte, []int) { return fileDescriptorProcessors, []int{13} }
// FlowSpec describes a "flow" which is a subgraph of a distributed SQL
// computation consisting of processors and streams.
type FlowSpec struct {
FlowID FlowID `protobuf:"bytes,1,opt,name=flow_id,json=flowId,customtype=FlowID" json:"flow_id"`
Processors []ProcessorSpec `protobuf:"bytes,2,rep,name=processors" json:"processors"`
}
func (m *FlowSpec) Reset() { *m = FlowSpec{} }
func (m *FlowSpec) String() string { return proto.CompactTextString(m) }
func (*FlowSpec) ProtoMessage() {}
func (*FlowSpec) Descriptor() ([]byte, []int) { return fileDescriptorProcessors, []int{14} }
// AlgebraicSetOpSpec is a specification for algebraic set operations currently
// only the EXCEPT ALL set operation, but extensible to other set operations.
// INTERSECT ALL is implemented with HashJoinerSpec, and UNION ALL with
// a no-op processor. EXCEPT/INTERSECT/UNION use a DISTINCT processor at
// the end. The two input streams should have the same schema. The ordering
// of the left stream will be preserved in the output stream.
type AlgebraicSetOpSpec struct {
// If the two input streams are both ordered by a common column ordering,
// that ordering can be used to optimize resource usage in the processor.
Ordering Ordering `protobuf:"bytes,1,opt,name=ordering" json:"ordering"`
OpType AlgebraicSetOpSpec_SetOpType `protobuf:"varint,2,opt,name=op_type,json=opType,enum=cockroach.sql.distsqlrun.AlgebraicSetOpSpec_SetOpType" json:"op_type"`
}
func (m *AlgebraicSetOpSpec) Reset() { *m = AlgebraicSetOpSpec{} }
func (m *AlgebraicSetOpSpec) String() string { return proto.CompactTextString(m) }
func (*AlgebraicSetOpSpec) ProtoMessage() {}
func (*AlgebraicSetOpSpec) Descriptor() ([]byte, []int) { return fileDescriptorProcessors, []int{15} }
func init() {
proto.RegisterType((*ProcessorSpec)(nil), "cockroach.sql.distsqlrun.ProcessorSpec")
proto.RegisterType((*PostProcessSpec)(nil), "cockroach.sql.distsqlrun.PostProcessSpec")
proto.RegisterType((*ProcessorCoreUnion)(nil), "cockroach.sql.distsqlrun.ProcessorCoreUnion")
proto.RegisterType((*NoopCoreSpec)(nil), "cockroach.sql.distsqlrun.NoopCoreSpec")
proto.RegisterType((*ValuesCoreSpec)(nil), "cockroach.sql.distsqlrun.ValuesCoreSpec")
proto.RegisterType((*TableReaderSpan)(nil), "cockroach.sql.distsqlrun.TableReaderSpan")
proto.RegisterType((*TableReaderSpec)(nil), "cockroach.sql.distsqlrun.TableReaderSpec")
proto.RegisterType((*JoinReaderSpec)(nil), "cockroach.sql.distsqlrun.JoinReaderSpec")
proto.RegisterType((*SorterSpec)(nil), "cockroach.sql.distsqlrun.SorterSpec")
proto.RegisterType((*DistinctSpec)(nil), "cockroach.sql.distsqlrun.DistinctSpec")
proto.RegisterType((*MergeJoinerSpec)(nil), "cockroach.sql.distsqlrun.MergeJoinerSpec")
proto.RegisterType((*HashJoinerSpec)(nil), "cockroach.sql.distsqlrun.HashJoinerSpec")
proto.RegisterType((*AggregatorSpec)(nil), "cockroach.sql.distsqlrun.AggregatorSpec")
proto.RegisterType((*AggregatorSpec_Aggregation)(nil), "cockroach.sql.distsqlrun.AggregatorSpec.Aggregation")
proto.RegisterType((*BackfillerSpec)(nil), "cockroach.sql.distsqlrun.BackfillerSpec")
proto.RegisterType((*FlowSpec)(nil), "cockroach.sql.distsqlrun.FlowSpec")
proto.RegisterType((*AlgebraicSetOpSpec)(nil), "cockroach.sql.distsqlrun.AlgebraicSetOpSpec")
proto.RegisterEnum("cockroach.sql.distsqlrun.JoinType", JoinType_name, JoinType_value)
proto.RegisterEnum("cockroach.sql.distsqlrun.AggregatorSpec_Func", AggregatorSpec_Func_name, AggregatorSpec_Func_value)
proto.RegisterEnum("cockroach.sql.distsqlrun.BackfillerSpec_Type", BackfillerSpec_Type_name, BackfillerSpec_Type_value)
proto.RegisterEnum("cockroach.sql.distsqlrun.AlgebraicSetOpSpec_SetOpType", AlgebraicSetOpSpec_SetOpType_name, AlgebraicSetOpSpec_SetOpType_value)
}
func (m *ProcessorSpec) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ProcessorSpec) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Input) > 0 {
for _, msg := range m.Input {
dAtA[i] = 0xa
i++
i = encodeVarintProcessors(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
dAtA[i] = 0x12
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.Core.Size()))
n1, err := m.Core.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n1
if len(m.Output) > 0 {
for _, msg := range m.Output {
dAtA[i] = 0x1a
i++
i = encodeVarintProcessors(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
dAtA[i] = 0x22
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.Post.Size()))
n2, err := m.Post.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n2
return i, nil
}
func (m *PostProcessSpec) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *PostProcessSpec) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0xa
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.Filter.Size()))
n3, err := m.Filter.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n3
dAtA[i] = 0x10
i++
if m.Projection {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
if len(m.OutputColumns) > 0 {
dAtA5 := make([]byte, len(m.OutputColumns)*10)
var j4 int
for _, num := range m.OutputColumns {
for num >= 1<<7 {
dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j4++
}
dAtA5[j4] = uint8(num)
j4++
}
dAtA[i] = 0x1a
i++
i = encodeVarintProcessors(dAtA, i, uint64(j4))
i += copy(dAtA[i:], dAtA5[:j4])
}
if len(m.RenderExprs) > 0 {
for _, msg := range m.RenderExprs {
dAtA[i] = 0x22
i++
i = encodeVarintProcessors(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
dAtA[i] = 0x28
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.Offset))
dAtA[i] = 0x30
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.Limit))
return i, nil
}
func (m *ProcessorCoreUnion) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ProcessorCoreUnion) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Noop != nil {
dAtA[i] = 0xa
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.Noop.Size()))
n6, err := m.Noop.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n6
}
if m.TableReader != nil {
dAtA[i] = 0x12
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.TableReader.Size()))
n7, err := m.TableReader.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n7
}
if m.JoinReader != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.JoinReader.Size()))
n8, err := m.JoinReader.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n8
}
if m.Sorter != nil {
dAtA[i] = 0x22
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.Sorter.Size()))
n9, err := m.Sorter.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n9
}
if m.Aggregator != nil {
dAtA[i] = 0x2a
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.Aggregator.Size()))
n10, err := m.Aggregator.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n10
}
if m.Distinct != nil {
dAtA[i] = 0x3a
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.Distinct.Size()))
n11, err := m.Distinct.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n11
}
if m.MergeJoiner != nil {
dAtA[i] = 0x42
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.MergeJoiner.Size()))
n12, err := m.MergeJoiner.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n12
}
if m.HashJoiner != nil {
dAtA[i] = 0x4a
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.HashJoiner.Size()))
n13, err := m.HashJoiner.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n13
}
if m.Values != nil {
dAtA[i] = 0x52
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.Values.Size()))
n14, err := m.Values.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n14
}
if m.Backfiller != nil {
dAtA[i] = 0x5a
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.Backfiller.Size()))
n15, err := m.Backfiller.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n15
}
if m.SetOp != nil {
dAtA[i] = 0x62
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.SetOp.Size()))
n16, err := m.SetOp.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n16
}
return i, nil
}
func (m *NoopCoreSpec) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NoopCoreSpec) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
return i, nil
}
func (m *ValuesCoreSpec) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ValuesCoreSpec) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Columns) > 0 {
for _, msg := range m.Columns {
dAtA[i] = 0xa
i++
i = encodeVarintProcessors(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if len(m.RawBytes) > 0 {
for _, b := range m.RawBytes {
dAtA[i] = 0x12
i++
i = encodeVarintProcessors(dAtA, i, uint64(len(b)))
i += copy(dAtA[i:], b)
}
}
return i, nil
}
func (m *TableReaderSpan) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *TableReaderSpan) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0xa
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.Span.Size()))
n17, err := m.Span.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n17
return i, nil
}
func (m *TableReaderSpec) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *TableReaderSpec) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0xa
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.Table.Size()))
n18, err := m.Table.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n18
dAtA[i] = 0x10
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.IndexIdx))
dAtA[i] = 0x18
i++
if m.Reverse {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
if len(m.Spans) > 0 {
for _, msg := range m.Spans {
dAtA[i] = 0x22
i++
i = encodeVarintProcessors(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
dAtA[i] = 0x28
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.LimitHint))
return i, nil
}
func (m *JoinReaderSpec) Marshal() (dAtA []byte, err error) {