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