risingwave_pb/
stream_plan.rs

1// This file is @generated by prost-build.
2#[derive(prost_helpers::AnyPB)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct Dispatchers {
5    #[prost(message, repeated, tag = "1")]
6    pub dispatchers: ::prost::alloc::vec::Vec<Dispatcher>,
7}
8#[derive(prost_helpers::AnyPB)]
9#[derive(Clone, PartialEq, ::prost::Message)]
10pub struct AddMutation {
11    /// New dispatchers for each actor.
12    #[prost(map = "uint32, message", tag = "1")]
13    pub actor_dispatchers: ::std::collections::HashMap<u32, Dispatchers>,
14    /// All actors to be added (to the main connected component of the graph) in this update.
15    #[prost(uint32, repeated, tag = "3")]
16    pub added_actors: ::prost::alloc::vec::Vec<u32>,
17    /// We may embed a source change split mutation here.
18    /// `Source` and `SourceBackfill` are handled together here.
19    /// TODO: we may allow multiple mutations in a single barrier.
20    #[prost(map = "uint32, message", tag = "2")]
21    pub actor_splits: ::std::collections::HashMap<u32, super::source::ConnectorSplits>,
22    /// We may embed a pause mutation here.
23    /// TODO: we may allow multiple mutations in a single barrier.
24    #[prost(bool, tag = "4")]
25    pub pause: bool,
26    #[prost(message, repeated, tag = "5")]
27    pub subscriptions_to_add: ::prost::alloc::vec::Vec<SubscriptionUpstreamInfo>,
28    /// nodes which should be paused initially.
29    #[prost(uint32, repeated, tag = "6")]
30    pub backfill_nodes_to_pause: ::prost::alloc::vec::Vec<u32>,
31}
32#[derive(prost_helpers::AnyPB)]
33#[derive(Clone, PartialEq, ::prost::Message)]
34pub struct StopMutation {
35    #[prost(uint32, repeated, tag = "1")]
36    pub actors: ::prost::alloc::vec::Vec<u32>,
37}
38#[derive(prost_helpers::AnyPB)]
39#[derive(Clone, PartialEq, ::prost::Message)]
40pub struct UpdateMutation {
41    /// Dispatcher updates.
42    #[prost(message, repeated, tag = "1")]
43    pub dispatcher_update: ::prost::alloc::vec::Vec<update_mutation::DispatcherUpdate>,
44    /// Merge updates.
45    #[prost(message, repeated, tag = "2")]
46    pub merge_update: ::prost::alloc::vec::Vec<update_mutation::MergeUpdate>,
47    /// Vnode bitmap updates for each actor.
48    #[prost(map = "uint32, message", tag = "3")]
49    pub actor_vnode_bitmap_update: ::std::collections::HashMap<
50        u32,
51        super::common::Buffer,
52    >,
53    /// All actors to be dropped in this update.
54    #[prost(uint32, repeated, tag = "4")]
55    pub dropped_actors: ::prost::alloc::vec::Vec<u32>,
56    /// Source updates.
57    /// `Source` and `SourceBackfill` are handled together here.
58    #[prost(map = "uint32, message", tag = "5")]
59    pub actor_splits: ::std::collections::HashMap<u32, super::source::ConnectorSplits>,
60    /// When modifying the Materialized View, we need to recreate the Dispatcher from the old upstream to the new TableFragment.
61    /// Consistent with the semantics in AddMutation.
62    #[prost(map = "uint32, message", tag = "6")]
63    pub actor_new_dispatchers: ::std::collections::HashMap<u32, Dispatchers>,
64}
65/// Nested message and enum types in `UpdateMutation`.
66pub mod update_mutation {
67    #[derive(prost_helpers::AnyPB)]
68    #[derive(Clone, PartialEq, ::prost::Message)]
69    pub struct DispatcherUpdate {
70        /// Dispatcher can be uniquely identified by a combination of actor id and dispatcher id.
71        #[prost(uint32, tag = "1")]
72        pub actor_id: u32,
73        #[prost(uint64, tag = "2")]
74        pub dispatcher_id: u64,
75        /// The hash mapping for consistent hash.
76        /// For dispatcher types other than HASH, this is ignored.
77        #[prost(message, optional, tag = "3")]
78        pub hash_mapping: ::core::option::Option<super::ActorMapping>,
79        /// Added downstream actors.
80        #[prost(uint32, repeated, tag = "4")]
81        pub added_downstream_actor_id: ::prost::alloc::vec::Vec<u32>,
82        /// Removed downstream actors.
83        #[prost(uint32, repeated, tag = "5")]
84        pub removed_downstream_actor_id: ::prost::alloc::vec::Vec<u32>,
85    }
86    #[derive(prost_helpers::AnyPB)]
87    #[derive(Clone, PartialEq, ::prost::Message)]
88    pub struct MergeUpdate {
89        /// Merge executor can be uniquely identified by a combination of actor id and upstream fragment id.
90        #[prost(uint32, tag = "1")]
91        pub actor_id: u32,
92        #[prost(uint32, tag = "2")]
93        pub upstream_fragment_id: u32,
94        /// - For scaling, this is always `None`.
95        /// - For plan change, the upstream fragment will be changed to a new one, and this will be `Some`.
96        ///    In this case, all the upstream actors should be removed and replaced by the `new` ones.
97        #[prost(uint32, optional, tag = "5")]
98        pub new_upstream_fragment_id: ::core::option::Option<u32>,
99        /// Added upstream actors.
100        #[prost(message, repeated, tag = "3")]
101        pub added_upstream_actors: ::prost::alloc::vec::Vec<
102            super::super::common::ActorInfo,
103        >,
104        /// Removed upstream actors.
105        /// Note: this is empty for replace job.
106        #[prost(uint32, repeated, tag = "4")]
107        pub removed_upstream_actor_id: ::prost::alloc::vec::Vec<u32>,
108    }
109}
110#[derive(prost_helpers::AnyPB)]
111#[derive(Clone, PartialEq, ::prost::Message)]
112pub struct SourceChangeSplitMutation {
113    /// `Source` and `SourceBackfill` are handled together here.
114    #[prost(map = "uint32, message", tag = "2")]
115    pub actor_splits: ::std::collections::HashMap<u32, super::source::ConnectorSplits>,
116}
117#[derive(prost_helpers::AnyPB)]
118#[derive(Clone, Copy, PartialEq, ::prost::Message)]
119pub struct PauseMutation {}
120#[derive(prost_helpers::AnyPB)]
121#[derive(Clone, Copy, PartialEq, ::prost::Message)]
122pub struct ResumeMutation {}
123#[derive(prost_helpers::AnyPB)]
124#[derive(Clone, PartialEq, ::prost::Message)]
125pub struct ThrottleMutation {
126    #[prost(map = "uint32, message", tag = "1")]
127    pub actor_throttle: ::std::collections::HashMap<u32, throttle_mutation::RateLimit>,
128}
129/// Nested message and enum types in `ThrottleMutation`.
130pub mod throttle_mutation {
131    #[derive(prost_helpers::AnyPB)]
132    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
133    pub struct RateLimit {
134        #[prost(uint32, optional, tag = "1")]
135        pub rate_limit: ::core::option::Option<u32>,
136    }
137}
138#[derive(prost_helpers::AnyPB)]
139#[derive(Clone, PartialEq, ::prost::Message)]
140pub struct CombinedMutation {
141    #[prost(message, repeated, tag = "1")]
142    pub mutations: ::prost::alloc::vec::Vec<BarrierMutation>,
143}
144#[derive(prost_helpers::AnyPB)]
145#[derive(Clone, Copy, PartialEq, ::prost::Message)]
146pub struct SubscriptionUpstreamInfo {
147    /// can either be subscription_id or table_id of creating TableFragments
148    #[prost(uint32, tag = "1")]
149    pub subscriber_id: u32,
150    #[prost(uint32, tag = "2")]
151    pub upstream_mv_table_id: u32,
152}
153#[derive(prost_helpers::AnyPB)]
154#[derive(Clone, PartialEq, ::prost::Message)]
155pub struct DropSubscriptionsMutation {
156    #[prost(message, repeated, tag = "1")]
157    pub info: ::prost::alloc::vec::Vec<SubscriptionUpstreamInfo>,
158}
159#[derive(prost_helpers::AnyPB)]
160#[derive(Clone, PartialEq, ::prost::Message)]
161pub struct ConnectorPropsChangeMutation {
162    #[prost(map = "uint32, message", tag = "1")]
163    pub connector_props_infos: ::std::collections::HashMap<
164        u32,
165        connector_props_change_mutation::ConnectorPropsInfo,
166    >,
167}
168/// Nested message and enum types in `ConnectorPropsChangeMutation`.
169pub mod connector_props_change_mutation {
170    #[derive(prost_helpers::AnyPB)]
171    #[derive(Clone, PartialEq, ::prost::Message)]
172    pub struct ConnectorPropsInfo {
173        #[prost(map = "string, string", tag = "1")]
174        pub connector_props_info: ::std::collections::HashMap<
175            ::prost::alloc::string::String,
176            ::prost::alloc::string::String,
177        >,
178    }
179}
180#[derive(prost_helpers::AnyPB)]
181#[derive(Clone, PartialEq, ::prost::Message)]
182pub struct StartFragmentBackfillMutation {
183    #[prost(uint32, repeated, tag = "1")]
184    pub fragment_ids: ::prost::alloc::vec::Vec<u32>,
185}
186#[derive(prost_helpers::AnyPB)]
187#[derive(Clone, PartialEq, ::prost::Message)]
188pub struct BarrierMutation {
189    #[prost(
190        oneof = "barrier_mutation::Mutation",
191        tags = "3, 4, 5, 6, 7, 8, 10, 12, 13, 14, 100"
192    )]
193    pub mutation: ::core::option::Option<barrier_mutation::Mutation>,
194}
195/// Nested message and enum types in `BarrierMutation`.
196pub mod barrier_mutation {
197    #[derive(prost_helpers::AnyPB)]
198    #[derive(Clone, PartialEq, ::prost::Oneof)]
199    pub enum Mutation {
200        /// Add new dispatchers to some actors, used for creating materialized views.
201        #[prost(message, tag = "3")]
202        Add(super::AddMutation),
203        /// Stop a set of actors, used for dropping materialized views. Empty dispatchers will be
204        /// automatically removed.
205        #[prost(message, tag = "4")]
206        Stop(super::StopMutation),
207        /// Update outputs and hash mappings for some dispatchers, used for scaling and replace table.
208        #[prost(message, tag = "5")]
209        Update(super::UpdateMutation),
210        /// Change the split of some sources.
211        #[prost(message, tag = "6")]
212        Splits(super::SourceChangeSplitMutation),
213        /// Pause the dataflow of the whole streaming graph, only used for scaling.
214        #[prost(message, tag = "7")]
215        Pause(super::PauseMutation),
216        /// Resume the dataflow of the whole streaming graph, only used for scaling.
217        #[prost(message, tag = "8")]
218        Resume(super::ResumeMutation),
219        /// Throttle specific source exec or backfill exec.
220        #[prost(message, tag = "10")]
221        Throttle(super::ThrottleMutation),
222        /// Drop subscription on mv
223        #[prost(message, tag = "12")]
224        DropSubscriptions(super::DropSubscriptionsMutation),
225        /// Alter sink/connector/source props
226        #[prost(message, tag = "13")]
227        ConnectorPropsChange(super::ConnectorPropsChangeMutation),
228        /// Start backfilling for specific fragments
229        /// This is separated from `ThrottleMutation::NO_RATE_LIMIT`.
230        /// This is because user may concurrently rate limit + use backfill order control.
231        /// If we use rate limit to pause / resume backfill fragments, if user manually
232        /// resumes some fragments, this will overwrite the backfill order configuration.
233        #[prost(message, tag = "14")]
234        StartFragmentBackfill(super::StartFragmentBackfillMutation),
235        /// Combined mutation.
236        /// Currently, it can only be Add & Update, which is for sink into table.
237        #[prost(message, tag = "100")]
238        Combined(super::CombinedMutation),
239    }
240}
241#[derive(prost_helpers::AnyPB)]
242#[derive(Clone, PartialEq, ::prost::Message)]
243pub struct Barrier {
244    #[prost(message, optional, tag = "1")]
245    pub epoch: ::core::option::Option<super::data::Epoch>,
246    #[prost(message, optional, tag = "3")]
247    pub mutation: ::core::option::Option<BarrierMutation>,
248    /// Used for tracing.
249    #[prost(map = "string, string", tag = "2")]
250    pub tracing_context: ::std::collections::HashMap<
251        ::prost::alloc::string::String,
252        ::prost::alloc::string::String,
253    >,
254    /// The kind of the barrier.
255    #[prost(enumeration = "barrier::BarrierKind", tag = "9")]
256    pub kind: i32,
257    /// Record the actors that the barrier has passed. Only used for debugging.
258    #[prost(uint32, repeated, tag = "255")]
259    pub passed_actors: ::prost::alloc::vec::Vec<u32>,
260}
261/// Nested message and enum types in `Barrier`.
262pub mod barrier {
263    #[derive(prost_helpers::AnyPB)]
264    #[derive(::enum_as_inner::EnumAsInner)]
265    #[derive(
266        Clone,
267        Copy,
268        Debug,
269        PartialEq,
270        Eq,
271        Hash,
272        PartialOrd,
273        Ord,
274        ::prost::Enumeration
275    )]
276    #[repr(i32)]
277    pub enum BarrierKind {
278        Unspecified = 0,
279        /// The first barrier after a fresh start or recovery.
280        /// There will be no data associated with the previous epoch of the barrier.
281        Initial = 1,
282        /// A normal barrier. Data should be flushed locally.
283        Barrier = 2,
284        /// A checkpoint barrier. Data should be synchorized to the shared storage.
285        Checkpoint = 3,
286    }
287    impl BarrierKind {
288        /// String value of the enum field names used in the ProtoBuf definition.
289        ///
290        /// The values are not transformed in any way and thus are considered stable
291        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
292        pub fn as_str_name(&self) -> &'static str {
293            match self {
294                Self::Unspecified => "BARRIER_KIND_UNSPECIFIED",
295                Self::Initial => "BARRIER_KIND_INITIAL",
296                Self::Barrier => "BARRIER_KIND_BARRIER",
297                Self::Checkpoint => "BARRIER_KIND_CHECKPOINT",
298            }
299        }
300        /// Creates an enum from field names used in the ProtoBuf definition.
301        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
302            match value {
303                "BARRIER_KIND_UNSPECIFIED" => Some(Self::Unspecified),
304                "BARRIER_KIND_INITIAL" => Some(Self::Initial),
305                "BARRIER_KIND_BARRIER" => Some(Self::Barrier),
306                "BARRIER_KIND_CHECKPOINT" => Some(Self::Checkpoint),
307                _ => None,
308            }
309        }
310    }
311}
312#[derive(prost_helpers::AnyPB)]
313#[derive(Clone, PartialEq, ::prost::Message)]
314pub struct Watermark {
315    /// The reference to the watermark column in the stream's schema.
316    #[prost(message, optional, tag = "1")]
317    pub column: ::core::option::Option<super::expr::InputRef>,
318    /// The watermark value, there will be no record having a greater value in the watermark column.
319    #[prost(message, optional, tag = "3")]
320    pub val: ::core::option::Option<super::data::Datum>,
321}
322#[derive(prost_helpers::AnyPB)]
323#[derive(Clone, PartialEq, ::prost::Message)]
324pub struct StreamMessage {
325    #[prost(oneof = "stream_message::StreamMessage", tags = "1, 2, 3")]
326    pub stream_message: ::core::option::Option<stream_message::StreamMessage>,
327}
328/// Nested message and enum types in `StreamMessage`.
329pub mod stream_message {
330    #[derive(prost_helpers::AnyPB)]
331    #[derive(Clone, PartialEq, ::prost::Oneof)]
332    pub enum StreamMessage {
333        #[prost(message, tag = "1")]
334        StreamChunk(super::super::data::StreamChunk),
335        #[prost(message, tag = "2")]
336        Barrier(super::Barrier),
337        #[prost(message, tag = "3")]
338        Watermark(super::Watermark),
339    }
340}
341#[derive(prost_helpers::AnyPB)]
342#[derive(Clone, PartialEq, ::prost::Message)]
343pub struct StreamMessageBatch {
344    #[prost(oneof = "stream_message_batch::StreamMessageBatch", tags = "1, 2, 3")]
345    pub stream_message_batch: ::core::option::Option<
346        stream_message_batch::StreamMessageBatch,
347    >,
348}
349/// Nested message and enum types in `StreamMessageBatch`.
350pub mod stream_message_batch {
351    #[derive(prost_helpers::AnyPB)]
352    #[derive(Clone, PartialEq, ::prost::Message)]
353    pub struct BarrierBatch {
354        #[prost(message, repeated, tag = "1")]
355        pub barriers: ::prost::alloc::vec::Vec<super::Barrier>,
356    }
357    #[derive(prost_helpers::AnyPB)]
358    #[derive(Clone, PartialEq, ::prost::Oneof)]
359    pub enum StreamMessageBatch {
360        #[prost(message, tag = "1")]
361        StreamChunk(super::super::data::StreamChunk),
362        #[prost(message, tag = "2")]
363        BarrierBatch(BarrierBatch),
364        #[prost(message, tag = "3")]
365        Watermark(super::Watermark),
366    }
367}
368/// Hash mapping for compute node. Stores mapping from virtual node to actor id.
369#[derive(prost_helpers::AnyPB)]
370#[derive(Clone, PartialEq, ::prost::Message)]
371pub struct ActorMapping {
372    #[prost(uint32, repeated, tag = "1")]
373    pub original_indices: ::prost::alloc::vec::Vec<u32>,
374    #[prost(uint32, repeated, tag = "2")]
375    pub data: ::prost::alloc::vec::Vec<u32>,
376}
377#[derive(prost_helpers::AnyPB)]
378#[derive(Clone, PartialEq, ::prost::Message)]
379pub struct StreamSource {
380    #[prost(uint32, tag = "1")]
381    pub source_id: u32,
382    #[prost(message, optional, tag = "2")]
383    pub state_table: ::core::option::Option<super::catalog::Table>,
384    #[prost(uint32, optional, tag = "3")]
385    pub row_id_index: ::core::option::Option<u32>,
386    #[prost(message, repeated, tag = "4")]
387    pub columns: ::prost::alloc::vec::Vec<super::plan_common::ColumnCatalog>,
388    #[prost(btree_map = "string, string", tag = "6")]
389    pub with_properties: ::prost::alloc::collections::BTreeMap<
390        ::prost::alloc::string::String,
391        ::prost::alloc::string::String,
392    >,
393    #[prost(message, optional, tag = "7")]
394    pub info: ::core::option::Option<super::catalog::StreamSourceInfo>,
395    #[prost(string, tag = "8")]
396    pub source_name: ::prost::alloc::string::String,
397    /// Source rate limit
398    #[prost(uint32, optional, tag = "9")]
399    pub rate_limit: ::core::option::Option<u32>,
400    #[prost(btree_map = "string, message", tag = "10")]
401    pub secret_refs: ::prost::alloc::collections::BTreeMap<
402        ::prost::alloc::string::String,
403        super::secret::SecretRef,
404    >,
405}
406/// copy contents from StreamSource to prevent compatibility issues in the future
407#[derive(prost_helpers::AnyPB)]
408#[derive(Clone, PartialEq, ::prost::Message)]
409pub struct StreamFsFetch {
410    #[prost(uint32, tag = "1")]
411    pub source_id: u32,
412    #[prost(message, optional, tag = "2")]
413    pub state_table: ::core::option::Option<super::catalog::Table>,
414    #[prost(uint32, optional, tag = "3")]
415    pub row_id_index: ::core::option::Option<u32>,
416    #[prost(message, repeated, tag = "4")]
417    pub columns: ::prost::alloc::vec::Vec<super::plan_common::ColumnCatalog>,
418    #[prost(btree_map = "string, string", tag = "6")]
419    pub with_properties: ::prost::alloc::collections::BTreeMap<
420        ::prost::alloc::string::String,
421        ::prost::alloc::string::String,
422    >,
423    #[prost(message, optional, tag = "7")]
424    pub info: ::core::option::Option<super::catalog::StreamSourceInfo>,
425    #[prost(string, tag = "8")]
426    pub source_name: ::prost::alloc::string::String,
427    /// Source rate limit
428    #[prost(uint32, optional, tag = "9")]
429    pub rate_limit: ::core::option::Option<u32>,
430    #[prost(btree_map = "string, message", tag = "10")]
431    pub secret_refs: ::prost::alloc::collections::BTreeMap<
432        ::prost::alloc::string::String,
433        super::secret::SecretRef,
434    >,
435}
436/// The executor only for receiving barrier from the meta service. It always resides in the leaves
437/// of the streaming graph.
438#[derive(prost_helpers::AnyPB)]
439#[derive(Clone, Copy, PartialEq, ::prost::Message)]
440pub struct BarrierRecvNode {}
441#[derive(prost_helpers::AnyPB)]
442#[derive(Clone, PartialEq, ::prost::Message)]
443pub struct SourceNode {
444    /// The source node can contain either a stream source or nothing. So here we extract all
445    /// information about stream source to a message, and here it will be an `Option` in Rust.
446    #[prost(message, optional, tag = "1")]
447    pub source_inner: ::core::option::Option<StreamSource>,
448}
449#[derive(prost_helpers::AnyPB)]
450#[derive(Clone, PartialEq, ::prost::Message)]
451pub struct StreamFsFetchNode {
452    #[prost(message, optional, tag = "1")]
453    pub node_inner: ::core::option::Option<StreamFsFetch>,
454}
455/// / It's input must be a `MergeNode`, which connects to the upstream source job.
456/// / See `StreamSourceScan::adhoc_to_stream_prost` for the plan.
457#[derive(prost_helpers::AnyPB)]
458#[derive(Clone, PartialEq, ::prost::Message)]
459pub struct SourceBackfillNode {
460    #[prost(uint32, tag = "1")]
461    pub upstream_source_id: u32,
462    #[prost(uint32, optional, tag = "2")]
463    pub row_id_index: ::core::option::Option<u32>,
464    #[prost(message, repeated, tag = "3")]
465    pub columns: ::prost::alloc::vec::Vec<super::plan_common::ColumnCatalog>,
466    #[prost(message, optional, tag = "4")]
467    pub info: ::core::option::Option<super::catalog::StreamSourceInfo>,
468    #[prost(string, tag = "5")]
469    pub source_name: ::prost::alloc::string::String,
470    #[prost(btree_map = "string, string", tag = "6")]
471    pub with_properties: ::prost::alloc::collections::BTreeMap<
472        ::prost::alloc::string::String,
473        ::prost::alloc::string::String,
474    >,
475    /// Backfill rate limit
476    #[prost(uint32, optional, tag = "7")]
477    pub rate_limit: ::core::option::Option<u32>,
478    /// `| partition_id | backfill_progress |`
479    #[prost(message, optional, tag = "8")]
480    pub state_table: ::core::option::Option<super::catalog::Table>,
481    #[prost(btree_map = "string, message", tag = "9")]
482    pub secret_refs: ::prost::alloc::collections::BTreeMap<
483        ::prost::alloc::string::String,
484        super::secret::SecretRef,
485    >,
486}
487#[derive(prost_helpers::AnyPB)]
488#[derive(Clone, PartialEq, ::prost::Message)]
489pub struct SinkDesc {
490    #[prost(uint32, tag = "1")]
491    pub id: u32,
492    #[prost(string, tag = "2")]
493    pub name: ::prost::alloc::string::String,
494    #[prost(string, tag = "3")]
495    pub definition: ::prost::alloc::string::String,
496    #[prost(message, repeated, tag = "5")]
497    pub plan_pk: ::prost::alloc::vec::Vec<super::common::ColumnOrder>,
498    #[prost(uint32, repeated, tag = "6")]
499    pub downstream_pk: ::prost::alloc::vec::Vec<u32>,
500    #[prost(uint32, repeated, tag = "7")]
501    pub distribution_key: ::prost::alloc::vec::Vec<u32>,
502    #[prost(btree_map = "string, string", tag = "8")]
503    pub properties: ::prost::alloc::collections::BTreeMap<
504        ::prost::alloc::string::String,
505        ::prost::alloc::string::String,
506    >,
507    /// to be deprecated
508    #[prost(enumeration = "super::catalog::SinkType", tag = "9")]
509    pub sink_type: i32,
510    #[prost(message, repeated, tag = "10")]
511    pub column_catalogs: ::prost::alloc::vec::Vec<super::plan_common::ColumnCatalog>,
512    #[prost(string, tag = "11")]
513    pub db_name: ::prost::alloc::string::String,
514    /// If the sink is from table or mv, this is name of the table/mv. Otherwise
515    /// it is the name of the sink itself.
516    #[prost(string, tag = "12")]
517    pub sink_from_name: ::prost::alloc::string::String,
518    #[prost(message, optional, tag = "13")]
519    pub format_desc: ::core::option::Option<super::catalog::SinkFormatDesc>,
520    #[prost(uint32, optional, tag = "14")]
521    pub target_table: ::core::option::Option<u32>,
522    #[prost(uint64, optional, tag = "15")]
523    pub extra_partition_col_idx: ::core::option::Option<u64>,
524    #[prost(btree_map = "string, message", tag = "16")]
525    pub secret_refs: ::prost::alloc::collections::BTreeMap<
526        ::prost::alloc::string::String,
527        super::secret::SecretRef,
528    >,
529}
530#[derive(prost_helpers::AnyPB)]
531#[derive(Clone, PartialEq, ::prost::Message)]
532pub struct SinkNode {
533    #[prost(message, optional, tag = "1")]
534    pub sink_desc: ::core::option::Option<SinkDesc>,
535    /// A sink with a kv log store should have a table.
536    #[prost(message, optional, tag = "2")]
537    pub table: ::core::option::Option<super::catalog::Table>,
538    #[prost(enumeration = "SinkLogStoreType", tag = "3")]
539    pub log_store_type: i32,
540    #[prost(uint32, optional, tag = "4")]
541    pub rate_limit: ::core::option::Option<u32>,
542}
543#[derive(prost_helpers::AnyPB)]
544#[derive(Clone, PartialEq, ::prost::Message)]
545pub struct ProjectNode {
546    #[prost(message, repeated, tag = "1")]
547    pub select_list: ::prost::alloc::vec::Vec<super::expr::ExprNode>,
548    /// this two field is expressing a list of usize pair, which means when project receives a
549    /// watermark with `watermark_input_cols\[i\]` column index, it should derive a new watermark
550    /// with `watermark_output_cols\[i\]`th expression
551    #[prost(uint32, repeated, tag = "2")]
552    pub watermark_input_cols: ::prost::alloc::vec::Vec<u32>,
553    #[prost(uint32, repeated, tag = "3")]
554    pub watermark_output_cols: ::prost::alloc::vec::Vec<u32>,
555    #[prost(uint32, repeated, tag = "4")]
556    pub nondecreasing_exprs: ::prost::alloc::vec::Vec<u32>,
557    /// Whether there are likely no-op updates in the output chunks, so that eliminating them with
558    /// `StreamChunk::eliminate_adjacent_noop_update` could be beneficial.
559    #[prost(bool, tag = "5")]
560    pub noop_update_hint: bool,
561}
562#[derive(prost_helpers::AnyPB)]
563#[derive(Clone, PartialEq, ::prost::Message)]
564pub struct FilterNode {
565    #[prost(message, optional, tag = "1")]
566    pub search_condition: ::core::option::Option<super::expr::ExprNode>,
567}
568#[derive(prost_helpers::AnyPB)]
569#[derive(Clone, Copy, PartialEq, ::prost::Message)]
570pub struct ChangeLogNode {
571    /// Whether or not there is an op in the final output.
572    #[prost(bool, tag = "1")]
573    pub need_op: bool,
574}
575#[derive(prost_helpers::AnyPB)]
576#[derive(Clone, PartialEq, ::prost::Message)]
577pub struct CdcFilterNode {
578    #[prost(message, optional, tag = "1")]
579    pub search_condition: ::core::option::Option<super::expr::ExprNode>,
580    #[prost(uint32, tag = "2")]
581    pub upstream_source_id: u32,
582}
583/// A materialized view is regarded as a table.
584/// In addition, we also specify primary key to MV for efficient point lookup during update and deletion.
585///
586/// The node will be used for both create mv and create index.
587/// - When creating mv, `pk == distribution_key == column_orders`.
588/// - When creating index, `column_orders` will contain both
589///    arrange columns and pk columns, while distribution key will be arrange columns.
590#[derive(prost_helpers::AnyPB)]
591#[derive(Clone, PartialEq, ::prost::Message)]
592pub struct MaterializeNode {
593    #[prost(uint32, tag = "1")]
594    pub table_id: u32,
595    /// Column indexes and orders of primary key.
596    #[prost(message, repeated, tag = "2")]
597    pub column_orders: ::prost::alloc::vec::Vec<super::common::ColumnOrder>,
598    /// Used for internal table states.
599    #[prost(message, optional, tag = "3")]
600    pub table: ::core::option::Option<super::catalog::Table>,
601}
602#[derive(prost_helpers::AnyPB)]
603#[derive(Clone, PartialEq, ::prost::Message)]
604pub struct AggCallState {
605    #[prost(oneof = "agg_call_state::Inner", tags = "1, 3")]
606    pub inner: ::core::option::Option<agg_call_state::Inner>,
607}
608/// Nested message and enum types in `AggCallState`.
609pub mod agg_call_state {
610    /// the state is stored in the intermediate state table. used for count/sum/append-only extreme.
611    #[derive(prost_helpers::AnyPB)]
612    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
613    pub struct ValueState {}
614    /// use the some column of the Upstream's materialization as the AggCall's state, used for extreme/string_agg/array_agg.
615    #[derive(prost_helpers::AnyPB)]
616    #[derive(Clone, PartialEq, ::prost::Message)]
617    pub struct MaterializedInputState {
618        #[prost(message, optional, tag = "1")]
619        pub table: ::core::option::Option<super::super::catalog::Table>,
620        /// for constructing state table column mapping
621        #[prost(uint32, repeated, tag = "2")]
622        pub included_upstream_indices: ::prost::alloc::vec::Vec<u32>,
623        #[prost(uint32, repeated, tag = "3")]
624        pub table_value_indices: ::prost::alloc::vec::Vec<u32>,
625        #[prost(message, repeated, tag = "4")]
626        pub order_columns: ::prost::alloc::vec::Vec<super::super::common::ColumnOrder>,
627    }
628    #[derive(prost_helpers::AnyPB)]
629    #[derive(Clone, PartialEq, ::prost::Oneof)]
630    pub enum Inner {
631        #[prost(message, tag = "1")]
632        ValueState(ValueState),
633        #[prost(message, tag = "3")]
634        MaterializedInputState(MaterializedInputState),
635    }
636}
637#[derive(prost_helpers::AnyPB)]
638#[derive(Clone, PartialEq, ::prost::Message)]
639pub struct SimpleAggNode {
640    #[prost(message, repeated, tag = "1")]
641    pub agg_calls: ::prost::alloc::vec::Vec<super::expr::AggCall>,
642    /// Only used for stateless simple agg.
643    #[prost(uint32, repeated, tag = "2")]
644    pub distribution_key: ::prost::alloc::vec::Vec<u32>,
645    #[prost(message, repeated, tag = "3")]
646    pub agg_call_states: ::prost::alloc::vec::Vec<AggCallState>,
647    #[prost(message, optional, tag = "4")]
648    pub intermediate_state_table: ::core::option::Option<super::catalog::Table>,
649    /// Whether to optimize for append only stream.
650    /// It is true when the input is append-only
651    #[prost(bool, tag = "5")]
652    pub is_append_only: bool,
653    #[prost(map = "uint32, message", tag = "6")]
654    pub distinct_dedup_tables: ::std::collections::HashMap<u32, super::catalog::Table>,
655    #[prost(uint32, tag = "7")]
656    pub row_count_index: u32,
657    #[prost(enumeration = "AggNodeVersion", tag = "8")]
658    pub version: i32,
659    /// Required by the downstream `RowMergeNode`,
660    /// currently only used by the `approx_percentile`'s two phase plan
661    #[prost(bool, tag = "9")]
662    pub must_output_per_barrier: bool,
663}
664#[derive(prost_helpers::AnyPB)]
665#[derive(Clone, PartialEq, ::prost::Message)]
666pub struct HashAggNode {
667    #[prost(uint32, repeated, tag = "1")]
668    pub group_key: ::prost::alloc::vec::Vec<u32>,
669    #[prost(message, repeated, tag = "2")]
670    pub agg_calls: ::prost::alloc::vec::Vec<super::expr::AggCall>,
671    #[prost(message, repeated, tag = "3")]
672    pub agg_call_states: ::prost::alloc::vec::Vec<AggCallState>,
673    #[prost(message, optional, tag = "4")]
674    pub intermediate_state_table: ::core::option::Option<super::catalog::Table>,
675    /// Whether to optimize for append only stream.
676    /// It is true when the input is append-only
677    #[prost(bool, tag = "5")]
678    pub is_append_only: bool,
679    #[prost(map = "uint32, message", tag = "6")]
680    pub distinct_dedup_tables: ::std::collections::HashMap<u32, super::catalog::Table>,
681    #[prost(uint32, tag = "7")]
682    pub row_count_index: u32,
683    #[prost(bool, tag = "8")]
684    pub emit_on_window_close: bool,
685    #[prost(enumeration = "AggNodeVersion", tag = "9")]
686    pub version: i32,
687}
688#[derive(prost_helpers::AnyPB)]
689#[derive(Clone, PartialEq, ::prost::Message)]
690pub struct TopNNode {
691    /// 0 means no limit as limit of 0 means this node should be optimized away
692    #[prost(uint64, tag = "1")]
693    pub limit: u64,
694    #[prost(uint64, tag = "2")]
695    pub offset: u64,
696    #[prost(message, optional, tag = "3")]
697    pub table: ::core::option::Option<super::catalog::Table>,
698    #[prost(message, repeated, tag = "4")]
699    pub order_by: ::prost::alloc::vec::Vec<super::common::ColumnOrder>,
700    #[prost(bool, tag = "5")]
701    pub with_ties: bool,
702}
703#[derive(prost_helpers::AnyPB)]
704#[derive(Clone, PartialEq, ::prost::Message)]
705pub struct GroupTopNNode {
706    /// 0 means no limit as limit of 0 means this node should be optimized away
707    #[prost(uint64, tag = "1")]
708    pub limit: u64,
709    #[prost(uint64, tag = "2")]
710    pub offset: u64,
711    #[prost(uint32, repeated, tag = "3")]
712    pub group_key: ::prost::alloc::vec::Vec<u32>,
713    #[prost(message, optional, tag = "4")]
714    pub table: ::core::option::Option<super::catalog::Table>,
715    #[prost(message, repeated, tag = "5")]
716    pub order_by: ::prost::alloc::vec::Vec<super::common::ColumnOrder>,
717    #[prost(bool, tag = "6")]
718    pub with_ties: bool,
719}
720#[derive(prost_helpers::AnyPB)]
721#[derive(Clone, PartialEq, ::prost::Message)]
722pub struct DeltaExpression {
723    #[prost(enumeration = "super::expr::expr_node::Type", tag = "1")]
724    pub delta_type: i32,
725    #[prost(message, optional, tag = "2")]
726    pub delta: ::core::option::Option<super::expr::ExprNode>,
727}
728#[derive(prost_helpers::AnyPB)]
729#[derive(Clone, PartialEq, ::prost::Message)]
730pub struct InequalityPair {
731    /// Input index of greater side of inequality.
732    #[prost(uint32, tag = "1")]
733    pub key_required_larger: u32,
734    /// Input index of less side of inequality.
735    #[prost(uint32, tag = "2")]
736    pub key_required_smaller: u32,
737    /// Whether this condition is used to clean state table of `HashJoinExecutor`.
738    #[prost(bool, tag = "3")]
739    pub clean_state: bool,
740    /// greater >= less + delta_expression, if `None`, it represents that greater >= less
741    #[prost(message, optional, tag = "4")]
742    pub delta_expression: ::core::option::Option<DeltaExpression>,
743}
744#[derive(prost_helpers::AnyPB)]
745#[derive(Clone, PartialEq, ::prost::Message)]
746pub struct HashJoinNode {
747    #[prost(enumeration = "super::plan_common::JoinType", tag = "1")]
748    pub join_type: i32,
749    #[prost(int32, repeated, tag = "2")]
750    pub left_key: ::prost::alloc::vec::Vec<i32>,
751    #[prost(int32, repeated, tag = "3")]
752    pub right_key: ::prost::alloc::vec::Vec<i32>,
753    #[prost(message, optional, tag = "4")]
754    pub condition: ::core::option::Option<super::expr::ExprNode>,
755    #[prost(message, repeated, tag = "5")]
756    pub inequality_pairs: ::prost::alloc::vec::Vec<InequalityPair>,
757    /// Used for internal table states.
758    #[prost(message, optional, tag = "6")]
759    pub left_table: ::core::option::Option<super::catalog::Table>,
760    /// Used for internal table states.
761    #[prost(message, optional, tag = "7")]
762    pub right_table: ::core::option::Option<super::catalog::Table>,
763    /// Used for internal table states.
764    #[prost(message, optional, tag = "8")]
765    pub left_degree_table: ::core::option::Option<super::catalog::Table>,
766    /// Used for internal table states.
767    #[prost(message, optional, tag = "9")]
768    pub right_degree_table: ::core::option::Option<super::catalog::Table>,
769    /// The output indices of current node
770    #[prost(uint32, repeated, tag = "10")]
771    pub output_indices: ::prost::alloc::vec::Vec<u32>,
772    /// Left deduped input pk indices. The pk of the left_table and
773    /// left_degree_table is  \[left_join_key | left_deduped_input_pk_indices\]
774    /// and is expected to be the shortest key which starts with
775    /// the join key and satisfies unique constrain.
776    #[prost(uint32, repeated, tag = "11")]
777    pub left_deduped_input_pk_indices: ::prost::alloc::vec::Vec<u32>,
778    /// Right deduped input pk indices. The pk of the right_table and
779    /// right_degree_table is  \[right_join_key | right_deduped_input_pk_indices\]
780    /// and is expected to be the shortest key which starts with
781    /// the join key and satisfies unique constrain.
782    #[prost(uint32, repeated, tag = "12")]
783    pub right_deduped_input_pk_indices: ::prost::alloc::vec::Vec<u32>,
784    #[prost(bool, repeated, tag = "13")]
785    pub null_safe: ::prost::alloc::vec::Vec<bool>,
786    /// Whether to optimize for append only stream.
787    /// It is true when the input is append-only
788    #[prost(bool, tag = "14")]
789    pub is_append_only: bool,
790}
791#[derive(prost_helpers::AnyPB)]
792#[derive(Clone, PartialEq, ::prost::Message)]
793pub struct AsOfJoinNode {
794    #[prost(enumeration = "super::plan_common::AsOfJoinType", tag = "1")]
795    pub join_type: i32,
796    #[prost(int32, repeated, tag = "2")]
797    pub left_key: ::prost::alloc::vec::Vec<i32>,
798    #[prost(int32, repeated, tag = "3")]
799    pub right_key: ::prost::alloc::vec::Vec<i32>,
800    /// Used for internal table states.
801    #[prost(message, optional, tag = "4")]
802    pub left_table: ::core::option::Option<super::catalog::Table>,
803    /// Used for internal table states.
804    #[prost(message, optional, tag = "5")]
805    pub right_table: ::core::option::Option<super::catalog::Table>,
806    /// The output indices of current node
807    #[prost(uint32, repeated, tag = "6")]
808    pub output_indices: ::prost::alloc::vec::Vec<u32>,
809    /// Left deduped input pk indices. The pk of the left_table and
810    /// The pk of the left_table is  \[left_join_key | left_inequality_key | left_deduped_input_pk_indices\]
811    /// left_inequality_key is not used but for forward compatibility.
812    #[prost(uint32, repeated, tag = "7")]
813    pub left_deduped_input_pk_indices: ::prost::alloc::vec::Vec<u32>,
814    /// Right deduped input pk indices.
815    /// The pk of the right_table is  \[right_join_key | right_inequality_key | right_deduped_input_pk_indices\]
816    /// right_inequality_key is not used but for forward compatibility.
817    #[prost(uint32, repeated, tag = "8")]
818    pub right_deduped_input_pk_indices: ::prost::alloc::vec::Vec<u32>,
819    #[prost(bool, repeated, tag = "9")]
820    pub null_safe: ::prost::alloc::vec::Vec<bool>,
821    #[prost(message, optional, tag = "10")]
822    pub asof_desc: ::core::option::Option<super::plan_common::AsOfJoinDesc>,
823}
824#[derive(prost_helpers::AnyPB)]
825#[derive(Clone, PartialEq, ::prost::Message)]
826pub struct TemporalJoinNode {
827    #[prost(enumeration = "super::plan_common::JoinType", tag = "1")]
828    pub join_type: i32,
829    #[prost(int32, repeated, tag = "2")]
830    pub left_key: ::prost::alloc::vec::Vec<i32>,
831    #[prost(int32, repeated, tag = "3")]
832    pub right_key: ::prost::alloc::vec::Vec<i32>,
833    #[prost(bool, repeated, tag = "4")]
834    pub null_safe: ::prost::alloc::vec::Vec<bool>,
835    #[prost(message, optional, tag = "5")]
836    pub condition: ::core::option::Option<super::expr::ExprNode>,
837    /// The output indices of current node
838    #[prost(uint32, repeated, tag = "6")]
839    pub output_indices: ::prost::alloc::vec::Vec<u32>,
840    /// The table desc of the lookup side table.
841    #[prost(message, optional, tag = "7")]
842    pub table_desc: ::core::option::Option<super::plan_common::StorageTableDesc>,
843    /// The output indices of the lookup side table
844    #[prost(uint32, repeated, tag = "8")]
845    pub table_output_indices: ::prost::alloc::vec::Vec<u32>,
846    /// The state table used for non-append-only temporal join.
847    #[prost(message, optional, tag = "9")]
848    pub memo_table: ::core::option::Option<super::catalog::Table>,
849    /// If it is a nested lool temporal join
850    #[prost(bool, tag = "10")]
851    pub is_nested_loop: bool,
852}
853#[derive(prost_helpers::AnyPB)]
854#[derive(Clone, PartialEq, ::prost::Message)]
855pub struct DynamicFilterNode {
856    #[prost(uint32, tag = "1")]
857    pub left_key: u32,
858    /// Must be one of <, <=, >, >=
859    #[prost(message, optional, tag = "2")]
860    pub condition: ::core::option::Option<super::expr::ExprNode>,
861    /// Left table stores all states with predicate possibly not NULL.
862    #[prost(message, optional, tag = "3")]
863    pub left_table: ::core::option::Option<super::catalog::Table>,
864    /// Right table stores single value from RHS of predicate.
865    #[prost(message, optional, tag = "4")]
866    pub right_table: ::core::option::Option<super::catalog::Table>,
867    /// If the right side's change always make the condition more relaxed.
868    /// In other words, make more record in the left side satisfy the condition.
869    /// If this is true, we need to store LHS records which do not match the condition in the internal table.
870    /// When the condition changes, we will tell downstream to insert the LHS records which now match the condition.
871    /// If this is false, we need to store RHS records which match the condition in the internal table.
872    /// When the condition changes, we will tell downstream to delete the LHS records which now no longer match the condition.
873    #[deprecated]
874    #[prost(bool, tag = "5")]
875    pub condition_always_relax: bool,
876}
877/// Delta join with two indexes. This is a pseudo plan node generated on frontend. On meta
878/// service, it will be rewritten into lookup joins.
879#[derive(prost_helpers::AnyPB)]
880#[derive(Clone, PartialEq, ::prost::Message)]
881pub struct DeltaIndexJoinNode {
882    #[prost(enumeration = "super::plan_common::JoinType", tag = "1")]
883    pub join_type: i32,
884    #[prost(int32, repeated, tag = "2")]
885    pub left_key: ::prost::alloc::vec::Vec<i32>,
886    #[prost(int32, repeated, tag = "3")]
887    pub right_key: ::prost::alloc::vec::Vec<i32>,
888    #[prost(message, optional, tag = "4")]
889    pub condition: ::core::option::Option<super::expr::ExprNode>,
890    /// Table id of the left index.
891    #[prost(uint32, tag = "7")]
892    pub left_table_id: u32,
893    /// Table id of the right index.
894    #[prost(uint32, tag = "8")]
895    pub right_table_id: u32,
896    /// Info about the left index
897    #[prost(message, optional, tag = "9")]
898    pub left_info: ::core::option::Option<ArrangementInfo>,
899    /// Info about the right index
900    #[prost(message, optional, tag = "10")]
901    pub right_info: ::core::option::Option<ArrangementInfo>,
902    /// the output indices of current node
903    #[prost(uint32, repeated, tag = "11")]
904    pub output_indices: ::prost::alloc::vec::Vec<u32>,
905}
906#[derive(prost_helpers::AnyPB)]
907#[derive(Clone, PartialEq, ::prost::Message)]
908pub struct HopWindowNode {
909    #[prost(uint32, tag = "1")]
910    pub time_col: u32,
911    #[prost(message, optional, tag = "2")]
912    pub window_slide: ::core::option::Option<super::data::Interval>,
913    #[prost(message, optional, tag = "3")]
914    pub window_size: ::core::option::Option<super::data::Interval>,
915    #[prost(uint32, repeated, tag = "4")]
916    pub output_indices: ::prost::alloc::vec::Vec<u32>,
917    #[prost(message, repeated, tag = "5")]
918    pub window_start_exprs: ::prost::alloc::vec::Vec<super::expr::ExprNode>,
919    #[prost(message, repeated, tag = "6")]
920    pub window_end_exprs: ::prost::alloc::vec::Vec<super::expr::ExprNode>,
921}
922#[derive(prost_helpers::AnyPB)]
923#[derive(Clone, PartialEq, ::prost::Message)]
924pub struct MergeNode {
925    /// **WARNING**: Use this field with caution.
926    ///
927    /// `upstream_actor_id` stored in the plan node in `Fragment` meta model cannot be directly used.
928    /// See `compose_fragment`.
929    /// The field is deprecated because the upstream actor info is provided separately instead of
930    /// injected here in the node.
931    #[deprecated]
932    #[prost(uint32, repeated, packed = "false", tag = "1")]
933    pub upstream_actor_id: ::prost::alloc::vec::Vec<u32>,
934    #[prost(uint32, tag = "2")]
935    pub upstream_fragment_id: u32,
936    /// Type of the upstream dispatcher. If there's always one upstream according to this
937    /// type, the compute node may use the `ReceiverExecutor` as an optimization.
938    #[prost(enumeration = "DispatcherType", tag = "3")]
939    pub upstream_dispatcher_type: i32,
940    /// The schema of input columns. TODO: remove this field.
941    #[prost(message, repeated, tag = "4")]
942    pub fields: ::prost::alloc::vec::Vec<super::plan_common::Field>,
943}
944/// passed from frontend to meta, used by fragmenter to generate `MergeNode`
945/// and maybe `DispatcherNode` later.
946#[derive(prost_helpers::AnyPB)]
947#[derive(Clone, PartialEq, ::prost::Message)]
948pub struct ExchangeNode {
949    #[prost(message, optional, tag = "1")]
950    pub strategy: ::core::option::Option<DispatchStrategy>,
951}
952/// StreamScanNode reads data from upstream table first, and then pass all events to downstream.
953/// It always these 2 inputs in the following order:
954/// 1. A MergeNode (as a placeholder) of upstream.
955/// 2. A BatchPlanNode for the snapshot read.
956#[derive(prost_helpers::AnyPB)]
957#[derive(Clone, PartialEq, ::prost::Message)]
958pub struct StreamScanNode {
959    #[prost(uint32, tag = "1")]
960    pub table_id: u32,
961    /// The columns from the upstream table that'll be internally required by this stream scan node.
962    /// - For non-backfill stream scan node, it's the same as the output columns.
963    /// - For backfill stream scan node, there're additionally primary key columns.
964    #[prost(int32, repeated, tag = "2")]
965    pub upstream_column_ids: ::prost::alloc::vec::Vec<i32>,
966    /// The columns to be output by this stream scan node. The index is based on the internal required columns.
967    /// - For non-backfill stream scan node, it's simply all the columns.
968    /// - For backfill stream scan node, this strips the primary key columns if they're unnecessary.
969    #[prost(uint32, repeated, tag = "3")]
970    pub output_indices: ::prost::alloc::vec::Vec<u32>,
971    /// Generally, the barrier needs to be rearranged during the MV creation process, so that data can
972    /// be flushed to shared buffer periodically, instead of making the first epoch from batch query extra
973    /// large. However, in some cases, e.g., shared state, the barrier cannot be rearranged in StreamScanNode.
974    /// StreamScanType is used to decide which implementation for the StreamScanNode.
975    #[prost(enumeration = "StreamScanType", tag = "4")]
976    pub stream_scan_type: i32,
977    /// / The state table used by Backfill operator for persisting internal state
978    #[prost(message, optional, tag = "5")]
979    pub state_table: ::core::option::Option<super::catalog::Table>,
980    /// The upstream materialized view info used by backfill.
981    /// Used iff `ChainType::Backfill`.
982    #[prost(message, optional, tag = "7")]
983    pub table_desc: ::core::option::Option<super::plan_common::StorageTableDesc>,
984    /// The backfill rate limit for the stream scan node.
985    #[prost(uint32, optional, tag = "8")]
986    pub rate_limit: ::core::option::Option<u32>,
987    /// Snapshot read every N barriers
988    #[deprecated]
989    #[prost(uint32, tag = "9")]
990    pub snapshot_read_barrier_interval: u32,
991    /// The state table used by ArrangementBackfill to replicate upstream mview's state table.
992    /// Used iff `ChainType::ArrangementBackfill`.
993    #[prost(message, optional, tag = "10")]
994    pub arrangement_table: ::core::option::Option<super::catalog::Table>,
995    #[prost(uint64, optional, tag = "11")]
996    pub snapshot_backfill_epoch: ::core::option::Option<u64>,
997}
998/// Config options for CDC backfill
999#[derive(prost_helpers::AnyPB)]
1000#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1001pub struct StreamCdcScanOptions {
1002    /// Whether skip the backfill and only consume from upstream.
1003    #[prost(bool, tag = "1")]
1004    pub disable_backfill: bool,
1005    #[prost(uint32, tag = "2")]
1006    pub snapshot_barrier_interval: u32,
1007    #[prost(uint32, tag = "3")]
1008    pub snapshot_batch_size: u32,
1009}
1010#[derive(prost_helpers::AnyPB)]
1011#[derive(Clone, PartialEq, ::prost::Message)]
1012pub struct StreamCdcScanNode {
1013    #[prost(uint32, tag = "1")]
1014    pub table_id: u32,
1015    /// The columns from the upstream table that'll be internally required by this stream scan node.
1016    /// Contains Primary Keys and Output columns.
1017    #[prost(int32, repeated, tag = "2")]
1018    pub upstream_column_ids: ::prost::alloc::vec::Vec<i32>,
1019    /// Strips the primary key columns if they're unnecessary.
1020    #[prost(uint32, repeated, tag = "3")]
1021    pub output_indices: ::prost::alloc::vec::Vec<u32>,
1022    /// The state table used by CdcBackfill operator for persisting internal state
1023    #[prost(message, optional, tag = "4")]
1024    pub state_table: ::core::option::Option<super::catalog::Table>,
1025    /// The external table that will be backfilled for CDC.
1026    #[prost(message, optional, tag = "5")]
1027    pub cdc_table_desc: ::core::option::Option<super::plan_common::ExternalTableDesc>,
1028    /// The backfill rate limit for the stream cdc scan node.
1029    #[prost(uint32, optional, tag = "6")]
1030    pub rate_limit: ::core::option::Option<u32>,
1031    /// Whether skip the backfill and only consume from upstream.
1032    /// keep it for backward compatibility, new stream plan will use `options.disable_backfill`
1033    #[prost(bool, tag = "7")]
1034    pub disable_backfill: bool,
1035    #[prost(message, optional, tag = "8")]
1036    pub options: ::core::option::Option<StreamCdcScanOptions>,
1037}
1038/// BatchPlanNode is used for mv on mv snapshot read.
1039/// BatchPlanNode is supposed to carry a batch plan that can be optimized with the streaming plan_common.
1040/// Currently, streaming to batch push down is not yet supported, BatchPlanNode is simply a table scan.
1041#[derive(prost_helpers::AnyPB)]
1042#[derive(Clone, PartialEq, ::prost::Message)]
1043pub struct BatchPlanNode {
1044    #[prost(message, optional, tag = "1")]
1045    pub table_desc: ::core::option::Option<super::plan_common::StorageTableDesc>,
1046    #[prost(int32, repeated, tag = "2")]
1047    pub column_ids: ::prost::alloc::vec::Vec<i32>,
1048}
1049#[derive(prost_helpers::AnyPB)]
1050#[derive(Clone, PartialEq, ::prost::Message)]
1051pub struct ArrangementInfo {
1052    /// Order key of the arrangement, including order by columns and pk from the materialize
1053    /// executor.
1054    #[prost(message, repeated, tag = "1")]
1055    pub arrange_key_orders: ::prost::alloc::vec::Vec<super::common::ColumnOrder>,
1056    /// Column descs of the arrangement
1057    #[prost(message, repeated, tag = "2")]
1058    pub column_descs: ::prost::alloc::vec::Vec<super::plan_common::ColumnDesc>,
1059    /// Used to build storage table by stream lookup join of delta join.
1060    #[prost(message, optional, tag = "4")]
1061    pub table_desc: ::core::option::Option<super::plan_common::StorageTableDesc>,
1062    /// Output index columns
1063    #[prost(uint32, repeated, tag = "5")]
1064    pub output_col_idx: ::prost::alloc::vec::Vec<u32>,
1065}
1066/// Special node for shared state, which will only be produced in fragmenter. ArrangeNode will
1067/// produce a special Materialize executor, which materializes data for downstream to query.
1068#[derive(prost_helpers::AnyPB)]
1069#[derive(Clone, PartialEq, ::prost::Message)]
1070pub struct ArrangeNode {
1071    /// Info about the arrangement
1072    #[prost(message, optional, tag = "1")]
1073    pub table_info: ::core::option::Option<ArrangementInfo>,
1074    /// Hash key of the materialize node, which is a subset of pk.
1075    #[prost(uint32, repeated, tag = "2")]
1076    pub distribution_key: ::prost::alloc::vec::Vec<u32>,
1077    /// Used for internal table states.
1078    #[prost(message, optional, tag = "3")]
1079    pub table: ::core::option::Option<super::catalog::Table>,
1080}
1081/// Special node for shared state. LookupNode will join an arrangement with a stream.
1082#[derive(prost_helpers::AnyPB)]
1083#[derive(Clone, PartialEq, ::prost::Message)]
1084pub struct LookupNode {
1085    /// Join key of the arrangement side
1086    #[prost(int32, repeated, tag = "1")]
1087    pub arrange_key: ::prost::alloc::vec::Vec<i32>,
1088    /// Join key of the stream side
1089    #[prost(int32, repeated, tag = "2")]
1090    pub stream_key: ::prost::alloc::vec::Vec<i32>,
1091    /// Whether to join the current epoch of arrangement
1092    #[prost(bool, tag = "3")]
1093    pub use_current_epoch: bool,
1094    /// Sometimes we need to re-order the output data to meet the requirement of schema.
1095    /// By default, lookup executor will produce `<arrangement side, stream side>`. We
1096    /// will then apply the column mapping to the combined result.
1097    #[prost(int32, repeated, tag = "4")]
1098    pub column_mapping: ::prost::alloc::vec::Vec<i32>,
1099    /// Info about the arrangement
1100    #[prost(message, optional, tag = "7")]
1101    pub arrangement_table_info: ::core::option::Option<ArrangementInfo>,
1102    #[prost(oneof = "lookup_node::ArrangementTableId", tags = "5, 6")]
1103    pub arrangement_table_id: ::core::option::Option<lookup_node::ArrangementTableId>,
1104}
1105/// Nested message and enum types in `LookupNode`.
1106pub mod lookup_node {
1107    #[derive(prost_helpers::AnyPB)]
1108    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
1109    pub enum ArrangementTableId {
1110        /// Table Id of the arrangement (when created along with join plan)
1111        #[prost(uint32, tag = "5")]
1112        TableId(u32),
1113        /// Table Id of the arrangement (when using index)
1114        #[prost(uint32, tag = "6")]
1115        IndexId(u32),
1116    }
1117}
1118/// WatermarkFilter needs to filter the upstream data by the water mark.
1119#[derive(prost_helpers::AnyPB)]
1120#[derive(Clone, PartialEq, ::prost::Message)]
1121pub struct WatermarkFilterNode {
1122    /// The watermark descs
1123    #[prost(message, repeated, tag = "1")]
1124    pub watermark_descs: ::prost::alloc::vec::Vec<super::catalog::WatermarkDesc>,
1125    /// The tables used to persist watermarks, the key is vnode.
1126    #[prost(message, repeated, tag = "2")]
1127    pub tables: ::prost::alloc::vec::Vec<super::catalog::Table>,
1128}
1129/// Acts like a merger, but on different inputs.
1130#[derive(prost_helpers::AnyPB)]
1131#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1132pub struct UnionNode {}
1133/// Special node for shared state. Merge and align barrier from upstreams. Pipe inputs in order.
1134#[derive(prost_helpers::AnyPB)]
1135#[derive(Clone, PartialEq, ::prost::Message)]
1136pub struct LookupUnionNode {
1137    #[prost(uint32, repeated, tag = "1")]
1138    pub order: ::prost::alloc::vec::Vec<u32>,
1139}
1140#[derive(prost_helpers::AnyPB)]
1141#[derive(Clone, PartialEq, ::prost::Message)]
1142pub struct ExpandNode {
1143    #[prost(message, repeated, tag = "1")]
1144    pub column_subsets: ::prost::alloc::vec::Vec<expand_node::Subset>,
1145}
1146/// Nested message and enum types in `ExpandNode`.
1147pub mod expand_node {
1148    #[derive(prost_helpers::AnyPB)]
1149    #[derive(Clone, PartialEq, ::prost::Message)]
1150    pub struct Subset {
1151        #[prost(uint32, repeated, tag = "1")]
1152        pub column_indices: ::prost::alloc::vec::Vec<u32>,
1153    }
1154}
1155#[derive(prost_helpers::AnyPB)]
1156#[derive(Clone, PartialEq, ::prost::Message)]
1157pub struct ProjectSetNode {
1158    #[prost(message, repeated, tag = "1")]
1159    pub select_list: ::prost::alloc::vec::Vec<super::expr::ProjectSetSelectItem>,
1160    /// this two field is expressing a list of usize pair, which means when project receives a
1161    /// watermark with `watermark_input_cols\[i\]` column index, it should derive a new watermark
1162    /// with `watermark_output_cols\[i\]`th expression
1163    #[prost(uint32, repeated, tag = "2")]
1164    pub watermark_input_cols: ::prost::alloc::vec::Vec<u32>,
1165    #[prost(uint32, repeated, tag = "3")]
1166    pub watermark_expr_indices: ::prost::alloc::vec::Vec<u32>,
1167    #[prost(uint32, repeated, tag = "4")]
1168    pub nondecreasing_exprs: ::prost::alloc::vec::Vec<u32>,
1169}
1170/// Sorts inputs and outputs ordered data based on watermark.
1171#[derive(prost_helpers::AnyPB)]
1172#[derive(Clone, PartialEq, ::prost::Message)]
1173pub struct SortNode {
1174    /// Persists data above watermark.
1175    #[prost(message, optional, tag = "1")]
1176    pub state_table: ::core::option::Option<super::catalog::Table>,
1177    /// Column index of watermark to perform sorting.
1178    #[prost(uint32, tag = "2")]
1179    pub sort_column_index: u32,
1180}
1181/// Merges two streams from streaming and batch for data manipulation.
1182#[derive(prost_helpers::AnyPB)]
1183#[derive(Clone, PartialEq, ::prost::Message)]
1184pub struct DmlNode {
1185    /// Id of the table on which DML performs.
1186    #[prost(uint32, tag = "1")]
1187    pub table_id: u32,
1188    /// Version of the table.
1189    #[prost(uint64, tag = "3")]
1190    pub table_version_id: u64,
1191    /// Column descriptions of the table.
1192    #[prost(message, repeated, tag = "2")]
1193    pub column_descs: ::prost::alloc::vec::Vec<super::plan_common::ColumnDesc>,
1194    #[prost(uint32, optional, tag = "4")]
1195    pub rate_limit: ::core::option::Option<u32>,
1196}
1197#[derive(prost_helpers::AnyPB)]
1198#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1199pub struct RowIdGenNode {
1200    #[prost(uint64, tag = "1")]
1201    pub row_id_index: u64,
1202}
1203#[derive(prost_helpers::AnyPB)]
1204#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1205pub struct NowModeUpdateCurrent {}
1206#[derive(prost_helpers::AnyPB)]
1207#[derive(Clone, PartialEq, ::prost::Message)]
1208pub struct NowModeGenerateSeries {
1209    #[prost(message, optional, tag = "1")]
1210    pub start_timestamp: ::core::option::Option<super::data::Datum>,
1211    #[prost(message, optional, tag = "2")]
1212    pub interval: ::core::option::Option<super::data::Datum>,
1213}
1214#[derive(prost_helpers::AnyPB)]
1215#[derive(Clone, PartialEq, ::prost::Message)]
1216pub struct NowNode {
1217    /// Persists emitted 'now'.
1218    #[prost(message, optional, tag = "1")]
1219    pub state_table: ::core::option::Option<super::catalog::Table>,
1220    #[prost(oneof = "now_node::Mode", tags = "101, 102")]
1221    pub mode: ::core::option::Option<now_node::Mode>,
1222}
1223/// Nested message and enum types in `NowNode`.
1224pub mod now_node {
1225    #[derive(prost_helpers::AnyPB)]
1226    #[derive(Clone, PartialEq, ::prost::Oneof)]
1227    pub enum Mode {
1228        #[prost(message, tag = "101")]
1229        UpdateCurrent(super::NowModeUpdateCurrent),
1230        #[prost(message, tag = "102")]
1231        GenerateSeries(super::NowModeGenerateSeries),
1232    }
1233}
1234#[derive(prost_helpers::AnyPB)]
1235#[derive(Clone, PartialEq, ::prost::Message)]
1236pub struct ValuesNode {
1237    #[prost(message, repeated, tag = "1")]
1238    pub tuples: ::prost::alloc::vec::Vec<values_node::ExprTuple>,
1239    #[prost(message, repeated, tag = "2")]
1240    pub fields: ::prost::alloc::vec::Vec<super::plan_common::Field>,
1241}
1242/// Nested message and enum types in `ValuesNode`.
1243pub mod values_node {
1244    #[derive(prost_helpers::AnyPB)]
1245    #[derive(Clone, PartialEq, ::prost::Message)]
1246    pub struct ExprTuple {
1247        #[prost(message, repeated, tag = "1")]
1248        pub cells: ::prost::alloc::vec::Vec<super::super::expr::ExprNode>,
1249    }
1250}
1251#[derive(prost_helpers::AnyPB)]
1252#[derive(Clone, PartialEq, ::prost::Message)]
1253pub struct DedupNode {
1254    #[prost(message, optional, tag = "1")]
1255    pub state_table: ::core::option::Option<super::catalog::Table>,
1256    #[prost(uint32, repeated, tag = "2")]
1257    pub dedup_column_indices: ::prost::alloc::vec::Vec<u32>,
1258}
1259#[derive(prost_helpers::AnyPB)]
1260#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1261pub struct NoOpNode {}
1262#[derive(prost_helpers::AnyPB)]
1263#[derive(Clone, PartialEq, ::prost::Message)]
1264pub struct EowcOverWindowNode {
1265    #[prost(message, repeated, tag = "1")]
1266    pub calls: ::prost::alloc::vec::Vec<super::expr::WindowFunction>,
1267    #[prost(uint32, repeated, tag = "2")]
1268    pub partition_by: ::prost::alloc::vec::Vec<u32>,
1269    /// use `repeated` in case of future extension, now only one column is allowed
1270    #[prost(message, repeated, tag = "3")]
1271    pub order_by: ::prost::alloc::vec::Vec<super::common::ColumnOrder>,
1272    #[prost(message, optional, tag = "4")]
1273    pub state_table: ::core::option::Option<super::catalog::Table>,
1274}
1275#[derive(prost_helpers::AnyPB)]
1276#[derive(Clone, PartialEq, ::prost::Message)]
1277pub struct OverWindowNode {
1278    #[prost(message, repeated, tag = "1")]
1279    pub calls: ::prost::alloc::vec::Vec<super::expr::WindowFunction>,
1280    #[prost(uint32, repeated, tag = "2")]
1281    pub partition_by: ::prost::alloc::vec::Vec<u32>,
1282    #[prost(message, repeated, tag = "3")]
1283    pub order_by: ::prost::alloc::vec::Vec<super::common::ColumnOrder>,
1284    #[prost(message, optional, tag = "4")]
1285    pub state_table: ::core::option::Option<super::catalog::Table>,
1286    #[prost(enumeration = "OverWindowCachePolicy", tag = "5")]
1287    pub cache_policy: i32,
1288}
1289#[derive(prost_helpers::AnyPB)]
1290#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1291pub struct LocalApproxPercentileNode {
1292    #[prost(double, tag = "1")]
1293    pub base: f64,
1294    #[prost(uint32, tag = "2")]
1295    pub percentile_index: u32,
1296}
1297#[derive(prost_helpers::AnyPB)]
1298#[derive(Clone, PartialEq, ::prost::Message)]
1299pub struct GlobalApproxPercentileNode {
1300    #[prost(double, tag = "1")]
1301    pub base: f64,
1302    #[prost(double, tag = "2")]
1303    pub quantile: f64,
1304    #[prost(message, optional, tag = "3")]
1305    pub bucket_state_table: ::core::option::Option<super::catalog::Table>,
1306    #[prost(message, optional, tag = "4")]
1307    pub count_state_table: ::core::option::Option<super::catalog::Table>,
1308}
1309#[derive(prost_helpers::AnyPB)]
1310#[derive(Clone, PartialEq, ::prost::Message)]
1311pub struct RowMergeNode {
1312    #[prost(message, optional, tag = "1")]
1313    pub lhs_mapping: ::core::option::Option<super::catalog::ColIndexMapping>,
1314    #[prost(message, optional, tag = "2")]
1315    pub rhs_mapping: ::core::option::Option<super::catalog::ColIndexMapping>,
1316}
1317#[derive(prost_helpers::AnyPB)]
1318#[derive(Clone, PartialEq, ::prost::Message)]
1319pub struct SyncLogStoreNode {
1320    #[prost(message, optional, tag = "1")]
1321    pub log_store_table: ::core::option::Option<super::catalog::Table>,
1322    #[prost(uint32, tag = "2")]
1323    pub pause_duration_ms: u32,
1324    #[prost(uint32, tag = "3")]
1325    pub buffer_size: u32,
1326}
1327#[derive(prost_helpers::AnyPB)]
1328#[derive(Clone, PartialEq, ::prost::Message)]
1329pub struct MaterializedExprsNode {
1330    #[prost(message, repeated, tag = "1")]
1331    pub exprs: ::prost::alloc::vec::Vec<super::expr::ExprNode>,
1332    #[prost(message, optional, tag = "2")]
1333    pub state_table: ::core::option::Option<super::catalog::Table>,
1334    #[prost(uint32, optional, tag = "3")]
1335    pub state_clean_col_idx: ::core::option::Option<u32>,
1336}
1337#[derive(prost_helpers::AnyPB)]
1338#[derive(Clone, PartialEq, ::prost::Message)]
1339pub struct StreamNode {
1340    /// The id for the operator. This is local per mview.
1341    /// TODO: should better be a uint32.
1342    #[prost(uint64, tag = "1")]
1343    pub operator_id: u64,
1344    /// Child node in plan aka. upstream nodes in the streaming DAG
1345    #[prost(message, repeated, tag = "3")]
1346    pub input: ::prost::alloc::vec::Vec<StreamNode>,
1347    #[prost(uint32, repeated, tag = "2")]
1348    pub stream_key: ::prost::alloc::vec::Vec<u32>,
1349    #[prost(bool, tag = "24")]
1350    pub append_only: bool,
1351    #[prost(string, tag = "18")]
1352    pub identity: ::prost::alloc::string::String,
1353    /// The schema of the plan node
1354    #[prost(message, repeated, tag = "19")]
1355    pub fields: ::prost::alloc::vec::Vec<super::plan_common::Field>,
1356    #[prost(
1357        oneof = "stream_node::NodeBody",
1358        tags = "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, 142, 143, 144, 145, 146, 147, 148, 149"
1359    )]
1360    pub node_body: ::core::option::Option<stream_node::NodeBody>,
1361}
1362/// Nested message and enum types in `StreamNode`.
1363pub mod stream_node {
1364    #[derive(prost_helpers::AnyPB)]
1365    #[derive(::enum_as_inner::EnumAsInner, ::strum::Display, ::strum::EnumDiscriminants)]
1366    #[derive(Clone, PartialEq, ::prost::Oneof)]
1367    pub enum NodeBody {
1368        #[prost(message, tag = "100")]
1369        Source(::prost::alloc::boxed::Box<super::SourceNode>),
1370        #[prost(message, tag = "101")]
1371        Project(::prost::alloc::boxed::Box<super::ProjectNode>),
1372        #[prost(message, tag = "102")]
1373        Filter(::prost::alloc::boxed::Box<super::FilterNode>),
1374        #[prost(message, tag = "103")]
1375        Materialize(::prost::alloc::boxed::Box<super::MaterializeNode>),
1376        #[prost(message, tag = "104")]
1377        StatelessSimpleAgg(::prost::alloc::boxed::Box<super::SimpleAggNode>),
1378        #[prost(message, tag = "105")]
1379        SimpleAgg(::prost::alloc::boxed::Box<super::SimpleAggNode>),
1380        #[prost(message, tag = "106")]
1381        HashAgg(::prost::alloc::boxed::Box<super::HashAggNode>),
1382        #[prost(message, tag = "107")]
1383        AppendOnlyTopN(::prost::alloc::boxed::Box<super::TopNNode>),
1384        #[prost(message, tag = "108")]
1385        HashJoin(::prost::alloc::boxed::Box<super::HashJoinNode>),
1386        #[prost(message, tag = "109")]
1387        TopN(::prost::alloc::boxed::Box<super::TopNNode>),
1388        #[prost(message, tag = "110")]
1389        HopWindow(::prost::alloc::boxed::Box<super::HopWindowNode>),
1390        #[prost(message, tag = "111")]
1391        Merge(::prost::alloc::boxed::Box<super::MergeNode>),
1392        #[prost(message, tag = "112")]
1393        Exchange(::prost::alloc::boxed::Box<super::ExchangeNode>),
1394        #[prost(message, tag = "113")]
1395        StreamScan(::prost::alloc::boxed::Box<super::StreamScanNode>),
1396        #[prost(message, tag = "114")]
1397        BatchPlan(::prost::alloc::boxed::Box<super::BatchPlanNode>),
1398        #[prost(message, tag = "115")]
1399        Lookup(::prost::alloc::boxed::Box<super::LookupNode>),
1400        #[prost(message, tag = "116")]
1401        Arrange(::prost::alloc::boxed::Box<super::ArrangeNode>),
1402        #[prost(message, tag = "117")]
1403        LookupUnion(::prost::alloc::boxed::Box<super::LookupUnionNode>),
1404        #[prost(message, tag = "118")]
1405        Union(super::UnionNode),
1406        #[prost(message, tag = "119")]
1407        DeltaIndexJoin(::prost::alloc::boxed::Box<super::DeltaIndexJoinNode>),
1408        #[prost(message, tag = "120")]
1409        Sink(::prost::alloc::boxed::Box<super::SinkNode>),
1410        #[prost(message, tag = "121")]
1411        Expand(::prost::alloc::boxed::Box<super::ExpandNode>),
1412        #[prost(message, tag = "122")]
1413        DynamicFilter(::prost::alloc::boxed::Box<super::DynamicFilterNode>),
1414        #[prost(message, tag = "123")]
1415        ProjectSet(::prost::alloc::boxed::Box<super::ProjectSetNode>),
1416        #[prost(message, tag = "124")]
1417        GroupTopN(::prost::alloc::boxed::Box<super::GroupTopNNode>),
1418        #[prost(message, tag = "125")]
1419        Sort(::prost::alloc::boxed::Box<super::SortNode>),
1420        #[prost(message, tag = "126")]
1421        WatermarkFilter(::prost::alloc::boxed::Box<super::WatermarkFilterNode>),
1422        #[prost(message, tag = "127")]
1423        Dml(::prost::alloc::boxed::Box<super::DmlNode>),
1424        #[prost(message, tag = "128")]
1425        RowIdGen(::prost::alloc::boxed::Box<super::RowIdGenNode>),
1426        #[prost(message, tag = "129")]
1427        Now(::prost::alloc::boxed::Box<super::NowNode>),
1428        #[prost(message, tag = "130")]
1429        AppendOnlyGroupTopN(::prost::alloc::boxed::Box<super::GroupTopNNode>),
1430        #[prost(message, tag = "131")]
1431        TemporalJoin(::prost::alloc::boxed::Box<super::TemporalJoinNode>),
1432        #[prost(message, tag = "132")]
1433        BarrierRecv(::prost::alloc::boxed::Box<super::BarrierRecvNode>),
1434        #[prost(message, tag = "133")]
1435        Values(::prost::alloc::boxed::Box<super::ValuesNode>),
1436        #[prost(message, tag = "134")]
1437        AppendOnlyDedup(::prost::alloc::boxed::Box<super::DedupNode>),
1438        #[prost(message, tag = "135")]
1439        NoOp(super::NoOpNode),
1440        #[prost(message, tag = "136")]
1441        EowcOverWindow(::prost::alloc::boxed::Box<super::EowcOverWindowNode>),
1442        #[prost(message, tag = "137")]
1443        OverWindow(::prost::alloc::boxed::Box<super::OverWindowNode>),
1444        #[prost(message, tag = "138")]
1445        StreamFsFetch(::prost::alloc::boxed::Box<super::StreamFsFetchNode>),
1446        #[prost(message, tag = "139")]
1447        StreamCdcScan(::prost::alloc::boxed::Box<super::StreamCdcScanNode>),
1448        #[prost(message, tag = "140")]
1449        CdcFilter(::prost::alloc::boxed::Box<super::CdcFilterNode>),
1450        #[prost(message, tag = "142")]
1451        SourceBackfill(::prost::alloc::boxed::Box<super::SourceBackfillNode>),
1452        #[prost(message, tag = "143")]
1453        Changelog(::prost::alloc::boxed::Box<super::ChangeLogNode>),
1454        #[prost(message, tag = "144")]
1455        LocalApproxPercentile(
1456            ::prost::alloc::boxed::Box<super::LocalApproxPercentileNode>,
1457        ),
1458        #[prost(message, tag = "145")]
1459        GlobalApproxPercentile(
1460            ::prost::alloc::boxed::Box<super::GlobalApproxPercentileNode>,
1461        ),
1462        #[prost(message, tag = "146")]
1463        RowMerge(::prost::alloc::boxed::Box<super::RowMergeNode>),
1464        #[prost(message, tag = "147")]
1465        AsOfJoin(::prost::alloc::boxed::Box<super::AsOfJoinNode>),
1466        #[prost(message, tag = "148")]
1467        SyncLogStore(::prost::alloc::boxed::Box<super::SyncLogStoreNode>),
1468        #[prost(message, tag = "149")]
1469        MaterializedExprs(::prost::alloc::boxed::Box<super::MaterializedExprsNode>),
1470    }
1471}
1472/// The method to map the upstream columns in the dispatcher before dispatching.
1473///
1474/// - For intra-job exchange, typically the upstream and downstream columns are the same. `indices`
1475///    will be `0..len` and `types` will be empty.
1476///
1477/// - For inter-job exchange,
1478///    * if the downstream only requires a subset of the upstream columns, `indices` will be the
1479///      indices of the required columns in the upstream columns.
1480///    * if some columns are added to the upstream, `indices` will help to maintain the same schema
1481///      from the view of the downstream.
1482///    * if some columns are altered to different (composite) types, `types` will be used to convert
1483///      the upstream columns to the downstream columns to maintain the same schema.
1484#[derive(prost_helpers::AnyPB)]
1485#[derive(Clone, PartialEq, ::prost::Message)]
1486pub struct DispatchOutputMapping {
1487    /// Indices of the columns to output.
1488    #[prost(uint32, repeated, tag = "1")]
1489    pub indices: ::prost::alloc::vec::Vec<u32>,
1490    /// Besides the indices, we may also need to convert the types of some columns.
1491    /// - If no type conversion is needed, this field will be empty.
1492    /// - If type conversion is needed, this will have the same length as `indices`. Only columns with
1493    ///    type conversion will have `upstream` and `downstream` field set.
1494    #[prost(message, repeated, tag = "2")]
1495    pub types: ::prost::alloc::vec::Vec<dispatch_output_mapping::TypePair>,
1496}
1497/// Nested message and enum types in `DispatchOutputMapping`.
1498pub mod dispatch_output_mapping {
1499    #[derive(prost_helpers::AnyPB)]
1500    #[derive(Clone, PartialEq, ::prost::Message)]
1501    pub struct TypePair {
1502        #[prost(message, optional, tag = "1")]
1503        pub upstream: ::core::option::Option<super::super::data::DataType>,
1504        #[prost(message, optional, tag = "2")]
1505        pub downstream: ::core::option::Option<super::super::data::DataType>,
1506    }
1507}
1508/// The property of an edge in the fragment graph.
1509/// This is essientially a "logical" version of `Dispatcher`. See the doc of `Dispatcher` for more details.
1510#[derive(prost_helpers::AnyPB)]
1511#[derive(Clone, PartialEq, ::prost::Message)]
1512pub struct DispatchStrategy {
1513    #[prost(enumeration = "DispatcherType", tag = "1")]
1514    pub r#type: i32,
1515    #[prost(uint32, repeated, tag = "2")]
1516    pub dist_key_indices: ::prost::alloc::vec::Vec<u32>,
1517    #[prost(message, optional, tag = "3")]
1518    pub output_mapping: ::core::option::Option<DispatchOutputMapping>,
1519}
1520/// A dispatcher redistribute messages.
1521/// We encode both the type and other usage information in the proto.
1522#[derive(prost_helpers::AnyPB)]
1523#[derive(Clone, PartialEq, ::prost::Message)]
1524pub struct Dispatcher {
1525    #[prost(enumeration = "DispatcherType", tag = "1")]
1526    pub r#type: i32,
1527    /// Indices of the columns to be used for hashing.
1528    /// For dispatcher types other than HASH, this is ignored.
1529    #[prost(uint32, repeated, tag = "2")]
1530    pub dist_key_indices: ::prost::alloc::vec::Vec<u32>,
1531    /// The method to map the upstream columns in the dispatcher before dispatching.
1532    #[prost(message, optional, tag = "6")]
1533    pub output_mapping: ::core::option::Option<DispatchOutputMapping>,
1534    /// The hash mapping for consistent hash.
1535    /// For dispatcher types other than HASH, this is ignored.
1536    #[prost(message, optional, tag = "3")]
1537    pub hash_mapping: ::core::option::Option<ActorMapping>,
1538    /// Dispatcher can be uniquely identified by a combination of actor id and dispatcher id.
1539    /// This is exactly the same as its downstream fragment id.
1540    #[prost(uint64, tag = "4")]
1541    pub dispatcher_id: u64,
1542    /// Number of downstreams decides how many endpoints a dispatcher should dispatch.
1543    #[prost(uint32, repeated, tag = "5")]
1544    pub downstream_actor_id: ::prost::alloc::vec::Vec<u32>,
1545}
1546/// A StreamActor is a running fragment of the overall stream graph,
1547#[derive(prost_helpers::AnyPB)]
1548#[derive(Clone, PartialEq, ::prost::Message)]
1549pub struct StreamActor {
1550    #[prost(uint32, tag = "1")]
1551    pub actor_id: u32,
1552    #[prost(uint32, tag = "2")]
1553    pub fragment_id: u32,
1554    #[prost(message, repeated, tag = "4")]
1555    pub dispatcher: ::prost::alloc::vec::Vec<Dispatcher>,
1556    /// Vnodes that the executors in this actor own.
1557    /// If the fragment is a singleton, this field will not be set and leave a `None`.
1558    #[prost(message, optional, tag = "8")]
1559    pub vnode_bitmap: ::core::option::Option<super::common::Buffer>,
1560    /// The SQL definition of this materialized view. Used for debugging only.
1561    #[prost(string, tag = "9")]
1562    pub mview_definition: ::prost::alloc::string::String,
1563    /// Provide the necessary context, e.g. session info like time zone, for the actor.
1564    #[prost(message, optional, tag = "10")]
1565    pub expr_context: ::core::option::Option<super::plan_common::ExprContext>,
1566}
1567/// The streaming context associated with a stream plan
1568#[derive(prost_helpers::AnyPB)]
1569#[derive(Clone, PartialEq, ::prost::Message)]
1570pub struct StreamContext {
1571    /// The timezone associated with the streaming plan. Only applies to MV for now.
1572    #[prost(string, tag = "1")]
1573    pub timezone: ::prost::alloc::string::String,
1574}
1575#[derive(prost_helpers::AnyPB)]
1576#[derive(Clone, PartialEq, ::prost::Message)]
1577pub struct BackfillOrder {
1578    #[prost(map = "uint32, message", tag = "1")]
1579    pub order: ::std::collections::HashMap<u32, super::common::Uint32Vector>,
1580}
1581/// Representation of a graph of stream fragments.
1582/// Generated by the fragmenter in the frontend, only used in DDL requests and never persisted.
1583///
1584/// For the persisted form, see `TableFragments`.
1585#[derive(prost_helpers::AnyPB)]
1586#[derive(Clone, PartialEq, ::prost::Message)]
1587pub struct StreamFragmentGraph {
1588    /// all the fragments in the graph.
1589    #[prost(map = "uint32, message", tag = "1")]
1590    pub fragments: ::std::collections::HashMap<
1591        u32,
1592        stream_fragment_graph::StreamFragment,
1593    >,
1594    /// edges between fragments.
1595    #[prost(message, repeated, tag = "2")]
1596    pub edges: ::prost::alloc::vec::Vec<stream_fragment_graph::StreamFragmentEdge>,
1597    #[prost(uint32, repeated, tag = "3")]
1598    pub dependent_table_ids: ::prost::alloc::vec::Vec<u32>,
1599    #[prost(uint32, tag = "4")]
1600    pub table_ids_cnt: u32,
1601    #[prost(message, optional, tag = "5")]
1602    pub ctx: ::core::option::Option<StreamContext>,
1603    /// If none, default parallelism will be applied.
1604    #[prost(message, optional, tag = "6")]
1605    pub parallelism: ::core::option::Option<stream_fragment_graph::Parallelism>,
1606    /// Specified max parallelism, i.e., expected vnode count for the graph.
1607    ///
1608    /// The scheduler on the meta service will use this as a hint to decide the vnode count
1609    /// for each fragment.
1610    ///
1611    /// Note that the actual vnode count may be different from this value.
1612    /// For example, a no-shuffle exchange between current fragment graph and an existing
1613    /// upstream fragment graph requires two fragments to be in the same distribution,
1614    /// thus the same vnode count.
1615    #[prost(uint32, tag = "7")]
1616    pub max_parallelism: u32,
1617    /// The backfill order strategy for the fragments.
1618    #[prost(message, optional, tag = "8")]
1619    pub backfill_order: ::core::option::Option<BackfillOrder>,
1620}
1621/// Nested message and enum types in `StreamFragmentGraph`.
1622pub mod stream_fragment_graph {
1623    #[derive(prost_helpers::AnyPB)]
1624    #[derive(Clone, PartialEq, ::prost::Message)]
1625    pub struct StreamFragment {
1626        /// 0-based on frontend, and will be rewritten to global id on meta.
1627        #[prost(uint32, tag = "1")]
1628        pub fragment_id: u32,
1629        /// root stream node in this fragment.
1630        #[prost(message, optional, tag = "2")]
1631        pub node: ::core::option::Option<super::StreamNode>,
1632        /// Bitwise-OR of `FragmentTypeFlag`s
1633        #[prost(uint32, tag = "3")]
1634        pub fragment_type_mask: u32,
1635        /// Mark whether this fragment requires exactly one actor.
1636        /// Note: if this is `false`, the fragment may still be a singleton according to the scheduler.
1637        /// One should check `meta.Fragment.distribution_type` for the final result.
1638        #[prost(bool, tag = "4")]
1639        pub requires_singleton: bool,
1640        /// Number of table ids (stateful states) for this fragment.
1641        #[prost(uint32, tag = "5")]
1642        pub table_ids_cnt: u32,
1643        /// Mark the upstream table ids of this fragment, Used for fragments with `StreamScan`s.
1644        #[prost(uint32, repeated, tag = "6")]
1645        pub upstream_table_ids: ::prost::alloc::vec::Vec<u32>,
1646    }
1647    #[derive(prost_helpers::AnyPB)]
1648    #[derive(Clone, PartialEq, ::prost::Message)]
1649    pub struct StreamFragmentEdge {
1650        /// Dispatch strategy for the fragment.
1651        #[prost(message, optional, tag = "1")]
1652        pub dispatch_strategy: ::core::option::Option<super::DispatchStrategy>,
1653        /// A unique identifier of this edge. Generally it should be exchange node's operator id. When
1654        /// rewriting fragments into delta joins or when inserting 1-to-1 exchange, there will be
1655        /// virtual links generated.
1656        #[prost(uint64, tag = "3")]
1657        pub link_id: u64,
1658        #[prost(uint32, tag = "4")]
1659        pub upstream_id: u32,
1660        #[prost(uint32, tag = "5")]
1661        pub downstream_id: u32,
1662    }
1663    #[derive(prost_helpers::AnyPB)]
1664    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1665    pub struct Parallelism {
1666        #[prost(uint64, tag = "1")]
1667        pub parallelism: u64,
1668    }
1669}
1670#[derive(prost_helpers::AnyPB)]
1671#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1672#[repr(i32)]
1673pub enum SinkLogStoreType {
1674    /// / Default value is the normal in memory log store to be backward compatible with the previously unset value
1675    Unspecified = 0,
1676    KvLogStore = 1,
1677    InMemoryLogStore = 2,
1678}
1679impl SinkLogStoreType {
1680    /// String value of the enum field names used in the ProtoBuf definition.
1681    ///
1682    /// The values are not transformed in any way and thus are considered stable
1683    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1684    pub fn as_str_name(&self) -> &'static str {
1685        match self {
1686            Self::Unspecified => "SINK_LOG_STORE_TYPE_UNSPECIFIED",
1687            Self::KvLogStore => "SINK_LOG_STORE_TYPE_KV_LOG_STORE",
1688            Self::InMemoryLogStore => "SINK_LOG_STORE_TYPE_IN_MEMORY_LOG_STORE",
1689        }
1690    }
1691    /// Creates an enum from field names used in the ProtoBuf definition.
1692    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1693        match value {
1694            "SINK_LOG_STORE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1695            "SINK_LOG_STORE_TYPE_KV_LOG_STORE" => Some(Self::KvLogStore),
1696            "SINK_LOG_STORE_TYPE_IN_MEMORY_LOG_STORE" => Some(Self::InMemoryLogStore),
1697            _ => None,
1698        }
1699    }
1700}
1701#[derive(prost_helpers::AnyPB)]
1702#[derive(prost_helpers::Version)]
1703#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1704#[repr(i32)]
1705pub enum AggNodeVersion {
1706    Unspecified = 0,
1707    /// <https://github.com/risingwavelabs/risingwave/issues/12140#issuecomment-1776289808>
1708    Issue12140 = 1,
1709    /// <https://github.com/risingwavelabs/risingwave/issues/13465#issuecomment-1821016508>
1710    Issue13465 = 2,
1711}
1712impl AggNodeVersion {
1713    /// String value of the enum field names used in the ProtoBuf definition.
1714    ///
1715    /// The values are not transformed in any way and thus are considered stable
1716    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1717    pub fn as_str_name(&self) -> &'static str {
1718        match self {
1719            Self::Unspecified => "AGG_NODE_VERSION_UNSPECIFIED",
1720            Self::Issue12140 => "AGG_NODE_VERSION_ISSUE_12140",
1721            Self::Issue13465 => "AGG_NODE_VERSION_ISSUE_13465",
1722        }
1723    }
1724    /// Creates an enum from field names used in the ProtoBuf definition.
1725    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1726        match value {
1727            "AGG_NODE_VERSION_UNSPECIFIED" => Some(Self::Unspecified),
1728            "AGG_NODE_VERSION_ISSUE_12140" => Some(Self::Issue12140),
1729            "AGG_NODE_VERSION_ISSUE_13465" => Some(Self::Issue13465),
1730            _ => None,
1731        }
1732    }
1733}
1734/// Decides which kind of Executor will be used
1735#[derive(prost_helpers::AnyPB)]
1736#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1737#[repr(i32)]
1738pub enum StreamScanType {
1739    Unspecified = 0,
1740    /// ChainExecutor
1741    Chain = 1,
1742    /// RearrangedChainExecutor
1743    Rearrange = 2,
1744    /// BackfillExecutor
1745    Backfill = 3,
1746    /// ChainExecutor with upstream_only = true
1747    UpstreamOnly = 4,
1748    /// ArrangementBackfillExecutor
1749    ArrangementBackfill = 5,
1750    /// SnapshotBackfillExecutor
1751    SnapshotBackfill = 6,
1752    /// SnapshotBackfillExecutor
1753    CrossDbSnapshotBackfill = 7,
1754}
1755impl StreamScanType {
1756    /// String value of the enum field names used in the ProtoBuf definition.
1757    ///
1758    /// The values are not transformed in any way and thus are considered stable
1759    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1760    pub fn as_str_name(&self) -> &'static str {
1761        match self {
1762            Self::Unspecified => "STREAM_SCAN_TYPE_UNSPECIFIED",
1763            Self::Chain => "STREAM_SCAN_TYPE_CHAIN",
1764            Self::Rearrange => "STREAM_SCAN_TYPE_REARRANGE",
1765            Self::Backfill => "STREAM_SCAN_TYPE_BACKFILL",
1766            Self::UpstreamOnly => "STREAM_SCAN_TYPE_UPSTREAM_ONLY",
1767            Self::ArrangementBackfill => "STREAM_SCAN_TYPE_ARRANGEMENT_BACKFILL",
1768            Self::SnapshotBackfill => "STREAM_SCAN_TYPE_SNAPSHOT_BACKFILL",
1769            Self::CrossDbSnapshotBackfill => {
1770                "STREAM_SCAN_TYPE_CROSS_DB_SNAPSHOT_BACKFILL"
1771            }
1772        }
1773    }
1774    /// Creates an enum from field names used in the ProtoBuf definition.
1775    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1776        match value {
1777            "STREAM_SCAN_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1778            "STREAM_SCAN_TYPE_CHAIN" => Some(Self::Chain),
1779            "STREAM_SCAN_TYPE_REARRANGE" => Some(Self::Rearrange),
1780            "STREAM_SCAN_TYPE_BACKFILL" => Some(Self::Backfill),
1781            "STREAM_SCAN_TYPE_UPSTREAM_ONLY" => Some(Self::UpstreamOnly),
1782            "STREAM_SCAN_TYPE_ARRANGEMENT_BACKFILL" => Some(Self::ArrangementBackfill),
1783            "STREAM_SCAN_TYPE_SNAPSHOT_BACKFILL" => Some(Self::SnapshotBackfill),
1784            "STREAM_SCAN_TYPE_CROSS_DB_SNAPSHOT_BACKFILL" => {
1785                Some(Self::CrossDbSnapshotBackfill)
1786            }
1787            _ => None,
1788        }
1789    }
1790}
1791#[derive(prost_helpers::AnyPB)]
1792#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1793#[repr(i32)]
1794pub enum OverWindowCachePolicy {
1795    Unspecified = 0,
1796    Full = 1,
1797    Recent = 2,
1798    RecentFirstN = 3,
1799    RecentLastN = 4,
1800}
1801impl OverWindowCachePolicy {
1802    /// String value of the enum field names used in the ProtoBuf definition.
1803    ///
1804    /// The values are not transformed in any way and thus are considered stable
1805    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1806    pub fn as_str_name(&self) -> &'static str {
1807        match self {
1808            Self::Unspecified => "OVER_WINDOW_CACHE_POLICY_UNSPECIFIED",
1809            Self::Full => "OVER_WINDOW_CACHE_POLICY_FULL",
1810            Self::Recent => "OVER_WINDOW_CACHE_POLICY_RECENT",
1811            Self::RecentFirstN => "OVER_WINDOW_CACHE_POLICY_RECENT_FIRST_N",
1812            Self::RecentLastN => "OVER_WINDOW_CACHE_POLICY_RECENT_LAST_N",
1813        }
1814    }
1815    /// Creates an enum from field names used in the ProtoBuf definition.
1816    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1817        match value {
1818            "OVER_WINDOW_CACHE_POLICY_UNSPECIFIED" => Some(Self::Unspecified),
1819            "OVER_WINDOW_CACHE_POLICY_FULL" => Some(Self::Full),
1820            "OVER_WINDOW_CACHE_POLICY_RECENT" => Some(Self::Recent),
1821            "OVER_WINDOW_CACHE_POLICY_RECENT_FIRST_N" => Some(Self::RecentFirstN),
1822            "OVER_WINDOW_CACHE_POLICY_RECENT_LAST_N" => Some(Self::RecentLastN),
1823            _ => None,
1824        }
1825    }
1826}
1827#[derive(prost_helpers::AnyPB)]
1828#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1829#[repr(i32)]
1830pub enum DispatcherType {
1831    Unspecified = 0,
1832    /// Dispatch by hash key, hashed by consistent hash.
1833    Hash = 1,
1834    /// Broadcast to all downstreams.
1835    ///
1836    /// Note a broadcast cannot be represented as multiple simple dispatchers, since they are
1837    /// different when we update dispatchers during scaling.
1838    Broadcast = 2,
1839    /// Only one downstream.
1840    Simple = 3,
1841    /// A special kind of exchange that doesn't involve shuffle. The upstream actor will be directly
1842    /// piped into the downstream actor, if there are the same number of actors. If number of actors
1843    /// are not the same, should use hash instead. Should be only used when distribution is the same.
1844    NoShuffle = 4,
1845}
1846impl DispatcherType {
1847    /// String value of the enum field names used in the ProtoBuf definition.
1848    ///
1849    /// The values are not transformed in any way and thus are considered stable
1850    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1851    pub fn as_str_name(&self) -> &'static str {
1852        match self {
1853            Self::Unspecified => "DISPATCHER_TYPE_UNSPECIFIED",
1854            Self::Hash => "DISPATCHER_TYPE_HASH",
1855            Self::Broadcast => "DISPATCHER_TYPE_BROADCAST",
1856            Self::Simple => "DISPATCHER_TYPE_SIMPLE",
1857            Self::NoShuffle => "DISPATCHER_TYPE_NO_SHUFFLE",
1858        }
1859    }
1860    /// Creates an enum from field names used in the ProtoBuf definition.
1861    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1862        match value {
1863            "DISPATCHER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1864            "DISPATCHER_TYPE_HASH" => Some(Self::Hash),
1865            "DISPATCHER_TYPE_BROADCAST" => Some(Self::Broadcast),
1866            "DISPATCHER_TYPE_SIMPLE" => Some(Self::Simple),
1867            "DISPATCHER_TYPE_NO_SHUFFLE" => Some(Self::NoShuffle),
1868            _ => None,
1869        }
1870    }
1871}
1872/// Indicates whether the fragment contains some special kind of nodes.
1873#[derive(prost_helpers::AnyPB)]
1874#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1875#[repr(i32)]
1876pub enum FragmentTypeFlag {
1877    FragmentUnspecified = 0,
1878    Source = 1,
1879    Mview = 2,
1880    Sink = 4,
1881    /// TODO: Remove this and insert a `BarrierRecv` instead.
1882    Now = 8,
1883    /// Include StreamScan and StreamCdcScan
1884    StreamScan = 16,
1885    BarrierRecv = 32,
1886    Values = 64,
1887    Dml = 128,
1888    CdcFilter = 256,
1889    SourceScan = 1024,
1890    SnapshotBackfillStreamScan = 2048,
1891    /// Note: this flag is not available in old fragments, so only suitable for debugging purpose.
1892    FsFetch = 4096,
1893    CrossDbSnapshotBackfillStreamScan = 8192,
1894}
1895impl FragmentTypeFlag {
1896    /// String value of the enum field names used in the ProtoBuf definition.
1897    ///
1898    /// The values are not transformed in any way and thus are considered stable
1899    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1900    pub fn as_str_name(&self) -> &'static str {
1901        match self {
1902            Self::FragmentUnspecified => "FRAGMENT_TYPE_FLAG_FRAGMENT_UNSPECIFIED",
1903            Self::Source => "FRAGMENT_TYPE_FLAG_SOURCE",
1904            Self::Mview => "FRAGMENT_TYPE_FLAG_MVIEW",
1905            Self::Sink => "FRAGMENT_TYPE_FLAG_SINK",
1906            Self::Now => "FRAGMENT_TYPE_FLAG_NOW",
1907            Self::StreamScan => "FRAGMENT_TYPE_FLAG_STREAM_SCAN",
1908            Self::BarrierRecv => "FRAGMENT_TYPE_FLAG_BARRIER_RECV",
1909            Self::Values => "FRAGMENT_TYPE_FLAG_VALUES",
1910            Self::Dml => "FRAGMENT_TYPE_FLAG_DML",
1911            Self::CdcFilter => "FRAGMENT_TYPE_FLAG_CDC_FILTER",
1912            Self::SourceScan => "FRAGMENT_TYPE_FLAG_SOURCE_SCAN",
1913            Self::SnapshotBackfillStreamScan => {
1914                "FRAGMENT_TYPE_FLAG_SNAPSHOT_BACKFILL_STREAM_SCAN"
1915            }
1916            Self::FsFetch => "FRAGMENT_TYPE_FLAG_FS_FETCH",
1917            Self::CrossDbSnapshotBackfillStreamScan => {
1918                "FRAGMENT_TYPE_FLAG_CROSS_DB_SNAPSHOT_BACKFILL_STREAM_SCAN"
1919            }
1920        }
1921    }
1922    /// Creates an enum from field names used in the ProtoBuf definition.
1923    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1924        match value {
1925            "FRAGMENT_TYPE_FLAG_FRAGMENT_UNSPECIFIED" => Some(Self::FragmentUnspecified),
1926            "FRAGMENT_TYPE_FLAG_SOURCE" => Some(Self::Source),
1927            "FRAGMENT_TYPE_FLAG_MVIEW" => Some(Self::Mview),
1928            "FRAGMENT_TYPE_FLAG_SINK" => Some(Self::Sink),
1929            "FRAGMENT_TYPE_FLAG_NOW" => Some(Self::Now),
1930            "FRAGMENT_TYPE_FLAG_STREAM_SCAN" => Some(Self::StreamScan),
1931            "FRAGMENT_TYPE_FLAG_BARRIER_RECV" => Some(Self::BarrierRecv),
1932            "FRAGMENT_TYPE_FLAG_VALUES" => Some(Self::Values),
1933            "FRAGMENT_TYPE_FLAG_DML" => Some(Self::Dml),
1934            "FRAGMENT_TYPE_FLAG_CDC_FILTER" => Some(Self::CdcFilter),
1935            "FRAGMENT_TYPE_FLAG_SOURCE_SCAN" => Some(Self::SourceScan),
1936            "FRAGMENT_TYPE_FLAG_SNAPSHOT_BACKFILL_STREAM_SCAN" => {
1937                Some(Self::SnapshotBackfillStreamScan)
1938            }
1939            "FRAGMENT_TYPE_FLAG_FS_FETCH" => Some(Self::FsFetch),
1940            "FRAGMENT_TYPE_FLAG_CROSS_DB_SNAPSHOT_BACKFILL_STREAM_SCAN" => {
1941                Some(Self::CrossDbSnapshotBackfillStreamScan)
1942            }
1943            _ => None,
1944        }
1945    }
1946}