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    #[prost(bool, tag = "4")]
1327    pub aligned: bool,
1328}
1329#[derive(prost_helpers::AnyPB)]
1330#[derive(Clone, PartialEq, ::prost::Message)]
1331pub struct MaterializedExprsNode {
1332    #[prost(message, repeated, tag = "1")]
1333    pub exprs: ::prost::alloc::vec::Vec<super::expr::ExprNode>,
1334    #[prost(message, optional, tag = "2")]
1335    pub state_table: ::core::option::Option<super::catalog::Table>,
1336    #[prost(uint32, optional, tag = "3")]
1337    pub state_clean_col_idx: ::core::option::Option<u32>,
1338}
1339#[derive(prost_helpers::AnyPB)]
1340#[derive(Clone, PartialEq, ::prost::Message)]
1341pub struct StreamNode {
1342    /// The id for the operator. This is local per mview.
1343    /// TODO: should better be a uint32.
1344    #[prost(uint64, tag = "1")]
1345    pub operator_id: u64,
1346    /// Child node in plan aka. upstream nodes in the streaming DAG
1347    #[prost(message, repeated, tag = "3")]
1348    pub input: ::prost::alloc::vec::Vec<StreamNode>,
1349    #[prost(uint32, repeated, tag = "2")]
1350    pub stream_key: ::prost::alloc::vec::Vec<u32>,
1351    #[prost(bool, tag = "24")]
1352    pub append_only: bool,
1353    #[prost(string, tag = "18")]
1354    pub identity: ::prost::alloc::string::String,
1355    /// The schema of the plan node
1356    #[prost(message, repeated, tag = "19")]
1357    pub fields: ::prost::alloc::vec::Vec<super::plan_common::Field>,
1358    #[prost(
1359        oneof = "stream_node::NodeBody",
1360        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"
1361    )]
1362    pub node_body: ::core::option::Option<stream_node::NodeBody>,
1363}
1364/// Nested message and enum types in `StreamNode`.
1365pub mod stream_node {
1366    #[derive(prost_helpers::AnyPB)]
1367    #[derive(::enum_as_inner::EnumAsInner, ::strum::Display, ::strum::EnumDiscriminants)]
1368    #[strum_discriminants(derive(::strum::Display))]
1369    #[derive(Clone, PartialEq, ::prost::Oneof)]
1370    pub enum NodeBody {
1371        #[prost(message, tag = "100")]
1372        Source(::prost::alloc::boxed::Box<super::SourceNode>),
1373        #[prost(message, tag = "101")]
1374        Project(::prost::alloc::boxed::Box<super::ProjectNode>),
1375        #[prost(message, tag = "102")]
1376        Filter(::prost::alloc::boxed::Box<super::FilterNode>),
1377        #[prost(message, tag = "103")]
1378        Materialize(::prost::alloc::boxed::Box<super::MaterializeNode>),
1379        #[prost(message, tag = "104")]
1380        StatelessSimpleAgg(::prost::alloc::boxed::Box<super::SimpleAggNode>),
1381        #[prost(message, tag = "105")]
1382        SimpleAgg(::prost::alloc::boxed::Box<super::SimpleAggNode>),
1383        #[prost(message, tag = "106")]
1384        HashAgg(::prost::alloc::boxed::Box<super::HashAggNode>),
1385        #[prost(message, tag = "107")]
1386        AppendOnlyTopN(::prost::alloc::boxed::Box<super::TopNNode>),
1387        #[prost(message, tag = "108")]
1388        HashJoin(::prost::alloc::boxed::Box<super::HashJoinNode>),
1389        #[prost(message, tag = "109")]
1390        TopN(::prost::alloc::boxed::Box<super::TopNNode>),
1391        #[prost(message, tag = "110")]
1392        HopWindow(::prost::alloc::boxed::Box<super::HopWindowNode>),
1393        #[prost(message, tag = "111")]
1394        Merge(::prost::alloc::boxed::Box<super::MergeNode>),
1395        #[prost(message, tag = "112")]
1396        Exchange(::prost::alloc::boxed::Box<super::ExchangeNode>),
1397        #[prost(message, tag = "113")]
1398        StreamScan(::prost::alloc::boxed::Box<super::StreamScanNode>),
1399        #[prost(message, tag = "114")]
1400        BatchPlan(::prost::alloc::boxed::Box<super::BatchPlanNode>),
1401        #[prost(message, tag = "115")]
1402        Lookup(::prost::alloc::boxed::Box<super::LookupNode>),
1403        #[prost(message, tag = "116")]
1404        Arrange(::prost::alloc::boxed::Box<super::ArrangeNode>),
1405        #[prost(message, tag = "117")]
1406        LookupUnion(::prost::alloc::boxed::Box<super::LookupUnionNode>),
1407        #[prost(message, tag = "118")]
1408        Union(super::UnionNode),
1409        #[prost(message, tag = "119")]
1410        DeltaIndexJoin(::prost::alloc::boxed::Box<super::DeltaIndexJoinNode>),
1411        #[prost(message, tag = "120")]
1412        Sink(::prost::alloc::boxed::Box<super::SinkNode>),
1413        #[prost(message, tag = "121")]
1414        Expand(::prost::alloc::boxed::Box<super::ExpandNode>),
1415        #[prost(message, tag = "122")]
1416        DynamicFilter(::prost::alloc::boxed::Box<super::DynamicFilterNode>),
1417        #[prost(message, tag = "123")]
1418        ProjectSet(::prost::alloc::boxed::Box<super::ProjectSetNode>),
1419        #[prost(message, tag = "124")]
1420        GroupTopN(::prost::alloc::boxed::Box<super::GroupTopNNode>),
1421        #[prost(message, tag = "125")]
1422        Sort(::prost::alloc::boxed::Box<super::SortNode>),
1423        #[prost(message, tag = "126")]
1424        WatermarkFilter(::prost::alloc::boxed::Box<super::WatermarkFilterNode>),
1425        #[prost(message, tag = "127")]
1426        Dml(::prost::alloc::boxed::Box<super::DmlNode>),
1427        #[prost(message, tag = "128")]
1428        RowIdGen(::prost::alloc::boxed::Box<super::RowIdGenNode>),
1429        #[prost(message, tag = "129")]
1430        Now(::prost::alloc::boxed::Box<super::NowNode>),
1431        #[prost(message, tag = "130")]
1432        AppendOnlyGroupTopN(::prost::alloc::boxed::Box<super::GroupTopNNode>),
1433        #[prost(message, tag = "131")]
1434        TemporalJoin(::prost::alloc::boxed::Box<super::TemporalJoinNode>),
1435        #[prost(message, tag = "132")]
1436        BarrierRecv(::prost::alloc::boxed::Box<super::BarrierRecvNode>),
1437        #[prost(message, tag = "133")]
1438        Values(::prost::alloc::boxed::Box<super::ValuesNode>),
1439        #[prost(message, tag = "134")]
1440        AppendOnlyDedup(::prost::alloc::boxed::Box<super::DedupNode>),
1441        #[prost(message, tag = "135")]
1442        NoOp(super::NoOpNode),
1443        #[prost(message, tag = "136")]
1444        EowcOverWindow(::prost::alloc::boxed::Box<super::EowcOverWindowNode>),
1445        #[prost(message, tag = "137")]
1446        OverWindow(::prost::alloc::boxed::Box<super::OverWindowNode>),
1447        #[prost(message, tag = "138")]
1448        StreamFsFetch(::prost::alloc::boxed::Box<super::StreamFsFetchNode>),
1449        #[prost(message, tag = "139")]
1450        StreamCdcScan(::prost::alloc::boxed::Box<super::StreamCdcScanNode>),
1451        #[prost(message, tag = "140")]
1452        CdcFilter(::prost::alloc::boxed::Box<super::CdcFilterNode>),
1453        #[prost(message, tag = "142")]
1454        SourceBackfill(::prost::alloc::boxed::Box<super::SourceBackfillNode>),
1455        #[prost(message, tag = "143")]
1456        Changelog(::prost::alloc::boxed::Box<super::ChangeLogNode>),
1457        #[prost(message, tag = "144")]
1458        LocalApproxPercentile(
1459            ::prost::alloc::boxed::Box<super::LocalApproxPercentileNode>,
1460        ),
1461        #[prost(message, tag = "145")]
1462        GlobalApproxPercentile(
1463            ::prost::alloc::boxed::Box<super::GlobalApproxPercentileNode>,
1464        ),
1465        #[prost(message, tag = "146")]
1466        RowMerge(::prost::alloc::boxed::Box<super::RowMergeNode>),
1467        #[prost(message, tag = "147")]
1468        AsOfJoin(::prost::alloc::boxed::Box<super::AsOfJoinNode>),
1469        #[prost(message, tag = "148")]
1470        SyncLogStore(::prost::alloc::boxed::Box<super::SyncLogStoreNode>),
1471        #[prost(message, tag = "149")]
1472        MaterializedExprs(::prost::alloc::boxed::Box<super::MaterializedExprsNode>),
1473    }
1474}
1475/// The method to map the upstream columns in the dispatcher before dispatching.
1476///
1477/// - For intra-job exchange, typically the upstream and downstream columns are the same. `indices`
1478///    will be `0..len` and `types` will be empty.
1479///
1480/// - For inter-job exchange,
1481///    * if the downstream only requires a subset of the upstream columns, `indices` will be the
1482///      indices of the required columns in the upstream columns.
1483///    * if some columns are added to the upstream, `indices` will help to maintain the same schema
1484///      from the view of the downstream.
1485///    * if some columns are altered to different (composite) types, `types` will be used to convert
1486///      the upstream columns to the downstream columns to maintain the same schema.
1487#[derive(prost_helpers::AnyPB)]
1488#[derive(Clone, PartialEq, ::prost::Message)]
1489pub struct DispatchOutputMapping {
1490    /// Indices of the columns to output.
1491    #[prost(uint32, repeated, tag = "1")]
1492    pub indices: ::prost::alloc::vec::Vec<u32>,
1493    /// Besides the indices, we may also need to convert the types of some columns.
1494    /// - If no type conversion is needed, this field will be empty.
1495    /// - If type conversion is needed, this will have the same length as `indices`. Only columns with
1496    ///    type conversion will have `upstream` and `downstream` field set.
1497    #[prost(message, repeated, tag = "2")]
1498    pub types: ::prost::alloc::vec::Vec<dispatch_output_mapping::TypePair>,
1499}
1500/// Nested message and enum types in `DispatchOutputMapping`.
1501pub mod dispatch_output_mapping {
1502    #[derive(prost_helpers::AnyPB)]
1503    #[derive(Clone, PartialEq, ::prost::Message)]
1504    pub struct TypePair {
1505        #[prost(message, optional, tag = "1")]
1506        pub upstream: ::core::option::Option<super::super::data::DataType>,
1507        #[prost(message, optional, tag = "2")]
1508        pub downstream: ::core::option::Option<super::super::data::DataType>,
1509    }
1510}
1511/// The property of an edge in the fragment graph.
1512/// This is essientially a "logical" version of `Dispatcher`. See the doc of `Dispatcher` for more details.
1513#[derive(prost_helpers::AnyPB)]
1514#[derive(Clone, PartialEq, ::prost::Message)]
1515pub struct DispatchStrategy {
1516    #[prost(enumeration = "DispatcherType", tag = "1")]
1517    pub r#type: i32,
1518    #[prost(uint32, repeated, tag = "2")]
1519    pub dist_key_indices: ::prost::alloc::vec::Vec<u32>,
1520    #[prost(message, optional, tag = "3")]
1521    pub output_mapping: ::core::option::Option<DispatchOutputMapping>,
1522}
1523/// A dispatcher redistribute messages.
1524/// We encode both the type and other usage information in the proto.
1525#[derive(prost_helpers::AnyPB)]
1526#[derive(Clone, PartialEq, ::prost::Message)]
1527pub struct Dispatcher {
1528    #[prost(enumeration = "DispatcherType", tag = "1")]
1529    pub r#type: i32,
1530    /// Indices of the columns to be used for hashing.
1531    /// For dispatcher types other than HASH, this is ignored.
1532    #[prost(uint32, repeated, tag = "2")]
1533    pub dist_key_indices: ::prost::alloc::vec::Vec<u32>,
1534    /// The method to map the upstream columns in the dispatcher before dispatching.
1535    #[prost(message, optional, tag = "6")]
1536    pub output_mapping: ::core::option::Option<DispatchOutputMapping>,
1537    /// The hash mapping for consistent hash.
1538    /// For dispatcher types other than HASH, this is ignored.
1539    #[prost(message, optional, tag = "3")]
1540    pub hash_mapping: ::core::option::Option<ActorMapping>,
1541    /// Dispatcher can be uniquely identified by a combination of actor id and dispatcher id.
1542    /// This is exactly the same as its downstream fragment id.
1543    #[prost(uint64, tag = "4")]
1544    pub dispatcher_id: u64,
1545    /// Number of downstreams decides how many endpoints a dispatcher should dispatch.
1546    #[prost(uint32, repeated, tag = "5")]
1547    pub downstream_actor_id: ::prost::alloc::vec::Vec<u32>,
1548}
1549/// A StreamActor is a running fragment of the overall stream graph,
1550#[derive(prost_helpers::AnyPB)]
1551#[derive(Clone, PartialEq, ::prost::Message)]
1552pub struct StreamActor {
1553    #[prost(uint32, tag = "1")]
1554    pub actor_id: u32,
1555    #[prost(uint32, tag = "2")]
1556    pub fragment_id: u32,
1557    #[prost(message, repeated, tag = "4")]
1558    pub dispatcher: ::prost::alloc::vec::Vec<Dispatcher>,
1559    /// Vnodes that the executors in this actor own.
1560    /// If the fragment is a singleton, this field will not be set and leave a `None`.
1561    #[prost(message, optional, tag = "8")]
1562    pub vnode_bitmap: ::core::option::Option<super::common::Buffer>,
1563    /// The SQL definition of this materialized view. Used for debugging only.
1564    #[prost(string, tag = "9")]
1565    pub mview_definition: ::prost::alloc::string::String,
1566    /// Provide the necessary context, e.g. session info like time zone, for the actor.
1567    #[prost(message, optional, tag = "10")]
1568    pub expr_context: ::core::option::Option<super::plan_common::ExprContext>,
1569}
1570/// The streaming context associated with a stream plan
1571#[derive(prost_helpers::AnyPB)]
1572#[derive(Clone, PartialEq, ::prost::Message)]
1573pub struct StreamContext {
1574    /// The timezone associated with the streaming plan. Only applies to MV for now.
1575    #[prost(string, tag = "1")]
1576    pub timezone: ::prost::alloc::string::String,
1577}
1578#[derive(prost_helpers::AnyPB)]
1579#[derive(Clone, PartialEq, ::prost::Message)]
1580pub struct BackfillOrder {
1581    #[prost(map = "uint32, message", tag = "1")]
1582    pub order: ::std::collections::HashMap<u32, super::common::Uint32Vector>,
1583}
1584/// Representation of a graph of stream fragments.
1585/// Generated by the fragmenter in the frontend, only used in DDL requests and never persisted.
1586///
1587/// For the persisted form, see `TableFragments`.
1588#[derive(prost_helpers::AnyPB)]
1589#[derive(Clone, PartialEq, ::prost::Message)]
1590pub struct StreamFragmentGraph {
1591    /// all the fragments in the graph.
1592    #[prost(map = "uint32, message", tag = "1")]
1593    pub fragments: ::std::collections::HashMap<
1594        u32,
1595        stream_fragment_graph::StreamFragment,
1596    >,
1597    /// edges between fragments.
1598    #[prost(message, repeated, tag = "2")]
1599    pub edges: ::prost::alloc::vec::Vec<stream_fragment_graph::StreamFragmentEdge>,
1600    #[prost(uint32, repeated, tag = "3")]
1601    pub dependent_table_ids: ::prost::alloc::vec::Vec<u32>,
1602    #[prost(uint32, tag = "4")]
1603    pub table_ids_cnt: u32,
1604    #[prost(message, optional, tag = "5")]
1605    pub ctx: ::core::option::Option<StreamContext>,
1606    /// If none, default parallelism will be applied.
1607    #[prost(message, optional, tag = "6")]
1608    pub parallelism: ::core::option::Option<stream_fragment_graph::Parallelism>,
1609    /// Specified max parallelism, i.e., expected vnode count for the graph.
1610    ///
1611    /// The scheduler on the meta service will use this as a hint to decide the vnode count
1612    /// for each fragment.
1613    ///
1614    /// Note that the actual vnode count may be different from this value.
1615    /// For example, a no-shuffle exchange between current fragment graph and an existing
1616    /// upstream fragment graph requires two fragments to be in the same distribution,
1617    /// thus the same vnode count.
1618    #[prost(uint32, tag = "7")]
1619    pub max_parallelism: u32,
1620    /// The backfill order strategy for the fragments.
1621    #[prost(message, optional, tag = "8")]
1622    pub backfill_order: ::core::option::Option<BackfillOrder>,
1623}
1624/// Nested message and enum types in `StreamFragmentGraph`.
1625pub mod stream_fragment_graph {
1626    #[derive(prost_helpers::AnyPB)]
1627    #[derive(Clone, PartialEq, ::prost::Message)]
1628    pub struct StreamFragment {
1629        /// 0-based on frontend, and will be rewritten to global id on meta.
1630        #[prost(uint32, tag = "1")]
1631        pub fragment_id: u32,
1632        /// root stream node in this fragment.
1633        #[prost(message, optional, tag = "2")]
1634        pub node: ::core::option::Option<super::StreamNode>,
1635        /// Bitwise-OR of `FragmentTypeFlag`s
1636        #[prost(uint32, tag = "3")]
1637        pub fragment_type_mask: u32,
1638        /// Mark whether this fragment requires exactly one actor.
1639        /// Note: if this is `false`, the fragment may still be a singleton according to the scheduler.
1640        /// One should check `meta.Fragment.distribution_type` for the final result.
1641        #[prost(bool, tag = "4")]
1642        pub requires_singleton: bool,
1643        /// Number of table ids (stateful states) for this fragment.
1644        #[prost(uint32, tag = "5")]
1645        pub table_ids_cnt: u32,
1646        /// Mark the upstream table ids of this fragment, Used for fragments with `StreamScan`s.
1647        #[prost(uint32, repeated, tag = "6")]
1648        pub upstream_table_ids: ::prost::alloc::vec::Vec<u32>,
1649    }
1650    #[derive(prost_helpers::AnyPB)]
1651    #[derive(Clone, PartialEq, ::prost::Message)]
1652    pub struct StreamFragmentEdge {
1653        /// Dispatch strategy for the fragment.
1654        #[prost(message, optional, tag = "1")]
1655        pub dispatch_strategy: ::core::option::Option<super::DispatchStrategy>,
1656        /// A unique identifier of this edge. Generally it should be exchange node's operator id. When
1657        /// rewriting fragments into delta joins or when inserting 1-to-1 exchange, there will be
1658        /// virtual links generated.
1659        #[prost(uint64, tag = "3")]
1660        pub link_id: u64,
1661        #[prost(uint32, tag = "4")]
1662        pub upstream_id: u32,
1663        #[prost(uint32, tag = "5")]
1664        pub downstream_id: u32,
1665    }
1666    #[derive(prost_helpers::AnyPB)]
1667    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1668    pub struct Parallelism {
1669        #[prost(uint64, tag = "1")]
1670        pub parallelism: u64,
1671    }
1672}
1673#[derive(prost_helpers::AnyPB)]
1674#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1675#[repr(i32)]
1676pub enum SinkLogStoreType {
1677    /// / Default value is the normal in memory log store to be backward compatible with the previously unset value
1678    Unspecified = 0,
1679    KvLogStore = 1,
1680    InMemoryLogStore = 2,
1681}
1682impl SinkLogStoreType {
1683    /// String value of the enum field names used in the ProtoBuf definition.
1684    ///
1685    /// The values are not transformed in any way and thus are considered stable
1686    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1687    pub fn as_str_name(&self) -> &'static str {
1688        match self {
1689            Self::Unspecified => "SINK_LOG_STORE_TYPE_UNSPECIFIED",
1690            Self::KvLogStore => "SINK_LOG_STORE_TYPE_KV_LOG_STORE",
1691            Self::InMemoryLogStore => "SINK_LOG_STORE_TYPE_IN_MEMORY_LOG_STORE",
1692        }
1693    }
1694    /// Creates an enum from field names used in the ProtoBuf definition.
1695    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1696        match value {
1697            "SINK_LOG_STORE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1698            "SINK_LOG_STORE_TYPE_KV_LOG_STORE" => Some(Self::KvLogStore),
1699            "SINK_LOG_STORE_TYPE_IN_MEMORY_LOG_STORE" => Some(Self::InMemoryLogStore),
1700            _ => None,
1701        }
1702    }
1703}
1704#[derive(prost_helpers::AnyPB)]
1705#[derive(prost_helpers::Version)]
1706#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1707#[repr(i32)]
1708pub enum AggNodeVersion {
1709    Unspecified = 0,
1710    /// <https://github.com/risingwavelabs/risingwave/issues/12140#issuecomment-1776289808>
1711    Issue12140 = 1,
1712    /// <https://github.com/risingwavelabs/risingwave/issues/13465#issuecomment-1821016508>
1713    Issue13465 = 2,
1714}
1715impl AggNodeVersion {
1716    /// String value of the enum field names used in the ProtoBuf definition.
1717    ///
1718    /// The values are not transformed in any way and thus are considered stable
1719    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1720    pub fn as_str_name(&self) -> &'static str {
1721        match self {
1722            Self::Unspecified => "AGG_NODE_VERSION_UNSPECIFIED",
1723            Self::Issue12140 => "AGG_NODE_VERSION_ISSUE_12140",
1724            Self::Issue13465 => "AGG_NODE_VERSION_ISSUE_13465",
1725        }
1726    }
1727    /// Creates an enum from field names used in the ProtoBuf definition.
1728    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1729        match value {
1730            "AGG_NODE_VERSION_UNSPECIFIED" => Some(Self::Unspecified),
1731            "AGG_NODE_VERSION_ISSUE_12140" => Some(Self::Issue12140),
1732            "AGG_NODE_VERSION_ISSUE_13465" => Some(Self::Issue13465),
1733            _ => None,
1734        }
1735    }
1736}
1737/// Decides which kind of Executor will be used
1738#[derive(prost_helpers::AnyPB)]
1739#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1740#[repr(i32)]
1741pub enum StreamScanType {
1742    Unspecified = 0,
1743    /// ChainExecutor
1744    Chain = 1,
1745    /// RearrangedChainExecutor
1746    Rearrange = 2,
1747    /// BackfillExecutor
1748    Backfill = 3,
1749    /// ChainExecutor with upstream_only = true
1750    UpstreamOnly = 4,
1751    /// ArrangementBackfillExecutor
1752    ArrangementBackfill = 5,
1753    /// SnapshotBackfillExecutor
1754    SnapshotBackfill = 6,
1755    /// SnapshotBackfillExecutor
1756    CrossDbSnapshotBackfill = 7,
1757}
1758impl StreamScanType {
1759    /// String value of the enum field names used in the ProtoBuf definition.
1760    ///
1761    /// The values are not transformed in any way and thus are considered stable
1762    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1763    pub fn as_str_name(&self) -> &'static str {
1764        match self {
1765            Self::Unspecified => "STREAM_SCAN_TYPE_UNSPECIFIED",
1766            Self::Chain => "STREAM_SCAN_TYPE_CHAIN",
1767            Self::Rearrange => "STREAM_SCAN_TYPE_REARRANGE",
1768            Self::Backfill => "STREAM_SCAN_TYPE_BACKFILL",
1769            Self::UpstreamOnly => "STREAM_SCAN_TYPE_UPSTREAM_ONLY",
1770            Self::ArrangementBackfill => "STREAM_SCAN_TYPE_ARRANGEMENT_BACKFILL",
1771            Self::SnapshotBackfill => "STREAM_SCAN_TYPE_SNAPSHOT_BACKFILL",
1772            Self::CrossDbSnapshotBackfill => {
1773                "STREAM_SCAN_TYPE_CROSS_DB_SNAPSHOT_BACKFILL"
1774            }
1775        }
1776    }
1777    /// Creates an enum from field names used in the ProtoBuf definition.
1778    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1779        match value {
1780            "STREAM_SCAN_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1781            "STREAM_SCAN_TYPE_CHAIN" => Some(Self::Chain),
1782            "STREAM_SCAN_TYPE_REARRANGE" => Some(Self::Rearrange),
1783            "STREAM_SCAN_TYPE_BACKFILL" => Some(Self::Backfill),
1784            "STREAM_SCAN_TYPE_UPSTREAM_ONLY" => Some(Self::UpstreamOnly),
1785            "STREAM_SCAN_TYPE_ARRANGEMENT_BACKFILL" => Some(Self::ArrangementBackfill),
1786            "STREAM_SCAN_TYPE_SNAPSHOT_BACKFILL" => Some(Self::SnapshotBackfill),
1787            "STREAM_SCAN_TYPE_CROSS_DB_SNAPSHOT_BACKFILL" => {
1788                Some(Self::CrossDbSnapshotBackfill)
1789            }
1790            _ => None,
1791        }
1792    }
1793}
1794#[derive(prost_helpers::AnyPB)]
1795#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1796#[repr(i32)]
1797pub enum OverWindowCachePolicy {
1798    Unspecified = 0,
1799    Full = 1,
1800    Recent = 2,
1801    RecentFirstN = 3,
1802    RecentLastN = 4,
1803}
1804impl OverWindowCachePolicy {
1805    /// String value of the enum field names used in the ProtoBuf definition.
1806    ///
1807    /// The values are not transformed in any way and thus are considered stable
1808    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1809    pub fn as_str_name(&self) -> &'static str {
1810        match self {
1811            Self::Unspecified => "OVER_WINDOW_CACHE_POLICY_UNSPECIFIED",
1812            Self::Full => "OVER_WINDOW_CACHE_POLICY_FULL",
1813            Self::Recent => "OVER_WINDOW_CACHE_POLICY_RECENT",
1814            Self::RecentFirstN => "OVER_WINDOW_CACHE_POLICY_RECENT_FIRST_N",
1815            Self::RecentLastN => "OVER_WINDOW_CACHE_POLICY_RECENT_LAST_N",
1816        }
1817    }
1818    /// Creates an enum from field names used in the ProtoBuf definition.
1819    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1820        match value {
1821            "OVER_WINDOW_CACHE_POLICY_UNSPECIFIED" => Some(Self::Unspecified),
1822            "OVER_WINDOW_CACHE_POLICY_FULL" => Some(Self::Full),
1823            "OVER_WINDOW_CACHE_POLICY_RECENT" => Some(Self::Recent),
1824            "OVER_WINDOW_CACHE_POLICY_RECENT_FIRST_N" => Some(Self::RecentFirstN),
1825            "OVER_WINDOW_CACHE_POLICY_RECENT_LAST_N" => Some(Self::RecentLastN),
1826            _ => None,
1827        }
1828    }
1829}
1830#[derive(prost_helpers::AnyPB)]
1831#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1832#[repr(i32)]
1833pub enum DispatcherType {
1834    Unspecified = 0,
1835    /// Dispatch by hash key, hashed by consistent hash.
1836    Hash = 1,
1837    /// Broadcast to all downstreams.
1838    ///
1839    /// Note a broadcast cannot be represented as multiple simple dispatchers, since they are
1840    /// different when we update dispatchers during scaling.
1841    Broadcast = 2,
1842    /// Only one downstream.
1843    Simple = 3,
1844    /// A special kind of exchange that doesn't involve shuffle. The upstream actor will be directly
1845    /// piped into the downstream actor, if there are the same number of actors. If number of actors
1846    /// are not the same, should use hash instead. Should be only used when distribution is the same.
1847    NoShuffle = 4,
1848}
1849impl DispatcherType {
1850    /// String value of the enum field names used in the ProtoBuf definition.
1851    ///
1852    /// The values are not transformed in any way and thus are considered stable
1853    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1854    pub fn as_str_name(&self) -> &'static str {
1855        match self {
1856            Self::Unspecified => "DISPATCHER_TYPE_UNSPECIFIED",
1857            Self::Hash => "DISPATCHER_TYPE_HASH",
1858            Self::Broadcast => "DISPATCHER_TYPE_BROADCAST",
1859            Self::Simple => "DISPATCHER_TYPE_SIMPLE",
1860            Self::NoShuffle => "DISPATCHER_TYPE_NO_SHUFFLE",
1861        }
1862    }
1863    /// Creates an enum from field names used in the ProtoBuf definition.
1864    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1865        match value {
1866            "DISPATCHER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1867            "DISPATCHER_TYPE_HASH" => Some(Self::Hash),
1868            "DISPATCHER_TYPE_BROADCAST" => Some(Self::Broadcast),
1869            "DISPATCHER_TYPE_SIMPLE" => Some(Self::Simple),
1870            "DISPATCHER_TYPE_NO_SHUFFLE" => Some(Self::NoShuffle),
1871            _ => None,
1872        }
1873    }
1874}
1875/// Indicates whether the fragment contains some special kind of nodes.
1876#[derive(prost_helpers::AnyPB)]
1877#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1878#[repr(i32)]
1879pub enum FragmentTypeFlag {
1880    FragmentUnspecified = 0,
1881    Source = 1,
1882    Mview = 2,
1883    Sink = 4,
1884    /// TODO: Remove this and insert a `BarrierRecv` instead.
1885    Now = 8,
1886    /// Include StreamScan and StreamCdcScan
1887    StreamScan = 16,
1888    BarrierRecv = 32,
1889    Values = 64,
1890    Dml = 128,
1891    CdcFilter = 256,
1892    SourceScan = 1024,
1893    SnapshotBackfillStreamScan = 2048,
1894    /// Note: this flag is not available in old fragments, so only suitable for debugging purpose.
1895    FsFetch = 4096,
1896    CrossDbSnapshotBackfillStreamScan = 8192,
1897}
1898impl FragmentTypeFlag {
1899    /// String value of the enum field names used in the ProtoBuf definition.
1900    ///
1901    /// The values are not transformed in any way and thus are considered stable
1902    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1903    pub fn as_str_name(&self) -> &'static str {
1904        match self {
1905            Self::FragmentUnspecified => "FRAGMENT_TYPE_FLAG_FRAGMENT_UNSPECIFIED",
1906            Self::Source => "FRAGMENT_TYPE_FLAG_SOURCE",
1907            Self::Mview => "FRAGMENT_TYPE_FLAG_MVIEW",
1908            Self::Sink => "FRAGMENT_TYPE_FLAG_SINK",
1909            Self::Now => "FRAGMENT_TYPE_FLAG_NOW",
1910            Self::StreamScan => "FRAGMENT_TYPE_FLAG_STREAM_SCAN",
1911            Self::BarrierRecv => "FRAGMENT_TYPE_FLAG_BARRIER_RECV",
1912            Self::Values => "FRAGMENT_TYPE_FLAG_VALUES",
1913            Self::Dml => "FRAGMENT_TYPE_FLAG_DML",
1914            Self::CdcFilter => "FRAGMENT_TYPE_FLAG_CDC_FILTER",
1915            Self::SourceScan => "FRAGMENT_TYPE_FLAG_SOURCE_SCAN",
1916            Self::SnapshotBackfillStreamScan => {
1917                "FRAGMENT_TYPE_FLAG_SNAPSHOT_BACKFILL_STREAM_SCAN"
1918            }
1919            Self::FsFetch => "FRAGMENT_TYPE_FLAG_FS_FETCH",
1920            Self::CrossDbSnapshotBackfillStreamScan => {
1921                "FRAGMENT_TYPE_FLAG_CROSS_DB_SNAPSHOT_BACKFILL_STREAM_SCAN"
1922            }
1923        }
1924    }
1925    /// Creates an enum from field names used in the ProtoBuf definition.
1926    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1927        match value {
1928            "FRAGMENT_TYPE_FLAG_FRAGMENT_UNSPECIFIED" => Some(Self::FragmentUnspecified),
1929            "FRAGMENT_TYPE_FLAG_SOURCE" => Some(Self::Source),
1930            "FRAGMENT_TYPE_FLAG_MVIEW" => Some(Self::Mview),
1931            "FRAGMENT_TYPE_FLAG_SINK" => Some(Self::Sink),
1932            "FRAGMENT_TYPE_FLAG_NOW" => Some(Self::Now),
1933            "FRAGMENT_TYPE_FLAG_STREAM_SCAN" => Some(Self::StreamScan),
1934            "FRAGMENT_TYPE_FLAG_BARRIER_RECV" => Some(Self::BarrierRecv),
1935            "FRAGMENT_TYPE_FLAG_VALUES" => Some(Self::Values),
1936            "FRAGMENT_TYPE_FLAG_DML" => Some(Self::Dml),
1937            "FRAGMENT_TYPE_FLAG_CDC_FILTER" => Some(Self::CdcFilter),
1938            "FRAGMENT_TYPE_FLAG_SOURCE_SCAN" => Some(Self::SourceScan),
1939            "FRAGMENT_TYPE_FLAG_SNAPSHOT_BACKFILL_STREAM_SCAN" => {
1940                Some(Self::SnapshotBackfillStreamScan)
1941            }
1942            "FRAGMENT_TYPE_FLAG_FS_FETCH" => Some(Self::FsFetch),
1943            "FRAGMENT_TYPE_FLAG_CROSS_DB_SNAPSHOT_BACKFILL_STREAM_SCAN" => {
1944                Some(Self::CrossDbSnapshotBackfillStreamScan)
1945            }
1946            _ => None,
1947        }
1948    }
1949}