risingwave_pb/
batch_plan.rs

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
// This file is @generated by prost-build.
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RowSeqScanNode {
    #[prost(message, optional, tag = "1")]
    pub table_desc: ::core::option::Option<super::plan_common::StorageTableDesc>,
    #[prost(int32, repeated, tag = "2")]
    pub column_ids: ::prost::alloc::vec::Vec<i32>,
    /// All the ranges need to be read. i.e., they are OR'ed.
    ///
    /// Empty `scan_ranges` means full table scan.
    #[prost(message, repeated, tag = "3")]
    pub scan_ranges: ::prost::alloc::vec::Vec<ScanRange>,
    /// The partition to read for scan tasks.
    ///
    /// Will be filled by the scheduler.
    #[prost(message, optional, tag = "4")]
    pub vnode_bitmap: ::core::option::Option<super::common::Buffer>,
    /// Whether the order on output columns should be preserved.
    #[prost(bool, tag = "5")]
    pub ordered: bool,
    /// The pushed down `batch_limit`. Max rows needed to return.
    #[prost(uint64, optional, tag = "6")]
    pub limit: ::core::option::Option<u64>,
    #[prost(message, optional, tag = "7")]
    pub as_of: ::core::option::Option<super::plan_common::AsOf>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SysRowSeqScanNode {
    #[prost(uint32, tag = "1")]
    pub table_id: u32,
    #[prost(message, repeated, tag = "2")]
    pub column_descs: ::prost::alloc::vec::Vec<super::plan_common::ColumnDesc>,
}
/// The range to scan, which specifies a consecutive range of the PK
/// and can represent: (Suppose there are N columns in the PK)
/// - full table scan: Should not occur. Use an empty `Vec<ScanRange>` instead.
/// - index range scan: `eq_conds` includes i (between 0 and N-1, inclusive) values,
///      and `lower_bound` & `upper_bound` is the range for the (i+1)th column
/// - index point get: `eq_conds` includes N values, and `lower_bound` & `upper_bound` are `None`
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScanRange {
    /// The i-th element represents the value of the i-th PK column.
    #[prost(bytes = "vec", repeated, tag = "1")]
    pub eq_conds: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
    ///   The lower bound of the next PK column subsequent to those in `eq_conds`.
    #[prost(message, optional, tag = "2")]
    pub lower_bound: ::core::option::Option<scan_range::Bound>,
    ///   The upper bound of the next PK column subsequent to those in `eq_conds`.
    #[prost(message, optional, tag = "3")]
    pub upper_bound: ::core::option::Option<scan_range::Bound>,
}
/// Nested message and enum types in `ScanRange`.
pub mod scan_range {
    /// `None` represent unbounded.
    #[derive(prost_helpers::AnyPB)]
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Bound {
        #[prost(bytes = "vec", tag = "1")]
        pub value: ::prost::alloc::vec::Vec<u8>,
        #[prost(bool, tag = "2")]
        pub inclusive: bool,
    }
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SourceNode {
    #[prost(uint32, tag = "1")]
    pub source_id: u32,
    #[prost(message, repeated, tag = "2")]
    pub columns: ::prost::alloc::vec::Vec<super::plan_common::ColumnCatalog>,
    #[prost(btree_map = "string, string", tag = "3")]
    pub with_properties: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    #[prost(bytes = "vec", repeated, tag = "4")]
    pub split: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
    #[prost(message, optional, tag = "5")]
    pub info: ::core::option::Option<super::catalog::StreamSourceInfo>,
    #[prost(btree_map = "string, message", tag = "6")]
    pub secret_refs: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        super::secret::SecretRef,
    >,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IcebergScanNode {
    #[prost(message, repeated, tag = "1")]
    pub columns: ::prost::alloc::vec::Vec<super::plan_common::ColumnCatalog>,
    #[prost(btree_map = "string, string", tag = "2")]
    pub with_properties: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    #[prost(bytes = "vec", repeated, tag = "3")]
    pub split: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
    #[prost(btree_map = "string, message", tag = "4")]
    pub secret_refs: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        super::secret::SecretRef,
    >,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileScanNode {
    #[prost(message, repeated, tag = "1")]
    pub columns: ::prost::alloc::vec::Vec<super::plan_common::ColumnDesc>,
    #[prost(enumeration = "file_scan_node::FileFormat", tag = "2")]
    pub file_format: i32,
    #[prost(enumeration = "file_scan_node::StorageType", tag = "3")]
    pub storage_type: i32,
    #[prost(string, tag = "4")]
    pub s3_region: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub s3_access_key: ::prost::alloc::string::String,
    #[prost(string, tag = "6")]
    pub s3_secret_key: ::prost::alloc::string::String,
    #[prost(string, repeated, tag = "7")]
    pub file_location: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Nested message and enum types in `FileScanNode`.
pub mod file_scan_node {
    #[derive(prost_helpers::AnyPB)]
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum FileFormat {
        Unspecified = 0,
        Parquet = 1,
    }
    impl FileFormat {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                FileFormat::Unspecified => "FILE_FORMAT_UNSPECIFIED",
                FileFormat::Parquet => "PARQUET",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "FILE_FORMAT_UNSPECIFIED" => Some(Self::Unspecified),
                "PARQUET" => Some(Self::Parquet),
                _ => None,
            }
        }
    }
    #[derive(prost_helpers::AnyPB)]
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum StorageType {
        Unspecified = 0,
        S3 = 1,
    }
    impl StorageType {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                StorageType::Unspecified => "STORAGE_TYPE_UNSPECIFIED",
                StorageType::S3 => "S3",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "STORAGE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "S3" => Some(Self::S3),
                _ => None,
            }
        }
    }
}
/// NOTE(kwannoel): This will only be used in batch mode. We can change the definition as needed.
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PostgresQueryNode {
    #[prost(message, repeated, tag = "1")]
    pub columns: ::prost::alloc::vec::Vec<super::plan_common::ColumnDesc>,
    #[prost(string, tag = "2")]
    pub hostname: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub port: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub username: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub password: ::prost::alloc::string::String,
    #[prost(string, tag = "6")]
    pub database: ::prost::alloc::string::String,
    #[prost(string, tag = "7")]
    pub query: ::prost::alloc::string::String,
}
/// NOTE(kwannoel): This will only be used in batch mode. We can change the definition as needed.
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MySqlQueryNode {
    #[prost(message, repeated, tag = "1")]
    pub columns: ::prost::alloc::vec::Vec<super::plan_common::ColumnDesc>,
    #[prost(string, tag = "2")]
    pub hostname: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub port: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub username: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub password: ::prost::alloc::string::String,
    #[prost(string, tag = "6")]
    pub database: ::prost::alloc::string::String,
    #[prost(string, tag = "7")]
    pub query: ::prost::alloc::string::String,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProjectNode {
    #[prost(message, repeated, tag = "1")]
    pub select_list: ::prost::alloc::vec::Vec<super::expr::ExprNode>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FilterNode {
    #[prost(message, optional, tag = "1")]
    pub search_condition: ::core::option::Option<super::expr::ExprNode>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LogRowSeqScanNode {
    #[prost(message, optional, tag = "1")]
    pub table_desc: ::core::option::Option<super::plan_common::StorageTableDesc>,
    /// This records the mandatory column_ids of the original table, excluding op
    #[prost(int32, repeated, tag = "2")]
    pub column_ids: ::prost::alloc::vec::Vec<i32>,
    /// The partition to read for scan tasks.
    ///
    /// Will be filled by the scheduler.
    #[prost(message, optional, tag = "3")]
    pub vnode_bitmap: ::core::option::Option<super::common::Buffer>,
    #[prost(message, optional, tag = "4")]
    pub old_epoch: ::core::option::Option<super::common::BatchQueryEpoch>,
    #[prost(message, optional, tag = "5")]
    pub new_epoch: ::core::option::Option<super::common::BatchQueryEpoch>,
    #[prost(bool, tag = "6")]
    pub ordered: bool,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InsertNode {
    /// Id of the table to perform inserting.
    #[prost(uint32, tag = "1")]
    pub table_id: u32,
    /// Version of the table.
    #[prost(uint64, tag = "5")]
    pub table_version_id: u64,
    #[prost(uint32, repeated, tag = "2")]
    pub column_indices: ::prost::alloc::vec::Vec<u32>,
    #[prost(message, optional, tag = "6")]
    pub default_columns: ::core::option::Option<super::plan_common::DefaultColumns>,
    /// An optional field and will be `None` for tables without user-defined pk.
    /// The `BatchInsertExecutor` should add a column with NULL value which will
    /// be filled in streaming.
    #[prost(uint32, optional, tag = "3")]
    pub row_id_index: ::core::option::Option<u32>,
    #[prost(bool, tag = "4")]
    pub returning: bool,
    /// Session id is used to ensure that dml data from the same session should be sent to a fixed worker node and channel.
    #[prost(uint32, tag = "7")]
    pub session_id: u32,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeleteNode {
    /// Id of the table to perform deleting.
    #[prost(uint32, tag = "1")]
    pub table_id: u32,
    /// Version of the table.
    #[prost(uint64, tag = "3")]
    pub table_version_id: u64,
    #[prost(bool, tag = "2")]
    pub returning: bool,
    /// Session id is used to ensure that dml data from the same session should be sent to a fixed worker node and channel.
    #[prost(uint32, tag = "4")]
    pub session_id: u32,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateNode {
    /// Id of the table to perform updating.
    #[prost(uint32, tag = "1")]
    pub table_id: u32,
    /// Version of the table.
    #[prost(uint64, tag = "2")]
    pub table_version_id: u64,
    /// Expressions to generate `U-` records.
    #[prost(message, repeated, tag = "3")]
    pub old_exprs: ::prost::alloc::vec::Vec<super::expr::ExprNode>,
    /// Expressions to generate `U+` records.
    #[prost(message, repeated, tag = "4")]
    pub new_exprs: ::prost::alloc::vec::Vec<super::expr::ExprNode>,
    #[prost(bool, tag = "5")]
    pub returning: bool,
    /// Session id is used to ensure that dml data from the same session should be sent to a fixed worker node and channel.
    #[prost(uint32, tag = "6")]
    pub session_id: u32,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValuesNode {
    #[prost(message, repeated, tag = "1")]
    pub tuples: ::prost::alloc::vec::Vec<values_node::ExprTuple>,
    #[prost(message, repeated, tag = "2")]
    pub fields: ::prost::alloc::vec::Vec<super::plan_common::Field>,
}
/// Nested message and enum types in `ValuesNode`.
pub mod values_node {
    #[derive(prost_helpers::AnyPB)]
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct ExprTuple {
        #[prost(message, repeated, tag = "1")]
        pub cells: ::prost::alloc::vec::Vec<super::super::expr::ExprNode>,
    }
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SortNode {
    #[prost(message, repeated, tag = "1")]
    pub column_orders: ::prost::alloc::vec::Vec<super::common::ColumnOrder>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TopNNode {
    #[prost(message, repeated, tag = "1")]
    pub column_orders: ::prost::alloc::vec::Vec<super::common::ColumnOrder>,
    #[prost(uint64, tag = "2")]
    pub limit: u64,
    #[prost(uint64, tag = "3")]
    pub offset: u64,
    #[prost(bool, tag = "4")]
    pub with_ties: bool,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GroupTopNNode {
    #[prost(message, repeated, tag = "1")]
    pub column_orders: ::prost::alloc::vec::Vec<super::common::ColumnOrder>,
    #[prost(uint64, tag = "2")]
    pub limit: u64,
    #[prost(uint64, tag = "3")]
    pub offset: u64,
    #[prost(uint32, repeated, tag = "4")]
    pub group_key: ::prost::alloc::vec::Vec<u32>,
    #[prost(bool, tag = "5")]
    pub with_ties: bool,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct LimitNode {
    #[prost(uint64, tag = "1")]
    pub limit: u64,
    #[prost(uint64, tag = "2")]
    pub offset: u64,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NestedLoopJoinNode {
    #[prost(enumeration = "super::plan_common::JoinType", tag = "1")]
    pub join_type: i32,
    #[prost(message, optional, tag = "2")]
    pub join_cond: ::core::option::Option<super::expr::ExprNode>,
    #[prost(uint32, repeated, tag = "3")]
    pub output_indices: ::prost::alloc::vec::Vec<u32>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HashAggNode {
    #[prost(uint32, repeated, tag = "1")]
    pub group_key: ::prost::alloc::vec::Vec<u32>,
    #[prost(message, repeated, tag = "2")]
    pub agg_calls: ::prost::alloc::vec::Vec<super::expr::AggCall>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExpandNode {
    #[prost(message, repeated, tag = "1")]
    pub column_subsets: ::prost::alloc::vec::Vec<expand_node::Subset>,
}
/// Nested message and enum types in `ExpandNode`.
pub mod expand_node {
    #[derive(prost_helpers::AnyPB)]
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Subset {
        #[prost(uint32, repeated, tag = "1")]
        pub column_indices: ::prost::alloc::vec::Vec<u32>,
    }
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProjectSetNode {
    #[prost(message, repeated, tag = "1")]
    pub select_list: ::prost::alloc::vec::Vec<super::expr::ProjectSetSelectItem>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SortAggNode {
    #[prost(message, repeated, tag = "1")]
    pub group_key: ::prost::alloc::vec::Vec<super::expr::ExprNode>,
    #[prost(message, repeated, tag = "2")]
    pub agg_calls: ::prost::alloc::vec::Vec<super::expr::AggCall>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HashJoinNode {
    #[prost(enumeration = "super::plan_common::JoinType", tag = "1")]
    pub join_type: i32,
    #[prost(int32, repeated, tag = "2")]
    pub left_key: ::prost::alloc::vec::Vec<i32>,
    #[prost(int32, repeated, tag = "3")]
    pub right_key: ::prost::alloc::vec::Vec<i32>,
    #[prost(message, optional, tag = "4")]
    pub condition: ::core::option::Option<super::expr::ExprNode>,
    #[prost(uint32, repeated, tag = "5")]
    pub output_indices: ::prost::alloc::vec::Vec<u32>,
    /// Null safe means it treats `null = null` as true.
    /// Each key pair can be null safe independently. (left_key, right_key, null_safe)
    #[prost(bool, repeated, tag = "6")]
    pub null_safe: ::prost::alloc::vec::Vec<bool>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SortMergeJoinNode {
    #[prost(enumeration = "super::plan_common::JoinType", tag = "1")]
    pub join_type: i32,
    #[prost(int32, repeated, tag = "2")]
    pub left_key: ::prost::alloc::vec::Vec<i32>,
    #[prost(int32, repeated, tag = "3")]
    pub right_key: ::prost::alloc::vec::Vec<i32>,
    #[prost(enumeration = "super::common::Direction", tag = "4")]
    pub direction: i32,
    #[prost(uint32, repeated, tag = "5")]
    pub output_indices: ::prost::alloc::vec::Vec<u32>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HopWindowNode {
    #[prost(uint32, tag = "1")]
    pub time_col: u32,
    #[prost(message, optional, tag = "2")]
    pub window_slide: ::core::option::Option<super::data::Interval>,
    #[prost(message, optional, tag = "3")]
    pub window_size: ::core::option::Option<super::data::Interval>,
    #[prost(uint32, repeated, tag = "4")]
    pub output_indices: ::prost::alloc::vec::Vec<u32>,
    #[prost(message, repeated, tag = "5")]
    pub window_start_exprs: ::prost::alloc::vec::Vec<super::expr::ExprNode>,
    #[prost(message, repeated, tag = "6")]
    pub window_end_exprs: ::prost::alloc::vec::Vec<super::expr::ExprNode>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TableFunctionNode {
    #[prost(message, optional, tag = "1")]
    pub table_function: ::core::option::Option<super::expr::TableFunction>,
}
/// Task is a running instance of Stage.
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TaskId {
    #[prost(string, tag = "1")]
    pub query_id: ::prost::alloc::string::String,
    #[prost(uint32, tag = "2")]
    pub stage_id: u32,
    #[prost(uint64, tag = "3")]
    pub task_id: u64,
}
/// Every task will create N buffers (channels) for parent operators to fetch results from,
/// where N is the parallelism of parent stage.
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TaskOutputId {
    #[prost(message, optional, tag = "1")]
    pub task_id: ::core::option::Option<TaskId>,
    /// The id of output channel to fetch from
    #[prost(uint64, tag = "2")]
    pub output_id: u64,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LocalExecutePlan {
    #[prost(message, optional, tag = "1")]
    pub plan: ::core::option::Option<PlanFragment>,
    #[prost(message, optional, tag = "2")]
    pub epoch: ::core::option::Option<super::common::BatchQueryEpoch>,
    #[prost(map = "string, string", tag = "3")]
    pub tracing_context: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
}
/// ExchangeSource describes where to read results from children operators
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExchangeSource {
    #[prost(message, optional, tag = "1")]
    pub task_output_id: ::core::option::Option<TaskOutputId>,
    #[prost(message, optional, tag = "2")]
    pub host: ::core::option::Option<super::common::HostAddress>,
    #[prost(oneof = "exchange_source::LocalExecutePlan", tags = "3")]
    pub local_execute_plan: ::core::option::Option<exchange_source::LocalExecutePlan>,
}
/// Nested message and enum types in `ExchangeSource`.
pub mod exchange_source {
    #[derive(prost_helpers::AnyPB)]
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum LocalExecutePlan {
        #[prost(message, tag = "3")]
        Plan(super::LocalExecutePlan),
    }
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExchangeNode {
    #[prost(message, repeated, tag = "1")]
    pub sources: ::prost::alloc::vec::Vec<ExchangeSource>,
    /// sequential means each tasks of the exchange node will be executed sequentially.
    #[prost(bool, tag = "2")]
    pub sequential: bool,
    #[prost(message, repeated, tag = "3")]
    pub input_schema: ::prost::alloc::vec::Vec<super::plan_common::Field>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MergeSortExchangeNode {
    #[prost(message, optional, tag = "1")]
    pub exchange: ::core::option::Option<ExchangeNode>,
    #[prost(message, repeated, tag = "2")]
    pub column_orders: ::prost::alloc::vec::Vec<super::common::ColumnOrder>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LocalLookupJoinNode {
    #[prost(enumeration = "super::plan_common::JoinType", tag = "1")]
    pub join_type: i32,
    #[prost(message, optional, tag = "2")]
    pub condition: ::core::option::Option<super::expr::ExprNode>,
    #[prost(uint32, repeated, tag = "3")]
    pub outer_side_key: ::prost::alloc::vec::Vec<u32>,
    #[prost(uint32, repeated, tag = "4")]
    pub inner_side_key: ::prost::alloc::vec::Vec<u32>,
    #[prost(uint32, tag = "5")]
    pub lookup_prefix_len: u32,
    #[prost(message, optional, tag = "6")]
    pub inner_side_table_desc: ::core::option::Option<
        super::plan_common::StorageTableDesc,
    >,
    #[prost(uint64, repeated, tag = "7")]
    pub inner_side_vnode_mapping: ::prost::alloc::vec::Vec<u64>,
    #[prost(int32, repeated, tag = "8")]
    pub inner_side_column_ids: ::prost::alloc::vec::Vec<i32>,
    #[prost(uint32, repeated, tag = "9")]
    pub output_indices: ::prost::alloc::vec::Vec<u32>,
    #[prost(message, repeated, tag = "10")]
    pub worker_nodes: ::prost::alloc::vec::Vec<super::common::WorkerNode>,
    /// Null safe means it treats `null = null` as true.
    /// Each key pair can be null safe independently. (left_key, right_key, null_safe)
    #[prost(bool, repeated, tag = "11")]
    pub null_safe: ::prost::alloc::vec::Vec<bool>,
    #[prost(message, optional, tag = "12")]
    pub as_of: ::core::option::Option<super::plan_common::AsOf>,
}
/// RFC: A new schedule way for distributed lookup join
/// <https://github.com/risingwavelabs/rfcs/pull/6>
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DistributedLookupJoinNode {
    #[prost(enumeration = "super::plan_common::JoinType", tag = "1")]
    pub join_type: i32,
    #[prost(message, optional, tag = "2")]
    pub condition: ::core::option::Option<super::expr::ExprNode>,
    #[prost(uint32, repeated, tag = "3")]
    pub outer_side_key: ::prost::alloc::vec::Vec<u32>,
    #[prost(uint32, repeated, tag = "4")]
    pub inner_side_key: ::prost::alloc::vec::Vec<u32>,
    #[prost(uint32, tag = "5")]
    pub lookup_prefix_len: u32,
    #[prost(message, optional, tag = "6")]
    pub inner_side_table_desc: ::core::option::Option<
        super::plan_common::StorageTableDesc,
    >,
    #[prost(int32, repeated, tag = "7")]
    pub inner_side_column_ids: ::prost::alloc::vec::Vec<i32>,
    #[prost(uint32, repeated, tag = "8")]
    pub output_indices: ::prost::alloc::vec::Vec<u32>,
    /// Null safe means it treats `null = null` as true.
    /// Each key pair can be null safe independently. (left_key, right_key, null_safe)
    #[prost(bool, repeated, tag = "9")]
    pub null_safe: ::prost::alloc::vec::Vec<bool>,
    #[prost(message, optional, tag = "10")]
    pub as_of: ::core::option::Option<super::plan_common::AsOf>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct UnionNode {}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SortOverWindowNode {
    #[prost(message, repeated, tag = "1")]
    pub calls: ::prost::alloc::vec::Vec<super::expr::WindowFunction>,
    #[prost(uint32, repeated, tag = "2")]
    pub partition_by: ::prost::alloc::vec::Vec<u32>,
    #[prost(message, repeated, tag = "3")]
    pub order_by: ::prost::alloc::vec::Vec<super::common::ColumnOrder>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct MaxOneRowNode {}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PlanNode {
    #[prost(message, repeated, tag = "1")]
    pub children: ::prost::alloc::vec::Vec<PlanNode>,
    #[prost(string, tag = "24")]
    pub identity: ::prost::alloc::string::String,
    #[prost(
        oneof = "plan_node::NodeBody",
        tags = "2, 3, 4, 5, 7, 8, 9, 10, 11, 14, 15, 16, 17, 18, 19, 21, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 100, 101"
    )]
    pub node_body: ::core::option::Option<plan_node::NodeBody>,
}
/// Nested message and enum types in `PlanNode`.
pub mod plan_node {
    #[derive(prost_helpers::AnyPB)]
    #[derive(::enum_as_inner::EnumAsInner, ::strum::Display)]
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum NodeBody {
        #[prost(message, tag = "2")]
        Insert(super::InsertNode),
        #[prost(message, tag = "3")]
        Delete(super::DeleteNode),
        #[prost(message, tag = "4")]
        Update(super::UpdateNode),
        #[prost(message, tag = "5")]
        Project(super::ProjectNode),
        #[prost(message, tag = "7")]
        HashAgg(super::HashAggNode),
        #[prost(message, tag = "8")]
        Filter(super::FilterNode),
        #[prost(message, tag = "9")]
        Exchange(super::ExchangeNode),
        #[prost(message, tag = "10")]
        Sort(super::SortNode),
        #[prost(message, tag = "11")]
        NestedLoopJoin(super::NestedLoopJoinNode),
        #[prost(message, tag = "14")]
        TopN(super::TopNNode),
        #[prost(message, tag = "15")]
        SortAgg(super::SortAggNode),
        #[prost(message, tag = "16")]
        RowSeqScan(super::RowSeqScanNode),
        #[prost(message, tag = "17")]
        Limit(super::LimitNode),
        #[prost(message, tag = "18")]
        Values(super::ValuesNode),
        #[prost(message, tag = "19")]
        HashJoin(super::HashJoinNode),
        #[prost(message, tag = "21")]
        MergeSortExchange(super::MergeSortExchangeNode),
        #[prost(message, tag = "25")]
        HopWindow(super::HopWindowNode),
        #[prost(message, tag = "26")]
        TableFunction(super::TableFunctionNode),
        #[prost(message, tag = "27")]
        SysRowSeqScan(super::SysRowSeqScanNode),
        #[prost(message, tag = "28")]
        Expand(super::ExpandNode),
        #[prost(message, tag = "29")]
        LocalLookupJoin(super::LocalLookupJoinNode),
        #[prost(message, tag = "30")]
        ProjectSet(super::ProjectSetNode),
        #[prost(message, tag = "31")]
        Union(super::UnionNode),
        #[prost(message, tag = "32")]
        GroupTopN(super::GroupTopNNode),
        #[prost(message, tag = "33")]
        DistributedLookupJoin(super::DistributedLookupJoinNode),
        #[prost(message, tag = "34")]
        Source(super::SourceNode),
        #[prost(message, tag = "35")]
        SortOverWindow(super::SortOverWindowNode),
        #[prost(message, tag = "36")]
        MaxOneRow(super::MaxOneRowNode),
        #[prost(message, tag = "37")]
        LogRowSeqScan(super::LogRowSeqScanNode),
        #[prost(message, tag = "38")]
        FileScan(super::FileScanNode),
        #[prost(message, tag = "39")]
        IcebergScan(super::IcebergScanNode),
        #[prost(message, tag = "40")]
        PostgresQuery(super::PostgresQueryNode),
        #[prost(message, tag = "41")]
        MysqlQuery(super::MySqlQueryNode),
        /// The following nodes are used for testing.
        #[prost(bool, tag = "100")]
        BlockExecutor(bool),
        #[prost(bool, tag = "101")]
        BusyLoopExecutor(bool),
    }
}
/// ExchangeInfo determines how to distribute results to tasks of next stage.
///
/// Note that the fragment itself does not know the where are the receivers. Instead, it prepares results in
/// N buffers and wait for parent operators (`Exchange` nodes) to pull data from a specified buffer
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExchangeInfo {
    #[prost(enumeration = "exchange_info::DistributionMode", tag = "1")]
    pub mode: i32,
    #[prost(oneof = "exchange_info::Distribution", tags = "2, 3, 4")]
    pub distribution: ::core::option::Option<exchange_info::Distribution>,
}
/// Nested message and enum types in `ExchangeInfo`.
pub mod exchange_info {
    #[derive(prost_helpers::AnyPB)]
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
    pub struct BroadcastInfo {
        #[prost(uint32, tag = "1")]
        pub count: u32,
    }
    #[derive(prost_helpers::AnyPB)]
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct HashInfo {
        #[prost(uint32, tag = "1")]
        pub output_count: u32,
        #[prost(uint32, repeated, tag = "3")]
        pub key: ::prost::alloc::vec::Vec<u32>,
    }
    #[derive(prost_helpers::AnyPB)]
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct ConsistentHashInfo {
        /// `vmap` maps virtual node to down stream task id
        #[prost(uint32, repeated, tag = "1")]
        pub vmap: ::prost::alloc::vec::Vec<u32>,
        #[prost(uint32, repeated, tag = "2")]
        pub key: ::prost::alloc::vec::Vec<u32>,
    }
    #[derive(prost_helpers::AnyPB)]
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum DistributionMode {
        /// No partitioning at all, used for root segment which aggregates query results
        Unspecified = 0,
        Single = 1,
        Broadcast = 2,
        Hash = 3,
        ConsistentHash = 4,
    }
    impl DistributionMode {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                DistributionMode::Unspecified => "UNSPECIFIED",
                DistributionMode::Single => "SINGLE",
                DistributionMode::Broadcast => "BROADCAST",
                DistributionMode::Hash => "HASH",
                DistributionMode::ConsistentHash => "CONSISTENT_HASH",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "UNSPECIFIED" => Some(Self::Unspecified),
                "SINGLE" => Some(Self::Single),
                "BROADCAST" => Some(Self::Broadcast),
                "HASH" => Some(Self::Hash),
                "CONSISTENT_HASH" => Some(Self::ConsistentHash),
                _ => None,
            }
        }
    }
    #[derive(prost_helpers::AnyPB)]
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Distribution {
        #[prost(message, tag = "2")]
        BroadcastInfo(BroadcastInfo),
        #[prost(message, tag = "3")]
        HashInfo(HashInfo),
        #[prost(message, tag = "4")]
        ConsistentHashInfo(ConsistentHashInfo),
    }
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PlanFragment {
    #[prost(message, optional, tag = "1")]
    pub root: ::core::option::Option<PlanNode>,
    #[prost(message, optional, tag = "2")]
    pub exchange_info: ::core::option::Option<ExchangeInfo>,
}