forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
/
processors.pb.go
4067 lines (3966 loc) · 104 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 _ "github.com/cockroachdb/cockroach/pkg/roachpb"
import cockroach_sql_sqlbase1 "github.com/cockroachdb/cockroach/pkg/sql/sqlbase"
import _ "github.com/cockroachdb/cockroach/pkg/sql/sqlbase"
import io "io"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
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{9, 0}
}
// NoopCoreSpec indicates a "no-op" processor core. This is used 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{0} }
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{1} }
// 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.
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"`
// The filter expression references the columns in the table (table.columns)
// via ordinal references (@1, @2, etc). If a secondary index is used, the
// columns that are not available as part of the index cannot be referenced.
Filter Expression `protobuf:"bytes,5,opt,name=filter" json:"filter"`
// The table reader will only produce values for these columns, referenced by
// their indices in table.columns.
OutputColumns []uint32 `protobuf:"varint,6,rep,packed,name=output_columns,json=outputColumns" json:"output_columns,omitempty"`
// If nonzero, the table reader only needs to return this many rows.
HardLimit int64 `protobuf:"varint,8,opt,name=hard_limit,json=hardLimit" json:"hard_limit"`
// The soft limit is a hint for how many rows the consumer of the table reader
// output might need. If both the hard limit and the soft limit are set, the
// soft limit must be lower than the hard limit.
SoftLimit int64 `protobuf:"varint,7,opt,name=soft_limit,json=softLimit" json:"soft_limit"`
}
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{2} }
// 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).
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"`
// The filter expression references the columns in the table (table.columns)
// via ordinal references (@1, @2, etc). If a secondary index is used, the
// columns that are not available as part of the index cannot be referenced.
Filter Expression `protobuf:"bytes,3,opt,name=filter" json:"filter"`
// The table reader will only produce values for these columns, referenced by
// their indices in table.columns.
OutputColumns []uint32 `protobuf:"varint,4,rep,packed,name=output_columns,json=outputColumns" json:"output_columns,omitempty"`
}
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{3} }
// 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.
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"`
// Limits can be optionally specified to allow for further optimizations
// taking advantage of the fact that only the top 'k' results are needed.
Limit int64 `protobuf:"varint,3,opt,name=limit" json:"limit"`
}
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{4} }
// EvaluatorSpec is the specification for an "evaluator", a fully
// programmable no-grouping aggregator. It runs a 'program' on each individual
// row and is restricted to operating on one row of data at a time.
// The 'program' is a set of expressions evaluated in order, the output
// schema therefore consists of the results of evaluating each of these
// expressions on the input row.
//
// TODO(irfansharif): Add support for an optional output filter expression.
// The filter expression would reference the columns in the row via @1, @2,
// etc., possibly optimizing if filtering on expressions common to the
// 'program'.
type EvaluatorSpec struct {
Exprs []Expression `protobuf:"bytes,1,rep,name=exprs" json:"exprs"`
}
func (m *EvaluatorSpec) Reset() { *m = EvaluatorSpec{} }
func (m *EvaluatorSpec) String() string { return proto.CompactTextString(m) }
func (*EvaluatorSpec) ProtoMessage() {}
func (*EvaluatorSpec) Descriptor() ([]byte, []int) { return fileDescriptorProcessors, []int{5} }
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"`
}
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{6} }
// 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-.
//
// It is guaranteed that the results preserve this ordering.
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"`
LeftTypes []cockroach_sql_sqlbase1.ColumnType `protobuf:"bytes,3,rep,name=left_types,json=leftTypes" json:"left_types"`
RightTypes []cockroach_sql_sqlbase1.ColumnType `protobuf:"bytes,4,rep,name=right_types,json=rightTypes" json:"right_types"`
// "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.
Expr Expression `protobuf:"bytes,5,opt,name=expr" json:"expr"`
Type JoinType `protobuf:"varint,6,opt,name=type,enum=cockroach.sql.distsqlrun.JoinType" json:"type"`
// Columns for the output stream. Assuming that the left stream has N columns
// and the right stream has M columns, column indices 0 to (N-1) refer to left
// stream columns and indices N to (N+M-1) refer to right stream columns.
OutputColumns []uint32 `protobuf:"varint,7,rep,packed,name=output_columns,json=outputColumns" json:"output_columns,omitempty"`
}
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{7} }
// 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).
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"`
LeftTypes []cockroach_sql_sqlbase1.ColumnType `protobuf:"bytes,3,rep,name=left_types,json=leftTypes" json:"left_types"`
RightTypes []cockroach_sql_sqlbase1.ColumnType `protobuf:"bytes,4,rep,name=right_types,json=rightTypes" json:"right_types"`
// "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.
Expr Expression `protobuf:"bytes,5,opt,name=expr" json:"expr"`
Type JoinType `protobuf:"varint,6,opt,name=type,enum=cockroach.sql.distsqlrun.JoinType" json:"type"`
// Columns for the output stream. Assuming that the left stream has N columns
// and the right stream has M columns, column indices 0 to (N-1) refer to left
// stream columns and indices N to (N+M-1) refer to right stream columns.
OutputColumns []uint32 `protobuf:"varint,7,rep,packed,name=output_columns,json=outputColumns" json:"output_columns,omitempty"`
}
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{8} }
// 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 aggregator's output schema consists of the group key, plus a
// configurable subset of the generated aggregated values.
type AggregatorSpec struct {
Types []cockroach_sql_sqlbase1.ColumnType `protobuf:"bytes,1,rep,name=types" json:"types"`
// 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,name=group_cols,json=groupCols" json:"group_cols,omitempty"`
// Exprs represents the SELECT expressions.
Exprs []AggregatorSpec_Expr `protobuf:"bytes,3,rep,name=exprs" json:"exprs"`
}
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{9} }
type AggregatorSpec_Expr 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_Expr) Reset() { *m = AggregatorSpec_Expr{} }
func (m *AggregatorSpec_Expr) String() string { return proto.CompactTextString(m) }
func (*AggregatorSpec_Expr) ProtoMessage() {}
func (*AggregatorSpec_Expr) Descriptor() ([]byte, []int) { return fileDescriptorProcessors, []int{9, 0} }
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"`
Evaluator *EvaluatorSpec `protobuf:"bytes,6,opt,name=evaluator" json:"evaluator,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"`
}
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{10} }
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"`
// 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{11} }
// 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{12} }
func init() {
proto.RegisterType((*NoopCoreSpec)(nil), "cockroach.sql.distsqlrun.NoopCoreSpec")
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((*EvaluatorSpec)(nil), "cockroach.sql.distsqlrun.EvaluatorSpec")
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_Expr)(nil), "cockroach.sql.distsqlrun.AggregatorSpec.Expr")
proto.RegisterType((*ProcessorCoreUnion)(nil), "cockroach.sql.distsqlrun.ProcessorCoreUnion")
proto.RegisterType((*ProcessorSpec)(nil), "cockroach.sql.distsqlrun.ProcessorSpec")
proto.RegisterType((*FlowSpec)(nil), "cockroach.sql.distsqlrun.FlowSpec")
proto.RegisterEnum("cockroach.sql.distsqlrun.JoinType", JoinType_name, JoinType_value)
proto.RegisterEnum("cockroach.sql.distsqlrun.AggregatorSpec_Func", AggregatorSpec_Func_name, AggregatorSpec_Func_value)
}
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 *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()))
n1, err := m.Span.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n1
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()))
n2, err := m.Table.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n2
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] = 0x2a
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.Filter.Size()))
n3, err := m.Filter.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n3
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] = 0x32
i++
i = encodeVarintProcessors(dAtA, i, uint64(j4))
i += copy(dAtA[i:], dAtA5[:j4])
}
dAtA[i] = 0x38
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.SoftLimit))
dAtA[i] = 0x40
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.HardLimit))
return i, nil
}
func (m *JoinReaderSpec) 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 *JoinReaderSpec) 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()))
n6, err := m.Table.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n6
dAtA[i] = 0x10
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.IndexIdx))
dAtA[i] = 0x1a
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.Filter.Size()))
n7, err := m.Filter.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n7
if len(m.OutputColumns) > 0 {
dAtA9 := make([]byte, len(m.OutputColumns)*10)
var j8 int
for _, num := range m.OutputColumns {
for num >= 1<<7 {
dAtA9[j8] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j8++
}
dAtA9[j8] = uint8(num)
j8++
}
dAtA[i] = 0x22
i++
i = encodeVarintProcessors(dAtA, i, uint64(j8))
i += copy(dAtA[i:], dAtA9[:j8])
}
return i, nil
}
func (m *SorterSpec) 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 *SorterSpec) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0xa
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.OutputOrdering.Size()))
n10, err := m.OutputOrdering.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n10
dAtA[i] = 0x10
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.OrderingMatchLen))
dAtA[i] = 0x18
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.Limit))
return i, nil
}
func (m *EvaluatorSpec) 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 *EvaluatorSpec) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Exprs) > 0 {
for _, msg := range m.Exprs {
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
}
}
return i, nil
}
func (m *DistinctSpec) 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 *DistinctSpec) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.OrderedColumns) > 0 {
for _, num := range m.OrderedColumns {
dAtA[i] = 0x8
i++
i = encodeVarintProcessors(dAtA, i, uint64(num))
}
}
return i, nil
}
func (m *MergeJoinerSpec) 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 *MergeJoinerSpec) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0xa
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.LeftOrdering.Size()))
n11, err := m.LeftOrdering.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n11
dAtA[i] = 0x12
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.RightOrdering.Size()))
n12, err := m.RightOrdering.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n12
if len(m.LeftTypes) > 0 {
for _, msg := range m.LeftTypes {
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
}
}
if len(m.RightTypes) > 0 {
for _, msg := range m.RightTypes {
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] = 0x2a
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.Expr.Size()))
n13, err := m.Expr.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n13
dAtA[i] = 0x30
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.Type))
if len(m.OutputColumns) > 0 {
dAtA15 := make([]byte, len(m.OutputColumns)*10)
var j14 int
for _, num := range m.OutputColumns {
for num >= 1<<7 {
dAtA15[j14] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j14++
}
dAtA15[j14] = uint8(num)
j14++
}
dAtA[i] = 0x3a
i++
i = encodeVarintProcessors(dAtA, i, uint64(j14))
i += copy(dAtA[i:], dAtA15[:j14])
}
return i, nil
}
func (m *HashJoinerSpec) 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 *HashJoinerSpec) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.LeftEqColumns) > 0 {
dAtA17 := make([]byte, len(m.LeftEqColumns)*10)
var j16 int
for _, num := range m.LeftEqColumns {
for num >= 1<<7 {
dAtA17[j16] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j16++
}
dAtA17[j16] = uint8(num)
j16++
}
dAtA[i] = 0xa
i++
i = encodeVarintProcessors(dAtA, i, uint64(j16))
i += copy(dAtA[i:], dAtA17[:j16])
}
if len(m.RightEqColumns) > 0 {
dAtA19 := make([]byte, len(m.RightEqColumns)*10)
var j18 int
for _, num := range m.RightEqColumns {
for num >= 1<<7 {
dAtA19[j18] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j18++
}
dAtA19[j18] = uint8(num)
j18++
}
dAtA[i] = 0x12
i++
i = encodeVarintProcessors(dAtA, i, uint64(j18))
i += copy(dAtA[i:], dAtA19[:j18])
}
if len(m.LeftTypes) > 0 {
for _, msg := range m.LeftTypes {
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
}
}
if len(m.RightTypes) > 0 {
for _, msg := range m.RightTypes {
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] = 0x2a
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.Expr.Size()))
n20, err := m.Expr.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n20
dAtA[i] = 0x30
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.Type))
if len(m.OutputColumns) > 0 {
dAtA22 := make([]byte, len(m.OutputColumns)*10)
var j21 int
for _, num := range m.OutputColumns {
for num >= 1<<7 {
dAtA22[j21] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j21++
}
dAtA22[j21] = uint8(num)
j21++
}
dAtA[i] = 0x3a
i++
i = encodeVarintProcessors(dAtA, i, uint64(j21))
i += copy(dAtA[i:], dAtA22[:j21])
}
return i, nil
}
func (m *AggregatorSpec) 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 *AggregatorSpec) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Types) > 0 {
for _, msg := range m.Types {
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.GroupCols) > 0 {
for _, num := range m.GroupCols {
dAtA[i] = 0x10
i++
i = encodeVarintProcessors(dAtA, i, uint64(num))
}
}
if len(m.Exprs) > 0 {
for _, msg := range m.Exprs {
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
}
}
return i, nil
}
func (m *AggregatorSpec_Expr) 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 *AggregatorSpec_Expr) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0x8
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.Func))
dAtA[i] = 0x10
i++
if m.Distinct {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
dAtA[i] = 0x18
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.ColIdx))
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()))
n23, err := m.Noop.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n23
}
if m.TableReader != nil {
dAtA[i] = 0x12
i++
i = encodeVarintProcessors(dAtA, i, uint64(m.TableReader.Size()))
n24, err := m.TableReader.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n24
}