risingwave_pb/
batch_plan.serde.rs

1use crate::batch_plan::*;
2impl serde::Serialize for AzblobFileScanNode {
3    #[allow(deprecated)]
4    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5    where
6        S: serde::Serializer,
7    {
8        use serde::ser::SerializeStruct;
9        let mut len = 0;
10        if !self.columns.is_empty() {
11            len += 1;
12        }
13        if self.file_format != 0 {
14            len += 1;
15        }
16        if !self.account_name.is_empty() {
17            len += 1;
18        }
19        if !self.account_key.is_empty() {
20            len += 1;
21        }
22        if !self.endpoint.is_empty() {
23            len += 1;
24        }
25        if !self.file_location.is_empty() {
26            len += 1;
27        }
28        let mut struct_ser = serializer.serialize_struct("batch_plan.AzblobFileScanNode", len)?;
29        if !self.columns.is_empty() {
30            struct_ser.serialize_field("columns", &self.columns)?;
31        }
32        if self.file_format != 0 {
33            let v = azblob_file_scan_node::FileFormat::try_from(self.file_format)
34                .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.file_format)))?;
35            struct_ser.serialize_field("fileFormat", &v)?;
36        }
37        if !self.account_name.is_empty() {
38            struct_ser.serialize_field("accountName", &self.account_name)?;
39        }
40        if !self.account_key.is_empty() {
41            struct_ser.serialize_field("accountKey", &self.account_key)?;
42        }
43        if !self.endpoint.is_empty() {
44            struct_ser.serialize_field("endpoint", &self.endpoint)?;
45        }
46        if !self.file_location.is_empty() {
47            struct_ser.serialize_field("fileLocation", &self.file_location)?;
48        }
49        struct_ser.end()
50    }
51}
52impl<'de> serde::Deserialize<'de> for AzblobFileScanNode {
53    #[allow(deprecated)]
54    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
55    where
56        D: serde::Deserializer<'de>,
57    {
58        const FIELDS: &[&str] = &[
59            "columns",
60            "file_format",
61            "fileFormat",
62            "account_name",
63            "accountName",
64            "account_key",
65            "accountKey",
66            "endpoint",
67            "file_location",
68            "fileLocation",
69        ];
70
71        #[allow(clippy::enum_variant_names)]
72        enum GeneratedField {
73            Columns,
74            FileFormat,
75            AccountName,
76            AccountKey,
77            Endpoint,
78            FileLocation,
79        }
80        impl<'de> serde::Deserialize<'de> for GeneratedField {
81            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
82            where
83                D: serde::Deserializer<'de>,
84            {
85                struct GeneratedVisitor;
86
87                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
88                    type Value = GeneratedField;
89
90                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
91                        write!(formatter, "expected one of: {:?}", &FIELDS)
92                    }
93
94                    #[allow(unused_variables)]
95                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
96                    where
97                        E: serde::de::Error,
98                    {
99                        match value {
100                            "columns" => Ok(GeneratedField::Columns),
101                            "fileFormat" | "file_format" => Ok(GeneratedField::FileFormat),
102                            "accountName" | "account_name" => Ok(GeneratedField::AccountName),
103                            "accountKey" | "account_key" => Ok(GeneratedField::AccountKey),
104                            "endpoint" => Ok(GeneratedField::Endpoint),
105                            "fileLocation" | "file_location" => Ok(GeneratedField::FileLocation),
106                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
107                        }
108                    }
109                }
110                deserializer.deserialize_identifier(GeneratedVisitor)
111            }
112        }
113        struct GeneratedVisitor;
114        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
115            type Value = AzblobFileScanNode;
116
117            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
118                formatter.write_str("struct batch_plan.AzblobFileScanNode")
119            }
120
121            fn visit_map<V>(self, mut map_: V) -> std::result::Result<AzblobFileScanNode, V::Error>
122                where
123                    V: serde::de::MapAccess<'de>,
124            {
125                let mut columns__ = None;
126                let mut file_format__ = None;
127                let mut account_name__ = None;
128                let mut account_key__ = None;
129                let mut endpoint__ = None;
130                let mut file_location__ = None;
131                while let Some(k) = map_.next_key()? {
132                    match k {
133                        GeneratedField::Columns => {
134                            if columns__.is_some() {
135                                return Err(serde::de::Error::duplicate_field("columns"));
136                            }
137                            columns__ = Some(map_.next_value()?);
138                        }
139                        GeneratedField::FileFormat => {
140                            if file_format__.is_some() {
141                                return Err(serde::de::Error::duplicate_field("fileFormat"));
142                            }
143                            file_format__ = Some(map_.next_value::<azblob_file_scan_node::FileFormat>()? as i32);
144                        }
145                        GeneratedField::AccountName => {
146                            if account_name__.is_some() {
147                                return Err(serde::de::Error::duplicate_field("accountName"));
148                            }
149                            account_name__ = Some(map_.next_value()?);
150                        }
151                        GeneratedField::AccountKey => {
152                            if account_key__.is_some() {
153                                return Err(serde::de::Error::duplicate_field("accountKey"));
154                            }
155                            account_key__ = Some(map_.next_value()?);
156                        }
157                        GeneratedField::Endpoint => {
158                            if endpoint__.is_some() {
159                                return Err(serde::de::Error::duplicate_field("endpoint"));
160                            }
161                            endpoint__ = Some(map_.next_value()?);
162                        }
163                        GeneratedField::FileLocation => {
164                            if file_location__.is_some() {
165                                return Err(serde::de::Error::duplicate_field("fileLocation"));
166                            }
167                            file_location__ = Some(map_.next_value()?);
168                        }
169                    }
170                }
171                Ok(AzblobFileScanNode {
172                    columns: columns__.unwrap_or_default(),
173                    file_format: file_format__.unwrap_or_default(),
174                    account_name: account_name__.unwrap_or_default(),
175                    account_key: account_key__.unwrap_or_default(),
176                    endpoint: endpoint__.unwrap_or_default(),
177                    file_location: file_location__.unwrap_or_default(),
178                })
179            }
180        }
181        deserializer.deserialize_struct("batch_plan.AzblobFileScanNode", FIELDS, GeneratedVisitor)
182    }
183}
184impl serde::Serialize for azblob_file_scan_node::FileFormat {
185    #[allow(deprecated)]
186    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
187    where
188        S: serde::Serializer,
189    {
190        let variant = match self {
191            Self::Unspecified => "FILE_FORMAT_UNSPECIFIED",
192            Self::Parquet => "PARQUET",
193        };
194        serializer.serialize_str(variant)
195    }
196}
197impl<'de> serde::Deserialize<'de> for azblob_file_scan_node::FileFormat {
198    #[allow(deprecated)]
199    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
200    where
201        D: serde::Deserializer<'de>,
202    {
203        const FIELDS: &[&str] = &[
204            "FILE_FORMAT_UNSPECIFIED",
205            "PARQUET",
206        ];
207
208        struct GeneratedVisitor;
209
210        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
211            type Value = azblob_file_scan_node::FileFormat;
212
213            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
214                write!(formatter, "expected one of: {:?}", &FIELDS)
215            }
216
217            fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
218            where
219                E: serde::de::Error,
220            {
221                i32::try_from(v)
222                    .ok()
223                    .and_then(|x| x.try_into().ok())
224                    .ok_or_else(|| {
225                        serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
226                    })
227            }
228
229            fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
230            where
231                E: serde::de::Error,
232            {
233                i32::try_from(v)
234                    .ok()
235                    .and_then(|x| x.try_into().ok())
236                    .ok_or_else(|| {
237                        serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
238                    })
239            }
240
241            fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
242            where
243                E: serde::de::Error,
244            {
245                match value {
246                    "FILE_FORMAT_UNSPECIFIED" => Ok(azblob_file_scan_node::FileFormat::Unspecified),
247                    "PARQUET" => Ok(azblob_file_scan_node::FileFormat::Parquet),
248                    _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
249                }
250            }
251        }
252        deserializer.deserialize_any(GeneratedVisitor)
253    }
254}
255impl serde::Serialize for DeleteNode {
256    #[allow(deprecated)]
257    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
258    where
259        S: serde::Serializer,
260    {
261        use serde::ser::SerializeStruct;
262        let mut len = 0;
263        if self.table_id != 0 {
264            len += 1;
265        }
266        if self.table_version_id != 0 {
267            len += 1;
268        }
269        if self.returning {
270            len += 1;
271        }
272        if self.session_id != 0 {
273            len += 1;
274        }
275        let mut struct_ser = serializer.serialize_struct("batch_plan.DeleteNode", len)?;
276        if self.table_id != 0 {
277            struct_ser.serialize_field("tableId", &self.table_id)?;
278        }
279        if self.table_version_id != 0 {
280            #[allow(clippy::needless_borrow)]
281            #[allow(clippy::needless_borrows_for_generic_args)]
282            struct_ser.serialize_field("tableVersionId", ToString::to_string(&self.table_version_id).as_str())?;
283        }
284        if self.returning {
285            struct_ser.serialize_field("returning", &self.returning)?;
286        }
287        if self.session_id != 0 {
288            struct_ser.serialize_field("sessionId", &self.session_id)?;
289        }
290        struct_ser.end()
291    }
292}
293impl<'de> serde::Deserialize<'de> for DeleteNode {
294    #[allow(deprecated)]
295    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
296    where
297        D: serde::Deserializer<'de>,
298    {
299        const FIELDS: &[&str] = &[
300            "table_id",
301            "tableId",
302            "table_version_id",
303            "tableVersionId",
304            "returning",
305            "session_id",
306            "sessionId",
307        ];
308
309        #[allow(clippy::enum_variant_names)]
310        enum GeneratedField {
311            TableId,
312            TableVersionId,
313            Returning,
314            SessionId,
315        }
316        impl<'de> serde::Deserialize<'de> for GeneratedField {
317            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
318            where
319                D: serde::Deserializer<'de>,
320            {
321                struct GeneratedVisitor;
322
323                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
324                    type Value = GeneratedField;
325
326                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
327                        write!(formatter, "expected one of: {:?}", &FIELDS)
328                    }
329
330                    #[allow(unused_variables)]
331                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
332                    where
333                        E: serde::de::Error,
334                    {
335                        match value {
336                            "tableId" | "table_id" => Ok(GeneratedField::TableId),
337                            "tableVersionId" | "table_version_id" => Ok(GeneratedField::TableVersionId),
338                            "returning" => Ok(GeneratedField::Returning),
339                            "sessionId" | "session_id" => Ok(GeneratedField::SessionId),
340                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
341                        }
342                    }
343                }
344                deserializer.deserialize_identifier(GeneratedVisitor)
345            }
346        }
347        struct GeneratedVisitor;
348        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
349            type Value = DeleteNode;
350
351            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
352                formatter.write_str("struct batch_plan.DeleteNode")
353            }
354
355            fn visit_map<V>(self, mut map_: V) -> std::result::Result<DeleteNode, V::Error>
356                where
357                    V: serde::de::MapAccess<'de>,
358            {
359                let mut table_id__ = None;
360                let mut table_version_id__ = None;
361                let mut returning__ = None;
362                let mut session_id__ = None;
363                while let Some(k) = map_.next_key()? {
364                    match k {
365                        GeneratedField::TableId => {
366                            if table_id__.is_some() {
367                                return Err(serde::de::Error::duplicate_field("tableId"));
368                            }
369                            table_id__ = 
370                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
371                            ;
372                        }
373                        GeneratedField::TableVersionId => {
374                            if table_version_id__.is_some() {
375                                return Err(serde::de::Error::duplicate_field("tableVersionId"));
376                            }
377                            table_version_id__ = 
378                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
379                            ;
380                        }
381                        GeneratedField::Returning => {
382                            if returning__.is_some() {
383                                return Err(serde::de::Error::duplicate_field("returning"));
384                            }
385                            returning__ = Some(map_.next_value()?);
386                        }
387                        GeneratedField::SessionId => {
388                            if session_id__.is_some() {
389                                return Err(serde::de::Error::duplicate_field("sessionId"));
390                            }
391                            session_id__ = 
392                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
393                            ;
394                        }
395                    }
396                }
397                Ok(DeleteNode {
398                    table_id: table_id__.unwrap_or_default(),
399                    table_version_id: table_version_id__.unwrap_or_default(),
400                    returning: returning__.unwrap_or_default(),
401                    session_id: session_id__.unwrap_or_default(),
402                })
403            }
404        }
405        deserializer.deserialize_struct("batch_plan.DeleteNode", FIELDS, GeneratedVisitor)
406    }
407}
408impl serde::Serialize for DistributedLookupJoinNode {
409    #[allow(deprecated)]
410    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
411    where
412        S: serde::Serializer,
413    {
414        use serde::ser::SerializeStruct;
415        let mut len = 0;
416        if self.join_type != 0 {
417            len += 1;
418        }
419        if self.condition.is_some() {
420            len += 1;
421        }
422        if !self.outer_side_key.is_empty() {
423            len += 1;
424        }
425        if !self.inner_side_key.is_empty() {
426            len += 1;
427        }
428        if self.lookup_prefix_len != 0 {
429            len += 1;
430        }
431        if self.inner_side_table_desc.is_some() {
432            len += 1;
433        }
434        if !self.inner_side_column_ids.is_empty() {
435            len += 1;
436        }
437        if !self.output_indices.is_empty() {
438            len += 1;
439        }
440        if !self.null_safe.is_empty() {
441            len += 1;
442        }
443        if self.as_of.is_some() {
444            len += 1;
445        }
446        if self.asof_desc.is_some() {
447            len += 1;
448        }
449        let mut struct_ser = serializer.serialize_struct("batch_plan.DistributedLookupJoinNode", len)?;
450        if self.join_type != 0 {
451            let v = super::plan_common::JoinType::try_from(self.join_type)
452                .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.join_type)))?;
453            struct_ser.serialize_field("joinType", &v)?;
454        }
455        if let Some(v) = self.condition.as_ref() {
456            struct_ser.serialize_field("condition", v)?;
457        }
458        if !self.outer_side_key.is_empty() {
459            struct_ser.serialize_field("outerSideKey", &self.outer_side_key)?;
460        }
461        if !self.inner_side_key.is_empty() {
462            struct_ser.serialize_field("innerSideKey", &self.inner_side_key)?;
463        }
464        if self.lookup_prefix_len != 0 {
465            struct_ser.serialize_field("lookupPrefixLen", &self.lookup_prefix_len)?;
466        }
467        if let Some(v) = self.inner_side_table_desc.as_ref() {
468            struct_ser.serialize_field("innerSideTableDesc", v)?;
469        }
470        if !self.inner_side_column_ids.is_empty() {
471            struct_ser.serialize_field("innerSideColumnIds", &self.inner_side_column_ids)?;
472        }
473        if !self.output_indices.is_empty() {
474            struct_ser.serialize_field("outputIndices", &self.output_indices)?;
475        }
476        if !self.null_safe.is_empty() {
477            struct_ser.serialize_field("nullSafe", &self.null_safe)?;
478        }
479        if let Some(v) = self.as_of.as_ref() {
480            struct_ser.serialize_field("asOf", v)?;
481        }
482        if let Some(v) = self.asof_desc.as_ref() {
483            struct_ser.serialize_field("asofDesc", v)?;
484        }
485        struct_ser.end()
486    }
487}
488impl<'de> serde::Deserialize<'de> for DistributedLookupJoinNode {
489    #[allow(deprecated)]
490    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
491    where
492        D: serde::Deserializer<'de>,
493    {
494        const FIELDS: &[&str] = &[
495            "join_type",
496            "joinType",
497            "condition",
498            "outer_side_key",
499            "outerSideKey",
500            "inner_side_key",
501            "innerSideKey",
502            "lookup_prefix_len",
503            "lookupPrefixLen",
504            "inner_side_table_desc",
505            "innerSideTableDesc",
506            "inner_side_column_ids",
507            "innerSideColumnIds",
508            "output_indices",
509            "outputIndices",
510            "null_safe",
511            "nullSafe",
512            "as_of",
513            "asOf",
514            "asof_desc",
515            "asofDesc",
516        ];
517
518        #[allow(clippy::enum_variant_names)]
519        enum GeneratedField {
520            JoinType,
521            Condition,
522            OuterSideKey,
523            InnerSideKey,
524            LookupPrefixLen,
525            InnerSideTableDesc,
526            InnerSideColumnIds,
527            OutputIndices,
528            NullSafe,
529            AsOf,
530            AsofDesc,
531        }
532        impl<'de> serde::Deserialize<'de> for GeneratedField {
533            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
534            where
535                D: serde::Deserializer<'de>,
536            {
537                struct GeneratedVisitor;
538
539                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
540                    type Value = GeneratedField;
541
542                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
543                        write!(formatter, "expected one of: {:?}", &FIELDS)
544                    }
545
546                    #[allow(unused_variables)]
547                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
548                    where
549                        E: serde::de::Error,
550                    {
551                        match value {
552                            "joinType" | "join_type" => Ok(GeneratedField::JoinType),
553                            "condition" => Ok(GeneratedField::Condition),
554                            "outerSideKey" | "outer_side_key" => Ok(GeneratedField::OuterSideKey),
555                            "innerSideKey" | "inner_side_key" => Ok(GeneratedField::InnerSideKey),
556                            "lookupPrefixLen" | "lookup_prefix_len" => Ok(GeneratedField::LookupPrefixLen),
557                            "innerSideTableDesc" | "inner_side_table_desc" => Ok(GeneratedField::InnerSideTableDesc),
558                            "innerSideColumnIds" | "inner_side_column_ids" => Ok(GeneratedField::InnerSideColumnIds),
559                            "outputIndices" | "output_indices" => Ok(GeneratedField::OutputIndices),
560                            "nullSafe" | "null_safe" => Ok(GeneratedField::NullSafe),
561                            "asOf" | "as_of" => Ok(GeneratedField::AsOf),
562                            "asofDesc" | "asof_desc" => Ok(GeneratedField::AsofDesc),
563                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
564                        }
565                    }
566                }
567                deserializer.deserialize_identifier(GeneratedVisitor)
568            }
569        }
570        struct GeneratedVisitor;
571        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
572            type Value = DistributedLookupJoinNode;
573
574            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
575                formatter.write_str("struct batch_plan.DistributedLookupJoinNode")
576            }
577
578            fn visit_map<V>(self, mut map_: V) -> std::result::Result<DistributedLookupJoinNode, V::Error>
579                where
580                    V: serde::de::MapAccess<'de>,
581            {
582                let mut join_type__ = None;
583                let mut condition__ = None;
584                let mut outer_side_key__ = None;
585                let mut inner_side_key__ = None;
586                let mut lookup_prefix_len__ = None;
587                let mut inner_side_table_desc__ = None;
588                let mut inner_side_column_ids__ = None;
589                let mut output_indices__ = None;
590                let mut null_safe__ = None;
591                let mut as_of__ = None;
592                let mut asof_desc__ = None;
593                while let Some(k) = map_.next_key()? {
594                    match k {
595                        GeneratedField::JoinType => {
596                            if join_type__.is_some() {
597                                return Err(serde::de::Error::duplicate_field("joinType"));
598                            }
599                            join_type__ = Some(map_.next_value::<super::plan_common::JoinType>()? as i32);
600                        }
601                        GeneratedField::Condition => {
602                            if condition__.is_some() {
603                                return Err(serde::de::Error::duplicate_field("condition"));
604                            }
605                            condition__ = map_.next_value()?;
606                        }
607                        GeneratedField::OuterSideKey => {
608                            if outer_side_key__.is_some() {
609                                return Err(serde::de::Error::duplicate_field("outerSideKey"));
610                            }
611                            outer_side_key__ = 
612                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
613                                    .into_iter().map(|x| x.0).collect())
614                            ;
615                        }
616                        GeneratedField::InnerSideKey => {
617                            if inner_side_key__.is_some() {
618                                return Err(serde::de::Error::duplicate_field("innerSideKey"));
619                            }
620                            inner_side_key__ = 
621                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
622                                    .into_iter().map(|x| x.0).collect())
623                            ;
624                        }
625                        GeneratedField::LookupPrefixLen => {
626                            if lookup_prefix_len__.is_some() {
627                                return Err(serde::de::Error::duplicate_field("lookupPrefixLen"));
628                            }
629                            lookup_prefix_len__ = 
630                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
631                            ;
632                        }
633                        GeneratedField::InnerSideTableDesc => {
634                            if inner_side_table_desc__.is_some() {
635                                return Err(serde::de::Error::duplicate_field("innerSideTableDesc"));
636                            }
637                            inner_side_table_desc__ = map_.next_value()?;
638                        }
639                        GeneratedField::InnerSideColumnIds => {
640                            if inner_side_column_ids__.is_some() {
641                                return Err(serde::de::Error::duplicate_field("innerSideColumnIds"));
642                            }
643                            inner_side_column_ids__ = 
644                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
645                                    .into_iter().map(|x| x.0).collect())
646                            ;
647                        }
648                        GeneratedField::OutputIndices => {
649                            if output_indices__.is_some() {
650                                return Err(serde::de::Error::duplicate_field("outputIndices"));
651                            }
652                            output_indices__ = 
653                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
654                                    .into_iter().map(|x| x.0).collect())
655                            ;
656                        }
657                        GeneratedField::NullSafe => {
658                            if null_safe__.is_some() {
659                                return Err(serde::de::Error::duplicate_field("nullSafe"));
660                            }
661                            null_safe__ = Some(map_.next_value()?);
662                        }
663                        GeneratedField::AsOf => {
664                            if as_of__.is_some() {
665                                return Err(serde::de::Error::duplicate_field("asOf"));
666                            }
667                            as_of__ = map_.next_value()?;
668                        }
669                        GeneratedField::AsofDesc => {
670                            if asof_desc__.is_some() {
671                                return Err(serde::de::Error::duplicate_field("asofDesc"));
672                            }
673                            asof_desc__ = map_.next_value()?;
674                        }
675                    }
676                }
677                Ok(DistributedLookupJoinNode {
678                    join_type: join_type__.unwrap_or_default(),
679                    condition: condition__,
680                    outer_side_key: outer_side_key__.unwrap_or_default(),
681                    inner_side_key: inner_side_key__.unwrap_or_default(),
682                    lookup_prefix_len: lookup_prefix_len__.unwrap_or_default(),
683                    inner_side_table_desc: inner_side_table_desc__,
684                    inner_side_column_ids: inner_side_column_ids__.unwrap_or_default(),
685                    output_indices: output_indices__.unwrap_or_default(),
686                    null_safe: null_safe__.unwrap_or_default(),
687                    as_of: as_of__,
688                    asof_desc: asof_desc__,
689                })
690            }
691        }
692        deserializer.deserialize_struct("batch_plan.DistributedLookupJoinNode", FIELDS, GeneratedVisitor)
693    }
694}
695impl serde::Serialize for ExchangeInfo {
696    #[allow(deprecated)]
697    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
698    where
699        S: serde::Serializer,
700    {
701        use serde::ser::SerializeStruct;
702        let mut len = 0;
703        if self.mode != 0 {
704            len += 1;
705        }
706        if self.distribution.is_some() {
707            len += 1;
708        }
709        let mut struct_ser = serializer.serialize_struct("batch_plan.ExchangeInfo", len)?;
710        if self.mode != 0 {
711            let v = exchange_info::DistributionMode::try_from(self.mode)
712                .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.mode)))?;
713            struct_ser.serialize_field("mode", &v)?;
714        }
715        if let Some(v) = self.distribution.as_ref() {
716            match v {
717                exchange_info::Distribution::BroadcastInfo(v) => {
718                    struct_ser.serialize_field("broadcastInfo", v)?;
719                }
720                exchange_info::Distribution::HashInfo(v) => {
721                    struct_ser.serialize_field("hashInfo", v)?;
722                }
723                exchange_info::Distribution::ConsistentHashInfo(v) => {
724                    struct_ser.serialize_field("consistentHashInfo", v)?;
725                }
726            }
727        }
728        struct_ser.end()
729    }
730}
731impl<'de> serde::Deserialize<'de> for ExchangeInfo {
732    #[allow(deprecated)]
733    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
734    where
735        D: serde::Deserializer<'de>,
736    {
737        const FIELDS: &[&str] = &[
738            "mode",
739            "broadcast_info",
740            "broadcastInfo",
741            "hash_info",
742            "hashInfo",
743            "consistent_hash_info",
744            "consistentHashInfo",
745        ];
746
747        #[allow(clippy::enum_variant_names)]
748        enum GeneratedField {
749            Mode,
750            BroadcastInfo,
751            HashInfo,
752            ConsistentHashInfo,
753        }
754        impl<'de> serde::Deserialize<'de> for GeneratedField {
755            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
756            where
757                D: serde::Deserializer<'de>,
758            {
759                struct GeneratedVisitor;
760
761                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
762                    type Value = GeneratedField;
763
764                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
765                        write!(formatter, "expected one of: {:?}", &FIELDS)
766                    }
767
768                    #[allow(unused_variables)]
769                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
770                    where
771                        E: serde::de::Error,
772                    {
773                        match value {
774                            "mode" => Ok(GeneratedField::Mode),
775                            "broadcastInfo" | "broadcast_info" => Ok(GeneratedField::BroadcastInfo),
776                            "hashInfo" | "hash_info" => Ok(GeneratedField::HashInfo),
777                            "consistentHashInfo" | "consistent_hash_info" => Ok(GeneratedField::ConsistentHashInfo),
778                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
779                        }
780                    }
781                }
782                deserializer.deserialize_identifier(GeneratedVisitor)
783            }
784        }
785        struct GeneratedVisitor;
786        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
787            type Value = ExchangeInfo;
788
789            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
790                formatter.write_str("struct batch_plan.ExchangeInfo")
791            }
792
793            fn visit_map<V>(self, mut map_: V) -> std::result::Result<ExchangeInfo, V::Error>
794                where
795                    V: serde::de::MapAccess<'de>,
796            {
797                let mut mode__ = None;
798                let mut distribution__ = None;
799                while let Some(k) = map_.next_key()? {
800                    match k {
801                        GeneratedField::Mode => {
802                            if mode__.is_some() {
803                                return Err(serde::de::Error::duplicate_field("mode"));
804                            }
805                            mode__ = Some(map_.next_value::<exchange_info::DistributionMode>()? as i32);
806                        }
807                        GeneratedField::BroadcastInfo => {
808                            if distribution__.is_some() {
809                                return Err(serde::de::Error::duplicate_field("broadcastInfo"));
810                            }
811                            distribution__ = map_.next_value::<::std::option::Option<_>>()?.map(exchange_info::Distribution::BroadcastInfo)
812;
813                        }
814                        GeneratedField::HashInfo => {
815                            if distribution__.is_some() {
816                                return Err(serde::de::Error::duplicate_field("hashInfo"));
817                            }
818                            distribution__ = map_.next_value::<::std::option::Option<_>>()?.map(exchange_info::Distribution::HashInfo)
819;
820                        }
821                        GeneratedField::ConsistentHashInfo => {
822                            if distribution__.is_some() {
823                                return Err(serde::de::Error::duplicate_field("consistentHashInfo"));
824                            }
825                            distribution__ = map_.next_value::<::std::option::Option<_>>()?.map(exchange_info::Distribution::ConsistentHashInfo)
826;
827                        }
828                    }
829                }
830                Ok(ExchangeInfo {
831                    mode: mode__.unwrap_or_default(),
832                    distribution: distribution__,
833                })
834            }
835        }
836        deserializer.deserialize_struct("batch_plan.ExchangeInfo", FIELDS, GeneratedVisitor)
837    }
838}
839impl serde::Serialize for exchange_info::BroadcastInfo {
840    #[allow(deprecated)]
841    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
842    where
843        S: serde::Serializer,
844    {
845        use serde::ser::SerializeStruct;
846        let mut len = 0;
847        if self.count != 0 {
848            len += 1;
849        }
850        let mut struct_ser = serializer.serialize_struct("batch_plan.ExchangeInfo.BroadcastInfo", len)?;
851        if self.count != 0 {
852            struct_ser.serialize_field("count", &self.count)?;
853        }
854        struct_ser.end()
855    }
856}
857impl<'de> serde::Deserialize<'de> for exchange_info::BroadcastInfo {
858    #[allow(deprecated)]
859    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
860    where
861        D: serde::Deserializer<'de>,
862    {
863        const FIELDS: &[&str] = &[
864            "count",
865        ];
866
867        #[allow(clippy::enum_variant_names)]
868        enum GeneratedField {
869            Count,
870        }
871        impl<'de> serde::Deserialize<'de> for GeneratedField {
872            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
873            where
874                D: serde::Deserializer<'de>,
875            {
876                struct GeneratedVisitor;
877
878                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
879                    type Value = GeneratedField;
880
881                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
882                        write!(formatter, "expected one of: {:?}", &FIELDS)
883                    }
884
885                    #[allow(unused_variables)]
886                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
887                    where
888                        E: serde::de::Error,
889                    {
890                        match value {
891                            "count" => Ok(GeneratedField::Count),
892                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
893                        }
894                    }
895                }
896                deserializer.deserialize_identifier(GeneratedVisitor)
897            }
898        }
899        struct GeneratedVisitor;
900        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
901            type Value = exchange_info::BroadcastInfo;
902
903            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
904                formatter.write_str("struct batch_plan.ExchangeInfo.BroadcastInfo")
905            }
906
907            fn visit_map<V>(self, mut map_: V) -> std::result::Result<exchange_info::BroadcastInfo, V::Error>
908                where
909                    V: serde::de::MapAccess<'de>,
910            {
911                let mut count__ = None;
912                while let Some(k) = map_.next_key()? {
913                    match k {
914                        GeneratedField::Count => {
915                            if count__.is_some() {
916                                return Err(serde::de::Error::duplicate_field("count"));
917                            }
918                            count__ = 
919                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
920                            ;
921                        }
922                    }
923                }
924                Ok(exchange_info::BroadcastInfo {
925                    count: count__.unwrap_or_default(),
926                })
927            }
928        }
929        deserializer.deserialize_struct("batch_plan.ExchangeInfo.BroadcastInfo", FIELDS, GeneratedVisitor)
930    }
931}
932impl serde::Serialize for exchange_info::ConsistentHashInfo {
933    #[allow(deprecated)]
934    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
935    where
936        S: serde::Serializer,
937    {
938        use serde::ser::SerializeStruct;
939        let mut len = 0;
940        if !self.vmap.is_empty() {
941            len += 1;
942        }
943        if !self.key.is_empty() {
944            len += 1;
945        }
946        let mut struct_ser = serializer.serialize_struct("batch_plan.ExchangeInfo.ConsistentHashInfo", len)?;
947        if !self.vmap.is_empty() {
948            struct_ser.serialize_field("vmap", &self.vmap)?;
949        }
950        if !self.key.is_empty() {
951            struct_ser.serialize_field("key", &self.key)?;
952        }
953        struct_ser.end()
954    }
955}
956impl<'de> serde::Deserialize<'de> for exchange_info::ConsistentHashInfo {
957    #[allow(deprecated)]
958    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
959    where
960        D: serde::Deserializer<'de>,
961    {
962        const FIELDS: &[&str] = &[
963            "vmap",
964            "key",
965        ];
966
967        #[allow(clippy::enum_variant_names)]
968        enum GeneratedField {
969            Vmap,
970            Key,
971        }
972        impl<'de> serde::Deserialize<'de> for GeneratedField {
973            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
974            where
975                D: serde::Deserializer<'de>,
976            {
977                struct GeneratedVisitor;
978
979                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
980                    type Value = GeneratedField;
981
982                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
983                        write!(formatter, "expected one of: {:?}", &FIELDS)
984                    }
985
986                    #[allow(unused_variables)]
987                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
988                    where
989                        E: serde::de::Error,
990                    {
991                        match value {
992                            "vmap" => Ok(GeneratedField::Vmap),
993                            "key" => Ok(GeneratedField::Key),
994                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
995                        }
996                    }
997                }
998                deserializer.deserialize_identifier(GeneratedVisitor)
999            }
1000        }
1001        struct GeneratedVisitor;
1002        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1003            type Value = exchange_info::ConsistentHashInfo;
1004
1005            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1006                formatter.write_str("struct batch_plan.ExchangeInfo.ConsistentHashInfo")
1007            }
1008
1009            fn visit_map<V>(self, mut map_: V) -> std::result::Result<exchange_info::ConsistentHashInfo, V::Error>
1010                where
1011                    V: serde::de::MapAccess<'de>,
1012            {
1013                let mut vmap__ = None;
1014                let mut key__ = None;
1015                while let Some(k) = map_.next_key()? {
1016                    match k {
1017                        GeneratedField::Vmap => {
1018                            if vmap__.is_some() {
1019                                return Err(serde::de::Error::duplicate_field("vmap"));
1020                            }
1021                            vmap__ = 
1022                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
1023                                    .into_iter().map(|x| x.0).collect())
1024                            ;
1025                        }
1026                        GeneratedField::Key => {
1027                            if key__.is_some() {
1028                                return Err(serde::de::Error::duplicate_field("key"));
1029                            }
1030                            key__ = 
1031                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
1032                                    .into_iter().map(|x| x.0).collect())
1033                            ;
1034                        }
1035                    }
1036                }
1037                Ok(exchange_info::ConsistentHashInfo {
1038                    vmap: vmap__.unwrap_or_default(),
1039                    key: key__.unwrap_or_default(),
1040                })
1041            }
1042        }
1043        deserializer.deserialize_struct("batch_plan.ExchangeInfo.ConsistentHashInfo", FIELDS, GeneratedVisitor)
1044    }
1045}
1046impl serde::Serialize for exchange_info::DistributionMode {
1047    #[allow(deprecated)]
1048    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1049    where
1050        S: serde::Serializer,
1051    {
1052        let variant = match self {
1053            Self::Unspecified => "UNSPECIFIED",
1054            Self::Single => "SINGLE",
1055            Self::Broadcast => "BROADCAST",
1056            Self::Hash => "HASH",
1057            Self::ConsistentHash => "CONSISTENT_HASH",
1058        };
1059        serializer.serialize_str(variant)
1060    }
1061}
1062impl<'de> serde::Deserialize<'de> for exchange_info::DistributionMode {
1063    #[allow(deprecated)]
1064    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1065    where
1066        D: serde::Deserializer<'de>,
1067    {
1068        const FIELDS: &[&str] = &[
1069            "UNSPECIFIED",
1070            "SINGLE",
1071            "BROADCAST",
1072            "HASH",
1073            "CONSISTENT_HASH",
1074        ];
1075
1076        struct GeneratedVisitor;
1077
1078        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1079            type Value = exchange_info::DistributionMode;
1080
1081            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1082                write!(formatter, "expected one of: {:?}", &FIELDS)
1083            }
1084
1085            fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
1086            where
1087                E: serde::de::Error,
1088            {
1089                i32::try_from(v)
1090                    .ok()
1091                    .and_then(|x| x.try_into().ok())
1092                    .ok_or_else(|| {
1093                        serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
1094                    })
1095            }
1096
1097            fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
1098            where
1099                E: serde::de::Error,
1100            {
1101                i32::try_from(v)
1102                    .ok()
1103                    .and_then(|x| x.try_into().ok())
1104                    .ok_or_else(|| {
1105                        serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
1106                    })
1107            }
1108
1109            fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1110            where
1111                E: serde::de::Error,
1112            {
1113                match value {
1114                    "UNSPECIFIED" => Ok(exchange_info::DistributionMode::Unspecified),
1115                    "SINGLE" => Ok(exchange_info::DistributionMode::Single),
1116                    "BROADCAST" => Ok(exchange_info::DistributionMode::Broadcast),
1117                    "HASH" => Ok(exchange_info::DistributionMode::Hash),
1118                    "CONSISTENT_HASH" => Ok(exchange_info::DistributionMode::ConsistentHash),
1119                    _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
1120                }
1121            }
1122        }
1123        deserializer.deserialize_any(GeneratedVisitor)
1124    }
1125}
1126impl serde::Serialize for exchange_info::HashInfo {
1127    #[allow(deprecated)]
1128    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1129    where
1130        S: serde::Serializer,
1131    {
1132        use serde::ser::SerializeStruct;
1133        let mut len = 0;
1134        if self.output_count != 0 {
1135            len += 1;
1136        }
1137        if !self.key.is_empty() {
1138            len += 1;
1139        }
1140        let mut struct_ser = serializer.serialize_struct("batch_plan.ExchangeInfo.HashInfo", len)?;
1141        if self.output_count != 0 {
1142            struct_ser.serialize_field("outputCount", &self.output_count)?;
1143        }
1144        if !self.key.is_empty() {
1145            struct_ser.serialize_field("key", &self.key)?;
1146        }
1147        struct_ser.end()
1148    }
1149}
1150impl<'de> serde::Deserialize<'de> for exchange_info::HashInfo {
1151    #[allow(deprecated)]
1152    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1153    where
1154        D: serde::Deserializer<'de>,
1155    {
1156        const FIELDS: &[&str] = &[
1157            "output_count",
1158            "outputCount",
1159            "key",
1160        ];
1161
1162        #[allow(clippy::enum_variant_names)]
1163        enum GeneratedField {
1164            OutputCount,
1165            Key,
1166        }
1167        impl<'de> serde::Deserialize<'de> for GeneratedField {
1168            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1169            where
1170                D: serde::Deserializer<'de>,
1171            {
1172                struct GeneratedVisitor;
1173
1174                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1175                    type Value = GeneratedField;
1176
1177                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1178                        write!(formatter, "expected one of: {:?}", &FIELDS)
1179                    }
1180
1181                    #[allow(unused_variables)]
1182                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1183                    where
1184                        E: serde::de::Error,
1185                    {
1186                        match value {
1187                            "outputCount" | "output_count" => Ok(GeneratedField::OutputCount),
1188                            "key" => Ok(GeneratedField::Key),
1189                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1190                        }
1191                    }
1192                }
1193                deserializer.deserialize_identifier(GeneratedVisitor)
1194            }
1195        }
1196        struct GeneratedVisitor;
1197        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1198            type Value = exchange_info::HashInfo;
1199
1200            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1201                formatter.write_str("struct batch_plan.ExchangeInfo.HashInfo")
1202            }
1203
1204            fn visit_map<V>(self, mut map_: V) -> std::result::Result<exchange_info::HashInfo, V::Error>
1205                where
1206                    V: serde::de::MapAccess<'de>,
1207            {
1208                let mut output_count__ = None;
1209                let mut key__ = None;
1210                while let Some(k) = map_.next_key()? {
1211                    match k {
1212                        GeneratedField::OutputCount => {
1213                            if output_count__.is_some() {
1214                                return Err(serde::de::Error::duplicate_field("outputCount"));
1215                            }
1216                            output_count__ = 
1217                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1218                            ;
1219                        }
1220                        GeneratedField::Key => {
1221                            if key__.is_some() {
1222                                return Err(serde::de::Error::duplicate_field("key"));
1223                            }
1224                            key__ = 
1225                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
1226                                    .into_iter().map(|x| x.0).collect())
1227                            ;
1228                        }
1229                    }
1230                }
1231                Ok(exchange_info::HashInfo {
1232                    output_count: output_count__.unwrap_or_default(),
1233                    key: key__.unwrap_or_default(),
1234                })
1235            }
1236        }
1237        deserializer.deserialize_struct("batch_plan.ExchangeInfo.HashInfo", FIELDS, GeneratedVisitor)
1238    }
1239}
1240impl serde::Serialize for ExchangeNode {
1241    #[allow(deprecated)]
1242    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1243    where
1244        S: serde::Serializer,
1245    {
1246        use serde::ser::SerializeStruct;
1247        let mut len = 0;
1248        if !self.sources.is_empty() {
1249            len += 1;
1250        }
1251        if self.sequential {
1252            len += 1;
1253        }
1254        if !self.input_schema.is_empty() {
1255            len += 1;
1256        }
1257        let mut struct_ser = serializer.serialize_struct("batch_plan.ExchangeNode", len)?;
1258        if !self.sources.is_empty() {
1259            struct_ser.serialize_field("sources", &self.sources)?;
1260        }
1261        if self.sequential {
1262            struct_ser.serialize_field("sequential", &self.sequential)?;
1263        }
1264        if !self.input_schema.is_empty() {
1265            struct_ser.serialize_field("inputSchema", &self.input_schema)?;
1266        }
1267        struct_ser.end()
1268    }
1269}
1270impl<'de> serde::Deserialize<'de> for ExchangeNode {
1271    #[allow(deprecated)]
1272    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1273    where
1274        D: serde::Deserializer<'de>,
1275    {
1276        const FIELDS: &[&str] = &[
1277            "sources",
1278            "sequential",
1279            "input_schema",
1280            "inputSchema",
1281        ];
1282
1283        #[allow(clippy::enum_variant_names)]
1284        enum GeneratedField {
1285            Sources,
1286            Sequential,
1287            InputSchema,
1288        }
1289        impl<'de> serde::Deserialize<'de> for GeneratedField {
1290            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1291            where
1292                D: serde::Deserializer<'de>,
1293            {
1294                struct GeneratedVisitor;
1295
1296                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1297                    type Value = GeneratedField;
1298
1299                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1300                        write!(formatter, "expected one of: {:?}", &FIELDS)
1301                    }
1302
1303                    #[allow(unused_variables)]
1304                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1305                    where
1306                        E: serde::de::Error,
1307                    {
1308                        match value {
1309                            "sources" => Ok(GeneratedField::Sources),
1310                            "sequential" => Ok(GeneratedField::Sequential),
1311                            "inputSchema" | "input_schema" => Ok(GeneratedField::InputSchema),
1312                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1313                        }
1314                    }
1315                }
1316                deserializer.deserialize_identifier(GeneratedVisitor)
1317            }
1318        }
1319        struct GeneratedVisitor;
1320        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1321            type Value = ExchangeNode;
1322
1323            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1324                formatter.write_str("struct batch_plan.ExchangeNode")
1325            }
1326
1327            fn visit_map<V>(self, mut map_: V) -> std::result::Result<ExchangeNode, V::Error>
1328                where
1329                    V: serde::de::MapAccess<'de>,
1330            {
1331                let mut sources__ = None;
1332                let mut sequential__ = None;
1333                let mut input_schema__ = None;
1334                while let Some(k) = map_.next_key()? {
1335                    match k {
1336                        GeneratedField::Sources => {
1337                            if sources__.is_some() {
1338                                return Err(serde::de::Error::duplicate_field("sources"));
1339                            }
1340                            sources__ = Some(map_.next_value()?);
1341                        }
1342                        GeneratedField::Sequential => {
1343                            if sequential__.is_some() {
1344                                return Err(serde::de::Error::duplicate_field("sequential"));
1345                            }
1346                            sequential__ = Some(map_.next_value()?);
1347                        }
1348                        GeneratedField::InputSchema => {
1349                            if input_schema__.is_some() {
1350                                return Err(serde::de::Error::duplicate_field("inputSchema"));
1351                            }
1352                            input_schema__ = Some(map_.next_value()?);
1353                        }
1354                    }
1355                }
1356                Ok(ExchangeNode {
1357                    sources: sources__.unwrap_or_default(),
1358                    sequential: sequential__.unwrap_or_default(),
1359                    input_schema: input_schema__.unwrap_or_default(),
1360                })
1361            }
1362        }
1363        deserializer.deserialize_struct("batch_plan.ExchangeNode", FIELDS, GeneratedVisitor)
1364    }
1365}
1366impl serde::Serialize for ExchangeSource {
1367    #[allow(deprecated)]
1368    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1369    where
1370        S: serde::Serializer,
1371    {
1372        use serde::ser::SerializeStruct;
1373        let mut len = 0;
1374        if self.task_output_id.is_some() {
1375            len += 1;
1376        }
1377        if self.host.is_some() {
1378            len += 1;
1379        }
1380        if self.local_execute_plan.is_some() {
1381            len += 1;
1382        }
1383        let mut struct_ser = serializer.serialize_struct("batch_plan.ExchangeSource", len)?;
1384        if let Some(v) = self.task_output_id.as_ref() {
1385            struct_ser.serialize_field("taskOutputId", v)?;
1386        }
1387        if let Some(v) = self.host.as_ref() {
1388            struct_ser.serialize_field("host", v)?;
1389        }
1390        if let Some(v) = self.local_execute_plan.as_ref() {
1391            match v {
1392                exchange_source::LocalExecutePlan::Plan(v) => {
1393                    struct_ser.serialize_field("plan", v)?;
1394                }
1395            }
1396        }
1397        struct_ser.end()
1398    }
1399}
1400impl<'de> serde::Deserialize<'de> for ExchangeSource {
1401    #[allow(deprecated)]
1402    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1403    where
1404        D: serde::Deserializer<'de>,
1405    {
1406        const FIELDS: &[&str] = &[
1407            "task_output_id",
1408            "taskOutputId",
1409            "host",
1410            "plan",
1411        ];
1412
1413        #[allow(clippy::enum_variant_names)]
1414        enum GeneratedField {
1415            TaskOutputId,
1416            Host,
1417            Plan,
1418        }
1419        impl<'de> serde::Deserialize<'de> for GeneratedField {
1420            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1421            where
1422                D: serde::Deserializer<'de>,
1423            {
1424                struct GeneratedVisitor;
1425
1426                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1427                    type Value = GeneratedField;
1428
1429                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1430                        write!(formatter, "expected one of: {:?}", &FIELDS)
1431                    }
1432
1433                    #[allow(unused_variables)]
1434                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1435                    where
1436                        E: serde::de::Error,
1437                    {
1438                        match value {
1439                            "taskOutputId" | "task_output_id" => Ok(GeneratedField::TaskOutputId),
1440                            "host" => Ok(GeneratedField::Host),
1441                            "plan" => Ok(GeneratedField::Plan),
1442                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1443                        }
1444                    }
1445                }
1446                deserializer.deserialize_identifier(GeneratedVisitor)
1447            }
1448        }
1449        struct GeneratedVisitor;
1450        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1451            type Value = ExchangeSource;
1452
1453            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1454                formatter.write_str("struct batch_plan.ExchangeSource")
1455            }
1456
1457            fn visit_map<V>(self, mut map_: V) -> std::result::Result<ExchangeSource, V::Error>
1458                where
1459                    V: serde::de::MapAccess<'de>,
1460            {
1461                let mut task_output_id__ = None;
1462                let mut host__ = None;
1463                let mut local_execute_plan__ = None;
1464                while let Some(k) = map_.next_key()? {
1465                    match k {
1466                        GeneratedField::TaskOutputId => {
1467                            if task_output_id__.is_some() {
1468                                return Err(serde::de::Error::duplicate_field("taskOutputId"));
1469                            }
1470                            task_output_id__ = map_.next_value()?;
1471                        }
1472                        GeneratedField::Host => {
1473                            if host__.is_some() {
1474                                return Err(serde::de::Error::duplicate_field("host"));
1475                            }
1476                            host__ = map_.next_value()?;
1477                        }
1478                        GeneratedField::Plan => {
1479                            if local_execute_plan__.is_some() {
1480                                return Err(serde::de::Error::duplicate_field("plan"));
1481                            }
1482                            local_execute_plan__ = map_.next_value::<::std::option::Option<_>>()?.map(exchange_source::LocalExecutePlan::Plan)
1483;
1484                        }
1485                    }
1486                }
1487                Ok(ExchangeSource {
1488                    task_output_id: task_output_id__,
1489                    host: host__,
1490                    local_execute_plan: local_execute_plan__,
1491                })
1492            }
1493        }
1494        deserializer.deserialize_struct("batch_plan.ExchangeSource", FIELDS, GeneratedVisitor)
1495    }
1496}
1497impl serde::Serialize for ExpandNode {
1498    #[allow(deprecated)]
1499    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1500    where
1501        S: serde::Serializer,
1502    {
1503        use serde::ser::SerializeStruct;
1504        let mut len = 0;
1505        if !self.column_subsets.is_empty() {
1506            len += 1;
1507        }
1508        let mut struct_ser = serializer.serialize_struct("batch_plan.ExpandNode", len)?;
1509        if !self.column_subsets.is_empty() {
1510            struct_ser.serialize_field("columnSubsets", &self.column_subsets)?;
1511        }
1512        struct_ser.end()
1513    }
1514}
1515impl<'de> serde::Deserialize<'de> for ExpandNode {
1516    #[allow(deprecated)]
1517    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1518    where
1519        D: serde::Deserializer<'de>,
1520    {
1521        const FIELDS: &[&str] = &[
1522            "column_subsets",
1523            "columnSubsets",
1524        ];
1525
1526        #[allow(clippy::enum_variant_names)]
1527        enum GeneratedField {
1528            ColumnSubsets,
1529        }
1530        impl<'de> serde::Deserialize<'de> for GeneratedField {
1531            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1532            where
1533                D: serde::Deserializer<'de>,
1534            {
1535                struct GeneratedVisitor;
1536
1537                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1538                    type Value = GeneratedField;
1539
1540                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1541                        write!(formatter, "expected one of: {:?}", &FIELDS)
1542                    }
1543
1544                    #[allow(unused_variables)]
1545                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1546                    where
1547                        E: serde::de::Error,
1548                    {
1549                        match value {
1550                            "columnSubsets" | "column_subsets" => Ok(GeneratedField::ColumnSubsets),
1551                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1552                        }
1553                    }
1554                }
1555                deserializer.deserialize_identifier(GeneratedVisitor)
1556            }
1557        }
1558        struct GeneratedVisitor;
1559        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1560            type Value = ExpandNode;
1561
1562            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1563                formatter.write_str("struct batch_plan.ExpandNode")
1564            }
1565
1566            fn visit_map<V>(self, mut map_: V) -> std::result::Result<ExpandNode, V::Error>
1567                where
1568                    V: serde::de::MapAccess<'de>,
1569            {
1570                let mut column_subsets__ = None;
1571                while let Some(k) = map_.next_key()? {
1572                    match k {
1573                        GeneratedField::ColumnSubsets => {
1574                            if column_subsets__.is_some() {
1575                                return Err(serde::de::Error::duplicate_field("columnSubsets"));
1576                            }
1577                            column_subsets__ = Some(map_.next_value()?);
1578                        }
1579                    }
1580                }
1581                Ok(ExpandNode {
1582                    column_subsets: column_subsets__.unwrap_or_default(),
1583                })
1584            }
1585        }
1586        deserializer.deserialize_struct("batch_plan.ExpandNode", FIELDS, GeneratedVisitor)
1587    }
1588}
1589impl serde::Serialize for expand_node::Subset {
1590    #[allow(deprecated)]
1591    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1592    where
1593        S: serde::Serializer,
1594    {
1595        use serde::ser::SerializeStruct;
1596        let mut len = 0;
1597        if !self.column_indices.is_empty() {
1598            len += 1;
1599        }
1600        let mut struct_ser = serializer.serialize_struct("batch_plan.ExpandNode.Subset", len)?;
1601        if !self.column_indices.is_empty() {
1602            struct_ser.serialize_field("columnIndices", &self.column_indices)?;
1603        }
1604        struct_ser.end()
1605    }
1606}
1607impl<'de> serde::Deserialize<'de> for expand_node::Subset {
1608    #[allow(deprecated)]
1609    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1610    where
1611        D: serde::Deserializer<'de>,
1612    {
1613        const FIELDS: &[&str] = &[
1614            "column_indices",
1615            "columnIndices",
1616        ];
1617
1618        #[allow(clippy::enum_variant_names)]
1619        enum GeneratedField {
1620            ColumnIndices,
1621        }
1622        impl<'de> serde::Deserialize<'de> for GeneratedField {
1623            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1624            where
1625                D: serde::Deserializer<'de>,
1626            {
1627                struct GeneratedVisitor;
1628
1629                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1630                    type Value = GeneratedField;
1631
1632                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1633                        write!(formatter, "expected one of: {:?}", &FIELDS)
1634                    }
1635
1636                    #[allow(unused_variables)]
1637                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1638                    where
1639                        E: serde::de::Error,
1640                    {
1641                        match value {
1642                            "columnIndices" | "column_indices" => Ok(GeneratedField::ColumnIndices),
1643                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1644                        }
1645                    }
1646                }
1647                deserializer.deserialize_identifier(GeneratedVisitor)
1648            }
1649        }
1650        struct GeneratedVisitor;
1651        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1652            type Value = expand_node::Subset;
1653
1654            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1655                formatter.write_str("struct batch_plan.ExpandNode.Subset")
1656            }
1657
1658            fn visit_map<V>(self, mut map_: V) -> std::result::Result<expand_node::Subset, V::Error>
1659                where
1660                    V: serde::de::MapAccess<'de>,
1661            {
1662                let mut column_indices__ = None;
1663                while let Some(k) = map_.next_key()? {
1664                    match k {
1665                        GeneratedField::ColumnIndices => {
1666                            if column_indices__.is_some() {
1667                                return Err(serde::de::Error::duplicate_field("columnIndices"));
1668                            }
1669                            column_indices__ = 
1670                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
1671                                    .into_iter().map(|x| x.0).collect())
1672                            ;
1673                        }
1674                    }
1675                }
1676                Ok(expand_node::Subset {
1677                    column_indices: column_indices__.unwrap_or_default(),
1678                })
1679            }
1680        }
1681        deserializer.deserialize_struct("batch_plan.ExpandNode.Subset", FIELDS, GeneratedVisitor)
1682    }
1683}
1684impl serde::Serialize for FileScanNode {
1685    #[allow(deprecated)]
1686    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1687    where
1688        S: serde::Serializer,
1689    {
1690        use serde::ser::SerializeStruct;
1691        let mut len = 0;
1692        if !self.columns.is_empty() {
1693            len += 1;
1694        }
1695        if self.file_format != 0 {
1696            len += 1;
1697        }
1698        if self.storage_type != 0 {
1699            len += 1;
1700        }
1701        if !self.s3_region.is_empty() {
1702            len += 1;
1703        }
1704        if !self.s3_access_key.is_empty() {
1705            len += 1;
1706        }
1707        if !self.s3_secret_key.is_empty() {
1708            len += 1;
1709        }
1710        if !self.file_location.is_empty() {
1711            len += 1;
1712        }
1713        if !self.s3_endpoint.is_empty() {
1714            len += 1;
1715        }
1716        let mut struct_ser = serializer.serialize_struct("batch_plan.FileScanNode", len)?;
1717        if !self.columns.is_empty() {
1718            struct_ser.serialize_field("columns", &self.columns)?;
1719        }
1720        if self.file_format != 0 {
1721            let v = file_scan_node::FileFormat::try_from(self.file_format)
1722                .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.file_format)))?;
1723            struct_ser.serialize_field("fileFormat", &v)?;
1724        }
1725        if self.storage_type != 0 {
1726            let v = file_scan_node::StorageType::try_from(self.storage_type)
1727                .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.storage_type)))?;
1728            struct_ser.serialize_field("storageType", &v)?;
1729        }
1730        if !self.s3_region.is_empty() {
1731            struct_ser.serialize_field("s3Region", &self.s3_region)?;
1732        }
1733        if !self.s3_access_key.is_empty() {
1734            struct_ser.serialize_field("s3AccessKey", &self.s3_access_key)?;
1735        }
1736        if !self.s3_secret_key.is_empty() {
1737            struct_ser.serialize_field("s3SecretKey", &self.s3_secret_key)?;
1738        }
1739        if !self.file_location.is_empty() {
1740            struct_ser.serialize_field("fileLocation", &self.file_location)?;
1741        }
1742        if !self.s3_endpoint.is_empty() {
1743            struct_ser.serialize_field("s3Endpoint", &self.s3_endpoint)?;
1744        }
1745        struct_ser.end()
1746    }
1747}
1748impl<'de> serde::Deserialize<'de> for FileScanNode {
1749    #[allow(deprecated)]
1750    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1751    where
1752        D: serde::Deserializer<'de>,
1753    {
1754        const FIELDS: &[&str] = &[
1755            "columns",
1756            "file_format",
1757            "fileFormat",
1758            "storage_type",
1759            "storageType",
1760            "s3_region",
1761            "s3Region",
1762            "s3_access_key",
1763            "s3AccessKey",
1764            "s3_secret_key",
1765            "s3SecretKey",
1766            "file_location",
1767            "fileLocation",
1768            "s3_endpoint",
1769            "s3Endpoint",
1770        ];
1771
1772        #[allow(clippy::enum_variant_names)]
1773        enum GeneratedField {
1774            Columns,
1775            FileFormat,
1776            StorageType,
1777            S3Region,
1778            S3AccessKey,
1779            S3SecretKey,
1780            FileLocation,
1781            S3Endpoint,
1782        }
1783        impl<'de> serde::Deserialize<'de> for GeneratedField {
1784            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1785            where
1786                D: serde::Deserializer<'de>,
1787            {
1788                struct GeneratedVisitor;
1789
1790                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1791                    type Value = GeneratedField;
1792
1793                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1794                        write!(formatter, "expected one of: {:?}", &FIELDS)
1795                    }
1796
1797                    #[allow(unused_variables)]
1798                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1799                    where
1800                        E: serde::de::Error,
1801                    {
1802                        match value {
1803                            "columns" => Ok(GeneratedField::Columns),
1804                            "fileFormat" | "file_format" => Ok(GeneratedField::FileFormat),
1805                            "storageType" | "storage_type" => Ok(GeneratedField::StorageType),
1806                            "s3Region" | "s3_region" => Ok(GeneratedField::S3Region),
1807                            "s3AccessKey" | "s3_access_key" => Ok(GeneratedField::S3AccessKey),
1808                            "s3SecretKey" | "s3_secret_key" => Ok(GeneratedField::S3SecretKey),
1809                            "fileLocation" | "file_location" => Ok(GeneratedField::FileLocation),
1810                            "s3Endpoint" | "s3_endpoint" => Ok(GeneratedField::S3Endpoint),
1811                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1812                        }
1813                    }
1814                }
1815                deserializer.deserialize_identifier(GeneratedVisitor)
1816            }
1817        }
1818        struct GeneratedVisitor;
1819        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1820            type Value = FileScanNode;
1821
1822            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1823                formatter.write_str("struct batch_plan.FileScanNode")
1824            }
1825
1826            fn visit_map<V>(self, mut map_: V) -> std::result::Result<FileScanNode, V::Error>
1827                where
1828                    V: serde::de::MapAccess<'de>,
1829            {
1830                let mut columns__ = None;
1831                let mut file_format__ = None;
1832                let mut storage_type__ = None;
1833                let mut s3_region__ = None;
1834                let mut s3_access_key__ = None;
1835                let mut s3_secret_key__ = None;
1836                let mut file_location__ = None;
1837                let mut s3_endpoint__ = None;
1838                while let Some(k) = map_.next_key()? {
1839                    match k {
1840                        GeneratedField::Columns => {
1841                            if columns__.is_some() {
1842                                return Err(serde::de::Error::duplicate_field("columns"));
1843                            }
1844                            columns__ = Some(map_.next_value()?);
1845                        }
1846                        GeneratedField::FileFormat => {
1847                            if file_format__.is_some() {
1848                                return Err(serde::de::Error::duplicate_field("fileFormat"));
1849                            }
1850                            file_format__ = Some(map_.next_value::<file_scan_node::FileFormat>()? as i32);
1851                        }
1852                        GeneratedField::StorageType => {
1853                            if storage_type__.is_some() {
1854                                return Err(serde::de::Error::duplicate_field("storageType"));
1855                            }
1856                            storage_type__ = Some(map_.next_value::<file_scan_node::StorageType>()? as i32);
1857                        }
1858                        GeneratedField::S3Region => {
1859                            if s3_region__.is_some() {
1860                                return Err(serde::de::Error::duplicate_field("s3Region"));
1861                            }
1862                            s3_region__ = Some(map_.next_value()?);
1863                        }
1864                        GeneratedField::S3AccessKey => {
1865                            if s3_access_key__.is_some() {
1866                                return Err(serde::de::Error::duplicate_field("s3AccessKey"));
1867                            }
1868                            s3_access_key__ = Some(map_.next_value()?);
1869                        }
1870                        GeneratedField::S3SecretKey => {
1871                            if s3_secret_key__.is_some() {
1872                                return Err(serde::de::Error::duplicate_field("s3SecretKey"));
1873                            }
1874                            s3_secret_key__ = Some(map_.next_value()?);
1875                        }
1876                        GeneratedField::FileLocation => {
1877                            if file_location__.is_some() {
1878                                return Err(serde::de::Error::duplicate_field("fileLocation"));
1879                            }
1880                            file_location__ = Some(map_.next_value()?);
1881                        }
1882                        GeneratedField::S3Endpoint => {
1883                            if s3_endpoint__.is_some() {
1884                                return Err(serde::de::Error::duplicate_field("s3Endpoint"));
1885                            }
1886                            s3_endpoint__ = Some(map_.next_value()?);
1887                        }
1888                    }
1889                }
1890                Ok(FileScanNode {
1891                    columns: columns__.unwrap_or_default(),
1892                    file_format: file_format__.unwrap_or_default(),
1893                    storage_type: storage_type__.unwrap_or_default(),
1894                    s3_region: s3_region__.unwrap_or_default(),
1895                    s3_access_key: s3_access_key__.unwrap_or_default(),
1896                    s3_secret_key: s3_secret_key__.unwrap_or_default(),
1897                    file_location: file_location__.unwrap_or_default(),
1898                    s3_endpoint: s3_endpoint__.unwrap_or_default(),
1899                })
1900            }
1901        }
1902        deserializer.deserialize_struct("batch_plan.FileScanNode", FIELDS, GeneratedVisitor)
1903    }
1904}
1905impl serde::Serialize for file_scan_node::FileFormat {
1906    #[allow(deprecated)]
1907    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1908    where
1909        S: serde::Serializer,
1910    {
1911        let variant = match self {
1912            Self::Unspecified => "FILE_FORMAT_UNSPECIFIED",
1913            Self::Parquet => "PARQUET",
1914        };
1915        serializer.serialize_str(variant)
1916    }
1917}
1918impl<'de> serde::Deserialize<'de> for file_scan_node::FileFormat {
1919    #[allow(deprecated)]
1920    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1921    where
1922        D: serde::Deserializer<'de>,
1923    {
1924        const FIELDS: &[&str] = &[
1925            "FILE_FORMAT_UNSPECIFIED",
1926            "PARQUET",
1927        ];
1928
1929        struct GeneratedVisitor;
1930
1931        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1932            type Value = file_scan_node::FileFormat;
1933
1934            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1935                write!(formatter, "expected one of: {:?}", &FIELDS)
1936            }
1937
1938            fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
1939            where
1940                E: serde::de::Error,
1941            {
1942                i32::try_from(v)
1943                    .ok()
1944                    .and_then(|x| x.try_into().ok())
1945                    .ok_or_else(|| {
1946                        serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
1947                    })
1948            }
1949
1950            fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
1951            where
1952                E: serde::de::Error,
1953            {
1954                i32::try_from(v)
1955                    .ok()
1956                    .and_then(|x| x.try_into().ok())
1957                    .ok_or_else(|| {
1958                        serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
1959                    })
1960            }
1961
1962            fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1963            where
1964                E: serde::de::Error,
1965            {
1966                match value {
1967                    "FILE_FORMAT_UNSPECIFIED" => Ok(file_scan_node::FileFormat::Unspecified),
1968                    "PARQUET" => Ok(file_scan_node::FileFormat::Parquet),
1969                    _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
1970                }
1971            }
1972        }
1973        deserializer.deserialize_any(GeneratedVisitor)
1974    }
1975}
1976impl serde::Serialize for file_scan_node::StorageType {
1977    #[allow(deprecated)]
1978    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1979    where
1980        S: serde::Serializer,
1981    {
1982        let variant = match self {
1983            Self::Unspecified => "STORAGE_TYPE_UNSPECIFIED",
1984            Self::S3 => "S3",
1985            Self::Gcs => "GCS",
1986            Self::Azblob => "AZBLOB",
1987        };
1988        serializer.serialize_str(variant)
1989    }
1990}
1991impl<'de> serde::Deserialize<'de> for file_scan_node::StorageType {
1992    #[allow(deprecated)]
1993    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1994    where
1995        D: serde::Deserializer<'de>,
1996    {
1997        const FIELDS: &[&str] = &[
1998            "STORAGE_TYPE_UNSPECIFIED",
1999            "S3",
2000            "GCS",
2001            "AZBLOB",
2002        ];
2003
2004        struct GeneratedVisitor;
2005
2006        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2007            type Value = file_scan_node::StorageType;
2008
2009            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2010                write!(formatter, "expected one of: {:?}", &FIELDS)
2011            }
2012
2013            fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
2014            where
2015                E: serde::de::Error,
2016            {
2017                i32::try_from(v)
2018                    .ok()
2019                    .and_then(|x| x.try_into().ok())
2020                    .ok_or_else(|| {
2021                        serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
2022                    })
2023            }
2024
2025            fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
2026            where
2027                E: serde::de::Error,
2028            {
2029                i32::try_from(v)
2030                    .ok()
2031                    .and_then(|x| x.try_into().ok())
2032                    .ok_or_else(|| {
2033                        serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
2034                    })
2035            }
2036
2037            fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2038            where
2039                E: serde::de::Error,
2040            {
2041                match value {
2042                    "STORAGE_TYPE_UNSPECIFIED" => Ok(file_scan_node::StorageType::Unspecified),
2043                    "S3" => Ok(file_scan_node::StorageType::S3),
2044                    "GCS" => Ok(file_scan_node::StorageType::Gcs),
2045                    "AZBLOB" => Ok(file_scan_node::StorageType::Azblob),
2046                    _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
2047                }
2048            }
2049        }
2050        deserializer.deserialize_any(GeneratedVisitor)
2051    }
2052}
2053impl serde::Serialize for FilterNode {
2054    #[allow(deprecated)]
2055    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2056    where
2057        S: serde::Serializer,
2058    {
2059        use serde::ser::SerializeStruct;
2060        let mut len = 0;
2061        if self.search_condition.is_some() {
2062            len += 1;
2063        }
2064        let mut struct_ser = serializer.serialize_struct("batch_plan.FilterNode", len)?;
2065        if let Some(v) = self.search_condition.as_ref() {
2066            struct_ser.serialize_field("searchCondition", v)?;
2067        }
2068        struct_ser.end()
2069    }
2070}
2071impl<'de> serde::Deserialize<'de> for FilterNode {
2072    #[allow(deprecated)]
2073    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2074    where
2075        D: serde::Deserializer<'de>,
2076    {
2077        const FIELDS: &[&str] = &[
2078            "search_condition",
2079            "searchCondition",
2080        ];
2081
2082        #[allow(clippy::enum_variant_names)]
2083        enum GeneratedField {
2084            SearchCondition,
2085        }
2086        impl<'de> serde::Deserialize<'de> for GeneratedField {
2087            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
2088            where
2089                D: serde::Deserializer<'de>,
2090            {
2091                struct GeneratedVisitor;
2092
2093                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2094                    type Value = GeneratedField;
2095
2096                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2097                        write!(formatter, "expected one of: {:?}", &FIELDS)
2098                    }
2099
2100                    #[allow(unused_variables)]
2101                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
2102                    where
2103                        E: serde::de::Error,
2104                    {
2105                        match value {
2106                            "searchCondition" | "search_condition" => Ok(GeneratedField::SearchCondition),
2107                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
2108                        }
2109                    }
2110                }
2111                deserializer.deserialize_identifier(GeneratedVisitor)
2112            }
2113        }
2114        struct GeneratedVisitor;
2115        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2116            type Value = FilterNode;
2117
2118            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2119                formatter.write_str("struct batch_plan.FilterNode")
2120            }
2121
2122            fn visit_map<V>(self, mut map_: V) -> std::result::Result<FilterNode, V::Error>
2123                where
2124                    V: serde::de::MapAccess<'de>,
2125            {
2126                let mut search_condition__ = None;
2127                while let Some(k) = map_.next_key()? {
2128                    match k {
2129                        GeneratedField::SearchCondition => {
2130                            if search_condition__.is_some() {
2131                                return Err(serde::de::Error::duplicate_field("searchCondition"));
2132                            }
2133                            search_condition__ = map_.next_value()?;
2134                        }
2135                    }
2136                }
2137                Ok(FilterNode {
2138                    search_condition: search_condition__,
2139                })
2140            }
2141        }
2142        deserializer.deserialize_struct("batch_plan.FilterNode", FIELDS, GeneratedVisitor)
2143    }
2144}
2145impl serde::Serialize for GcsFileScanNode {
2146    #[allow(deprecated)]
2147    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2148    where
2149        S: serde::Serializer,
2150    {
2151        use serde::ser::SerializeStruct;
2152        let mut len = 0;
2153        if !self.columns.is_empty() {
2154            len += 1;
2155        }
2156        if self.file_format != 0 {
2157            len += 1;
2158        }
2159        if !self.credential.is_empty() {
2160            len += 1;
2161        }
2162        if !self.file_location.is_empty() {
2163            len += 1;
2164        }
2165        let mut struct_ser = serializer.serialize_struct("batch_plan.GcsFileScanNode", len)?;
2166        if !self.columns.is_empty() {
2167            struct_ser.serialize_field("columns", &self.columns)?;
2168        }
2169        if self.file_format != 0 {
2170            let v = gcs_file_scan_node::FileFormat::try_from(self.file_format)
2171                .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.file_format)))?;
2172            struct_ser.serialize_field("fileFormat", &v)?;
2173        }
2174        if !self.credential.is_empty() {
2175            struct_ser.serialize_field("credential", &self.credential)?;
2176        }
2177        if !self.file_location.is_empty() {
2178            struct_ser.serialize_field("fileLocation", &self.file_location)?;
2179        }
2180        struct_ser.end()
2181    }
2182}
2183impl<'de> serde::Deserialize<'de> for GcsFileScanNode {
2184    #[allow(deprecated)]
2185    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2186    where
2187        D: serde::Deserializer<'de>,
2188    {
2189        const FIELDS: &[&str] = &[
2190            "columns",
2191            "file_format",
2192            "fileFormat",
2193            "credential",
2194            "file_location",
2195            "fileLocation",
2196        ];
2197
2198        #[allow(clippy::enum_variant_names)]
2199        enum GeneratedField {
2200            Columns,
2201            FileFormat,
2202            Credential,
2203            FileLocation,
2204        }
2205        impl<'de> serde::Deserialize<'de> for GeneratedField {
2206            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
2207            where
2208                D: serde::Deserializer<'de>,
2209            {
2210                struct GeneratedVisitor;
2211
2212                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2213                    type Value = GeneratedField;
2214
2215                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2216                        write!(formatter, "expected one of: {:?}", &FIELDS)
2217                    }
2218
2219                    #[allow(unused_variables)]
2220                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
2221                    where
2222                        E: serde::de::Error,
2223                    {
2224                        match value {
2225                            "columns" => Ok(GeneratedField::Columns),
2226                            "fileFormat" | "file_format" => Ok(GeneratedField::FileFormat),
2227                            "credential" => Ok(GeneratedField::Credential),
2228                            "fileLocation" | "file_location" => Ok(GeneratedField::FileLocation),
2229                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
2230                        }
2231                    }
2232                }
2233                deserializer.deserialize_identifier(GeneratedVisitor)
2234            }
2235        }
2236        struct GeneratedVisitor;
2237        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2238            type Value = GcsFileScanNode;
2239
2240            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2241                formatter.write_str("struct batch_plan.GcsFileScanNode")
2242            }
2243
2244            fn visit_map<V>(self, mut map_: V) -> std::result::Result<GcsFileScanNode, V::Error>
2245                where
2246                    V: serde::de::MapAccess<'de>,
2247            {
2248                let mut columns__ = None;
2249                let mut file_format__ = None;
2250                let mut credential__ = None;
2251                let mut file_location__ = None;
2252                while let Some(k) = map_.next_key()? {
2253                    match k {
2254                        GeneratedField::Columns => {
2255                            if columns__.is_some() {
2256                                return Err(serde::de::Error::duplicate_field("columns"));
2257                            }
2258                            columns__ = Some(map_.next_value()?);
2259                        }
2260                        GeneratedField::FileFormat => {
2261                            if file_format__.is_some() {
2262                                return Err(serde::de::Error::duplicate_field("fileFormat"));
2263                            }
2264                            file_format__ = Some(map_.next_value::<gcs_file_scan_node::FileFormat>()? as i32);
2265                        }
2266                        GeneratedField::Credential => {
2267                            if credential__.is_some() {
2268                                return Err(serde::de::Error::duplicate_field("credential"));
2269                            }
2270                            credential__ = Some(map_.next_value()?);
2271                        }
2272                        GeneratedField::FileLocation => {
2273                            if file_location__.is_some() {
2274                                return Err(serde::de::Error::duplicate_field("fileLocation"));
2275                            }
2276                            file_location__ = Some(map_.next_value()?);
2277                        }
2278                    }
2279                }
2280                Ok(GcsFileScanNode {
2281                    columns: columns__.unwrap_or_default(),
2282                    file_format: file_format__.unwrap_or_default(),
2283                    credential: credential__.unwrap_or_default(),
2284                    file_location: file_location__.unwrap_or_default(),
2285                })
2286            }
2287        }
2288        deserializer.deserialize_struct("batch_plan.GcsFileScanNode", FIELDS, GeneratedVisitor)
2289    }
2290}
2291impl serde::Serialize for gcs_file_scan_node::FileFormat {
2292    #[allow(deprecated)]
2293    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2294    where
2295        S: serde::Serializer,
2296    {
2297        let variant = match self {
2298            Self::Unspecified => "FILE_FORMAT_UNSPECIFIED",
2299            Self::Parquet => "PARQUET",
2300        };
2301        serializer.serialize_str(variant)
2302    }
2303}
2304impl<'de> serde::Deserialize<'de> for gcs_file_scan_node::FileFormat {
2305    #[allow(deprecated)]
2306    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2307    where
2308        D: serde::Deserializer<'de>,
2309    {
2310        const FIELDS: &[&str] = &[
2311            "FILE_FORMAT_UNSPECIFIED",
2312            "PARQUET",
2313        ];
2314
2315        struct GeneratedVisitor;
2316
2317        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2318            type Value = gcs_file_scan_node::FileFormat;
2319
2320            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2321                write!(formatter, "expected one of: {:?}", &FIELDS)
2322            }
2323
2324            fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
2325            where
2326                E: serde::de::Error,
2327            {
2328                i32::try_from(v)
2329                    .ok()
2330                    .and_then(|x| x.try_into().ok())
2331                    .ok_or_else(|| {
2332                        serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
2333                    })
2334            }
2335
2336            fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
2337            where
2338                E: serde::de::Error,
2339            {
2340                i32::try_from(v)
2341                    .ok()
2342                    .and_then(|x| x.try_into().ok())
2343                    .ok_or_else(|| {
2344                        serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
2345                    })
2346            }
2347
2348            fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2349            where
2350                E: serde::de::Error,
2351            {
2352                match value {
2353                    "FILE_FORMAT_UNSPECIFIED" => Ok(gcs_file_scan_node::FileFormat::Unspecified),
2354                    "PARQUET" => Ok(gcs_file_scan_node::FileFormat::Parquet),
2355                    _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
2356                }
2357            }
2358        }
2359        deserializer.deserialize_any(GeneratedVisitor)
2360    }
2361}
2362impl serde::Serialize for GroupTopNNode {
2363    #[allow(deprecated)]
2364    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2365    where
2366        S: serde::Serializer,
2367    {
2368        use serde::ser::SerializeStruct;
2369        let mut len = 0;
2370        if !self.column_orders.is_empty() {
2371            len += 1;
2372        }
2373        if self.limit != 0 {
2374            len += 1;
2375        }
2376        if self.offset != 0 {
2377            len += 1;
2378        }
2379        if !self.group_key.is_empty() {
2380            len += 1;
2381        }
2382        if self.with_ties {
2383            len += 1;
2384        }
2385        let mut struct_ser = serializer.serialize_struct("batch_plan.GroupTopNNode", len)?;
2386        if !self.column_orders.is_empty() {
2387            struct_ser.serialize_field("columnOrders", &self.column_orders)?;
2388        }
2389        if self.limit != 0 {
2390            #[allow(clippy::needless_borrow)]
2391            #[allow(clippy::needless_borrows_for_generic_args)]
2392            struct_ser.serialize_field("limit", ToString::to_string(&self.limit).as_str())?;
2393        }
2394        if self.offset != 0 {
2395            #[allow(clippy::needless_borrow)]
2396            #[allow(clippy::needless_borrows_for_generic_args)]
2397            struct_ser.serialize_field("offset", ToString::to_string(&self.offset).as_str())?;
2398        }
2399        if !self.group_key.is_empty() {
2400            struct_ser.serialize_field("groupKey", &self.group_key)?;
2401        }
2402        if self.with_ties {
2403            struct_ser.serialize_field("withTies", &self.with_ties)?;
2404        }
2405        struct_ser.end()
2406    }
2407}
2408impl<'de> serde::Deserialize<'de> for GroupTopNNode {
2409    #[allow(deprecated)]
2410    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2411    where
2412        D: serde::Deserializer<'de>,
2413    {
2414        const FIELDS: &[&str] = &[
2415            "column_orders",
2416            "columnOrders",
2417            "limit",
2418            "offset",
2419            "group_key",
2420            "groupKey",
2421            "with_ties",
2422            "withTies",
2423        ];
2424
2425        #[allow(clippy::enum_variant_names)]
2426        enum GeneratedField {
2427            ColumnOrders,
2428            Limit,
2429            Offset,
2430            GroupKey,
2431            WithTies,
2432        }
2433        impl<'de> serde::Deserialize<'de> for GeneratedField {
2434            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
2435            where
2436                D: serde::Deserializer<'de>,
2437            {
2438                struct GeneratedVisitor;
2439
2440                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2441                    type Value = GeneratedField;
2442
2443                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2444                        write!(formatter, "expected one of: {:?}", &FIELDS)
2445                    }
2446
2447                    #[allow(unused_variables)]
2448                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
2449                    where
2450                        E: serde::de::Error,
2451                    {
2452                        match value {
2453                            "columnOrders" | "column_orders" => Ok(GeneratedField::ColumnOrders),
2454                            "limit" => Ok(GeneratedField::Limit),
2455                            "offset" => Ok(GeneratedField::Offset),
2456                            "groupKey" | "group_key" => Ok(GeneratedField::GroupKey),
2457                            "withTies" | "with_ties" => Ok(GeneratedField::WithTies),
2458                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
2459                        }
2460                    }
2461                }
2462                deserializer.deserialize_identifier(GeneratedVisitor)
2463            }
2464        }
2465        struct GeneratedVisitor;
2466        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2467            type Value = GroupTopNNode;
2468
2469            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2470                formatter.write_str("struct batch_plan.GroupTopNNode")
2471            }
2472
2473            fn visit_map<V>(self, mut map_: V) -> std::result::Result<GroupTopNNode, V::Error>
2474                where
2475                    V: serde::de::MapAccess<'de>,
2476            {
2477                let mut column_orders__ = None;
2478                let mut limit__ = None;
2479                let mut offset__ = None;
2480                let mut group_key__ = None;
2481                let mut with_ties__ = None;
2482                while let Some(k) = map_.next_key()? {
2483                    match k {
2484                        GeneratedField::ColumnOrders => {
2485                            if column_orders__.is_some() {
2486                                return Err(serde::de::Error::duplicate_field("columnOrders"));
2487                            }
2488                            column_orders__ = Some(map_.next_value()?);
2489                        }
2490                        GeneratedField::Limit => {
2491                            if limit__.is_some() {
2492                                return Err(serde::de::Error::duplicate_field("limit"));
2493                            }
2494                            limit__ = 
2495                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
2496                            ;
2497                        }
2498                        GeneratedField::Offset => {
2499                            if offset__.is_some() {
2500                                return Err(serde::de::Error::duplicate_field("offset"));
2501                            }
2502                            offset__ = 
2503                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
2504                            ;
2505                        }
2506                        GeneratedField::GroupKey => {
2507                            if group_key__.is_some() {
2508                                return Err(serde::de::Error::duplicate_field("groupKey"));
2509                            }
2510                            group_key__ = 
2511                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
2512                                    .into_iter().map(|x| x.0).collect())
2513                            ;
2514                        }
2515                        GeneratedField::WithTies => {
2516                            if with_ties__.is_some() {
2517                                return Err(serde::de::Error::duplicate_field("withTies"));
2518                            }
2519                            with_ties__ = Some(map_.next_value()?);
2520                        }
2521                    }
2522                }
2523                Ok(GroupTopNNode {
2524                    column_orders: column_orders__.unwrap_or_default(),
2525                    limit: limit__.unwrap_or_default(),
2526                    offset: offset__.unwrap_or_default(),
2527                    group_key: group_key__.unwrap_or_default(),
2528                    with_ties: with_ties__.unwrap_or_default(),
2529                })
2530            }
2531        }
2532        deserializer.deserialize_struct("batch_plan.GroupTopNNode", FIELDS, GeneratedVisitor)
2533    }
2534}
2535impl serde::Serialize for HashAggNode {
2536    #[allow(deprecated)]
2537    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2538    where
2539        S: serde::Serializer,
2540    {
2541        use serde::ser::SerializeStruct;
2542        let mut len = 0;
2543        if !self.group_key.is_empty() {
2544            len += 1;
2545        }
2546        if !self.agg_calls.is_empty() {
2547            len += 1;
2548        }
2549        let mut struct_ser = serializer.serialize_struct("batch_plan.HashAggNode", len)?;
2550        if !self.group_key.is_empty() {
2551            struct_ser.serialize_field("groupKey", &self.group_key)?;
2552        }
2553        if !self.agg_calls.is_empty() {
2554            struct_ser.serialize_field("aggCalls", &self.agg_calls)?;
2555        }
2556        struct_ser.end()
2557    }
2558}
2559impl<'de> serde::Deserialize<'de> for HashAggNode {
2560    #[allow(deprecated)]
2561    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2562    where
2563        D: serde::Deserializer<'de>,
2564    {
2565        const FIELDS: &[&str] = &[
2566            "group_key",
2567            "groupKey",
2568            "agg_calls",
2569            "aggCalls",
2570        ];
2571
2572        #[allow(clippy::enum_variant_names)]
2573        enum GeneratedField {
2574            GroupKey,
2575            AggCalls,
2576        }
2577        impl<'de> serde::Deserialize<'de> for GeneratedField {
2578            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
2579            where
2580                D: serde::Deserializer<'de>,
2581            {
2582                struct GeneratedVisitor;
2583
2584                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2585                    type Value = GeneratedField;
2586
2587                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2588                        write!(formatter, "expected one of: {:?}", &FIELDS)
2589                    }
2590
2591                    #[allow(unused_variables)]
2592                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
2593                    where
2594                        E: serde::de::Error,
2595                    {
2596                        match value {
2597                            "groupKey" | "group_key" => Ok(GeneratedField::GroupKey),
2598                            "aggCalls" | "agg_calls" => Ok(GeneratedField::AggCalls),
2599                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
2600                        }
2601                    }
2602                }
2603                deserializer.deserialize_identifier(GeneratedVisitor)
2604            }
2605        }
2606        struct GeneratedVisitor;
2607        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2608            type Value = HashAggNode;
2609
2610            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2611                formatter.write_str("struct batch_plan.HashAggNode")
2612            }
2613
2614            fn visit_map<V>(self, mut map_: V) -> std::result::Result<HashAggNode, V::Error>
2615                where
2616                    V: serde::de::MapAccess<'de>,
2617            {
2618                let mut group_key__ = None;
2619                let mut agg_calls__ = None;
2620                while let Some(k) = map_.next_key()? {
2621                    match k {
2622                        GeneratedField::GroupKey => {
2623                            if group_key__.is_some() {
2624                                return Err(serde::de::Error::duplicate_field("groupKey"));
2625                            }
2626                            group_key__ = 
2627                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
2628                                    .into_iter().map(|x| x.0).collect())
2629                            ;
2630                        }
2631                        GeneratedField::AggCalls => {
2632                            if agg_calls__.is_some() {
2633                                return Err(serde::de::Error::duplicate_field("aggCalls"));
2634                            }
2635                            agg_calls__ = Some(map_.next_value()?);
2636                        }
2637                    }
2638                }
2639                Ok(HashAggNode {
2640                    group_key: group_key__.unwrap_or_default(),
2641                    agg_calls: agg_calls__.unwrap_or_default(),
2642                })
2643            }
2644        }
2645        deserializer.deserialize_struct("batch_plan.HashAggNode", FIELDS, GeneratedVisitor)
2646    }
2647}
2648impl serde::Serialize for HashJoinNode {
2649    #[allow(deprecated)]
2650    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2651    where
2652        S: serde::Serializer,
2653    {
2654        use serde::ser::SerializeStruct;
2655        let mut len = 0;
2656        if self.join_type != 0 {
2657            len += 1;
2658        }
2659        if !self.left_key.is_empty() {
2660            len += 1;
2661        }
2662        if !self.right_key.is_empty() {
2663            len += 1;
2664        }
2665        if self.condition.is_some() {
2666            len += 1;
2667        }
2668        if !self.output_indices.is_empty() {
2669            len += 1;
2670        }
2671        if !self.null_safe.is_empty() {
2672            len += 1;
2673        }
2674        if self.asof_desc.is_some() {
2675            len += 1;
2676        }
2677        let mut struct_ser = serializer.serialize_struct("batch_plan.HashJoinNode", len)?;
2678        if self.join_type != 0 {
2679            let v = super::plan_common::JoinType::try_from(self.join_type)
2680                .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.join_type)))?;
2681            struct_ser.serialize_field("joinType", &v)?;
2682        }
2683        if !self.left_key.is_empty() {
2684            struct_ser.serialize_field("leftKey", &self.left_key)?;
2685        }
2686        if !self.right_key.is_empty() {
2687            struct_ser.serialize_field("rightKey", &self.right_key)?;
2688        }
2689        if let Some(v) = self.condition.as_ref() {
2690            struct_ser.serialize_field("condition", v)?;
2691        }
2692        if !self.output_indices.is_empty() {
2693            struct_ser.serialize_field("outputIndices", &self.output_indices)?;
2694        }
2695        if !self.null_safe.is_empty() {
2696            struct_ser.serialize_field("nullSafe", &self.null_safe)?;
2697        }
2698        if let Some(v) = self.asof_desc.as_ref() {
2699            struct_ser.serialize_field("asofDesc", v)?;
2700        }
2701        struct_ser.end()
2702    }
2703}
2704impl<'de> serde::Deserialize<'de> for HashJoinNode {
2705    #[allow(deprecated)]
2706    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2707    where
2708        D: serde::Deserializer<'de>,
2709    {
2710        const FIELDS: &[&str] = &[
2711            "join_type",
2712            "joinType",
2713            "left_key",
2714            "leftKey",
2715            "right_key",
2716            "rightKey",
2717            "condition",
2718            "output_indices",
2719            "outputIndices",
2720            "null_safe",
2721            "nullSafe",
2722            "asof_desc",
2723            "asofDesc",
2724        ];
2725
2726        #[allow(clippy::enum_variant_names)]
2727        enum GeneratedField {
2728            JoinType,
2729            LeftKey,
2730            RightKey,
2731            Condition,
2732            OutputIndices,
2733            NullSafe,
2734            AsofDesc,
2735        }
2736        impl<'de> serde::Deserialize<'de> for GeneratedField {
2737            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
2738            where
2739                D: serde::Deserializer<'de>,
2740            {
2741                struct GeneratedVisitor;
2742
2743                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2744                    type Value = GeneratedField;
2745
2746                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2747                        write!(formatter, "expected one of: {:?}", &FIELDS)
2748                    }
2749
2750                    #[allow(unused_variables)]
2751                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
2752                    where
2753                        E: serde::de::Error,
2754                    {
2755                        match value {
2756                            "joinType" | "join_type" => Ok(GeneratedField::JoinType),
2757                            "leftKey" | "left_key" => Ok(GeneratedField::LeftKey),
2758                            "rightKey" | "right_key" => Ok(GeneratedField::RightKey),
2759                            "condition" => Ok(GeneratedField::Condition),
2760                            "outputIndices" | "output_indices" => Ok(GeneratedField::OutputIndices),
2761                            "nullSafe" | "null_safe" => Ok(GeneratedField::NullSafe),
2762                            "asofDesc" | "asof_desc" => Ok(GeneratedField::AsofDesc),
2763                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
2764                        }
2765                    }
2766                }
2767                deserializer.deserialize_identifier(GeneratedVisitor)
2768            }
2769        }
2770        struct GeneratedVisitor;
2771        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2772            type Value = HashJoinNode;
2773
2774            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2775                formatter.write_str("struct batch_plan.HashJoinNode")
2776            }
2777
2778            fn visit_map<V>(self, mut map_: V) -> std::result::Result<HashJoinNode, V::Error>
2779                where
2780                    V: serde::de::MapAccess<'de>,
2781            {
2782                let mut join_type__ = None;
2783                let mut left_key__ = None;
2784                let mut right_key__ = None;
2785                let mut condition__ = None;
2786                let mut output_indices__ = None;
2787                let mut null_safe__ = None;
2788                let mut asof_desc__ = None;
2789                while let Some(k) = map_.next_key()? {
2790                    match k {
2791                        GeneratedField::JoinType => {
2792                            if join_type__.is_some() {
2793                                return Err(serde::de::Error::duplicate_field("joinType"));
2794                            }
2795                            join_type__ = Some(map_.next_value::<super::plan_common::JoinType>()? as i32);
2796                        }
2797                        GeneratedField::LeftKey => {
2798                            if left_key__.is_some() {
2799                                return Err(serde::de::Error::duplicate_field("leftKey"));
2800                            }
2801                            left_key__ = 
2802                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
2803                                    .into_iter().map(|x| x.0).collect())
2804                            ;
2805                        }
2806                        GeneratedField::RightKey => {
2807                            if right_key__.is_some() {
2808                                return Err(serde::de::Error::duplicate_field("rightKey"));
2809                            }
2810                            right_key__ = 
2811                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
2812                                    .into_iter().map(|x| x.0).collect())
2813                            ;
2814                        }
2815                        GeneratedField::Condition => {
2816                            if condition__.is_some() {
2817                                return Err(serde::de::Error::duplicate_field("condition"));
2818                            }
2819                            condition__ = map_.next_value()?;
2820                        }
2821                        GeneratedField::OutputIndices => {
2822                            if output_indices__.is_some() {
2823                                return Err(serde::de::Error::duplicate_field("outputIndices"));
2824                            }
2825                            output_indices__ = 
2826                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
2827                                    .into_iter().map(|x| x.0).collect())
2828                            ;
2829                        }
2830                        GeneratedField::NullSafe => {
2831                            if null_safe__.is_some() {
2832                                return Err(serde::de::Error::duplicate_field("nullSafe"));
2833                            }
2834                            null_safe__ = Some(map_.next_value()?);
2835                        }
2836                        GeneratedField::AsofDesc => {
2837                            if asof_desc__.is_some() {
2838                                return Err(serde::de::Error::duplicate_field("asofDesc"));
2839                            }
2840                            asof_desc__ = map_.next_value()?;
2841                        }
2842                    }
2843                }
2844                Ok(HashJoinNode {
2845                    join_type: join_type__.unwrap_or_default(),
2846                    left_key: left_key__.unwrap_or_default(),
2847                    right_key: right_key__.unwrap_or_default(),
2848                    condition: condition__,
2849                    output_indices: output_indices__.unwrap_or_default(),
2850                    null_safe: null_safe__.unwrap_or_default(),
2851                    asof_desc: asof_desc__,
2852                })
2853            }
2854        }
2855        deserializer.deserialize_struct("batch_plan.HashJoinNode", FIELDS, GeneratedVisitor)
2856    }
2857}
2858impl serde::Serialize for HopWindowNode {
2859    #[allow(deprecated)]
2860    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2861    where
2862        S: serde::Serializer,
2863    {
2864        use serde::ser::SerializeStruct;
2865        let mut len = 0;
2866        if self.time_col != 0 {
2867            len += 1;
2868        }
2869        if self.window_slide.is_some() {
2870            len += 1;
2871        }
2872        if self.window_size.is_some() {
2873            len += 1;
2874        }
2875        if !self.output_indices.is_empty() {
2876            len += 1;
2877        }
2878        if !self.window_start_exprs.is_empty() {
2879            len += 1;
2880        }
2881        if !self.window_end_exprs.is_empty() {
2882            len += 1;
2883        }
2884        let mut struct_ser = serializer.serialize_struct("batch_plan.HopWindowNode", len)?;
2885        if self.time_col != 0 {
2886            struct_ser.serialize_field("timeCol", &self.time_col)?;
2887        }
2888        if let Some(v) = self.window_slide.as_ref() {
2889            struct_ser.serialize_field("windowSlide", v)?;
2890        }
2891        if let Some(v) = self.window_size.as_ref() {
2892            struct_ser.serialize_field("windowSize", v)?;
2893        }
2894        if !self.output_indices.is_empty() {
2895            struct_ser.serialize_field("outputIndices", &self.output_indices)?;
2896        }
2897        if !self.window_start_exprs.is_empty() {
2898            struct_ser.serialize_field("windowStartExprs", &self.window_start_exprs)?;
2899        }
2900        if !self.window_end_exprs.is_empty() {
2901            struct_ser.serialize_field("windowEndExprs", &self.window_end_exprs)?;
2902        }
2903        struct_ser.end()
2904    }
2905}
2906impl<'de> serde::Deserialize<'de> for HopWindowNode {
2907    #[allow(deprecated)]
2908    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2909    where
2910        D: serde::Deserializer<'de>,
2911    {
2912        const FIELDS: &[&str] = &[
2913            "time_col",
2914            "timeCol",
2915            "window_slide",
2916            "windowSlide",
2917            "window_size",
2918            "windowSize",
2919            "output_indices",
2920            "outputIndices",
2921            "window_start_exprs",
2922            "windowStartExprs",
2923            "window_end_exprs",
2924            "windowEndExprs",
2925        ];
2926
2927        #[allow(clippy::enum_variant_names)]
2928        enum GeneratedField {
2929            TimeCol,
2930            WindowSlide,
2931            WindowSize,
2932            OutputIndices,
2933            WindowStartExprs,
2934            WindowEndExprs,
2935        }
2936        impl<'de> serde::Deserialize<'de> for GeneratedField {
2937            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
2938            where
2939                D: serde::Deserializer<'de>,
2940            {
2941                struct GeneratedVisitor;
2942
2943                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2944                    type Value = GeneratedField;
2945
2946                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2947                        write!(formatter, "expected one of: {:?}", &FIELDS)
2948                    }
2949
2950                    #[allow(unused_variables)]
2951                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
2952                    where
2953                        E: serde::de::Error,
2954                    {
2955                        match value {
2956                            "timeCol" | "time_col" => Ok(GeneratedField::TimeCol),
2957                            "windowSlide" | "window_slide" => Ok(GeneratedField::WindowSlide),
2958                            "windowSize" | "window_size" => Ok(GeneratedField::WindowSize),
2959                            "outputIndices" | "output_indices" => Ok(GeneratedField::OutputIndices),
2960                            "windowStartExprs" | "window_start_exprs" => Ok(GeneratedField::WindowStartExprs),
2961                            "windowEndExprs" | "window_end_exprs" => Ok(GeneratedField::WindowEndExprs),
2962                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
2963                        }
2964                    }
2965                }
2966                deserializer.deserialize_identifier(GeneratedVisitor)
2967            }
2968        }
2969        struct GeneratedVisitor;
2970        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2971            type Value = HopWindowNode;
2972
2973            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2974                formatter.write_str("struct batch_plan.HopWindowNode")
2975            }
2976
2977            fn visit_map<V>(self, mut map_: V) -> std::result::Result<HopWindowNode, V::Error>
2978                where
2979                    V: serde::de::MapAccess<'de>,
2980            {
2981                let mut time_col__ = None;
2982                let mut window_slide__ = None;
2983                let mut window_size__ = None;
2984                let mut output_indices__ = None;
2985                let mut window_start_exprs__ = None;
2986                let mut window_end_exprs__ = None;
2987                while let Some(k) = map_.next_key()? {
2988                    match k {
2989                        GeneratedField::TimeCol => {
2990                            if time_col__.is_some() {
2991                                return Err(serde::de::Error::duplicate_field("timeCol"));
2992                            }
2993                            time_col__ = 
2994                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
2995                            ;
2996                        }
2997                        GeneratedField::WindowSlide => {
2998                            if window_slide__.is_some() {
2999                                return Err(serde::de::Error::duplicate_field("windowSlide"));
3000                            }
3001                            window_slide__ = map_.next_value()?;
3002                        }
3003                        GeneratedField::WindowSize => {
3004                            if window_size__.is_some() {
3005                                return Err(serde::de::Error::duplicate_field("windowSize"));
3006                            }
3007                            window_size__ = map_.next_value()?;
3008                        }
3009                        GeneratedField::OutputIndices => {
3010                            if output_indices__.is_some() {
3011                                return Err(serde::de::Error::duplicate_field("outputIndices"));
3012                            }
3013                            output_indices__ = 
3014                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
3015                                    .into_iter().map(|x| x.0).collect())
3016                            ;
3017                        }
3018                        GeneratedField::WindowStartExprs => {
3019                            if window_start_exprs__.is_some() {
3020                                return Err(serde::de::Error::duplicate_field("windowStartExprs"));
3021                            }
3022                            window_start_exprs__ = Some(map_.next_value()?);
3023                        }
3024                        GeneratedField::WindowEndExprs => {
3025                            if window_end_exprs__.is_some() {
3026                                return Err(serde::de::Error::duplicate_field("windowEndExprs"));
3027                            }
3028                            window_end_exprs__ = Some(map_.next_value()?);
3029                        }
3030                    }
3031                }
3032                Ok(HopWindowNode {
3033                    time_col: time_col__.unwrap_or_default(),
3034                    window_slide: window_slide__,
3035                    window_size: window_size__,
3036                    output_indices: output_indices__.unwrap_or_default(),
3037                    window_start_exprs: window_start_exprs__.unwrap_or_default(),
3038                    window_end_exprs: window_end_exprs__.unwrap_or_default(),
3039                })
3040            }
3041        }
3042        deserializer.deserialize_struct("batch_plan.HopWindowNode", FIELDS, GeneratedVisitor)
3043    }
3044}
3045impl serde::Serialize for IcebergScanNode {
3046    #[allow(deprecated)]
3047    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3048    where
3049        S: serde::Serializer,
3050    {
3051        use serde::ser::SerializeStruct;
3052        let mut len = 0;
3053        if !self.columns.is_empty() {
3054            len += 1;
3055        }
3056        if !self.with_properties.is_empty() {
3057            len += 1;
3058        }
3059        if !self.split.is_empty() {
3060            len += 1;
3061        }
3062        if !self.secret_refs.is_empty() {
3063            len += 1;
3064        }
3065        if self.iceberg_scan_type != 0 {
3066            len += 1;
3067        }
3068        let mut struct_ser = serializer.serialize_struct("batch_plan.IcebergScanNode", len)?;
3069        if !self.columns.is_empty() {
3070            struct_ser.serialize_field("columns", &self.columns)?;
3071        }
3072        if !self.with_properties.is_empty() {
3073            struct_ser.serialize_field("withProperties", &self.with_properties)?;
3074        }
3075        if !self.split.is_empty() {
3076            struct_ser.serialize_field("split", &self.split.iter().map(pbjson::private::base64::encode).collect::<Vec<_>>())?;
3077        }
3078        if !self.secret_refs.is_empty() {
3079            struct_ser.serialize_field("secretRefs", &self.secret_refs)?;
3080        }
3081        if self.iceberg_scan_type != 0 {
3082            let v = iceberg_scan_node::IcebergScanType::try_from(self.iceberg_scan_type)
3083                .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.iceberg_scan_type)))?;
3084            struct_ser.serialize_field("icebergScanType", &v)?;
3085        }
3086        struct_ser.end()
3087    }
3088}
3089impl<'de> serde::Deserialize<'de> for IcebergScanNode {
3090    #[allow(deprecated)]
3091    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3092    where
3093        D: serde::Deserializer<'de>,
3094    {
3095        const FIELDS: &[&str] = &[
3096            "columns",
3097            "with_properties",
3098            "withProperties",
3099            "split",
3100            "secret_refs",
3101            "secretRefs",
3102            "iceberg_scan_type",
3103            "icebergScanType",
3104        ];
3105
3106        #[allow(clippy::enum_variant_names)]
3107        enum GeneratedField {
3108            Columns,
3109            WithProperties,
3110            Split,
3111            SecretRefs,
3112            IcebergScanType,
3113        }
3114        impl<'de> serde::Deserialize<'de> for GeneratedField {
3115            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
3116            where
3117                D: serde::Deserializer<'de>,
3118            {
3119                struct GeneratedVisitor;
3120
3121                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3122                    type Value = GeneratedField;
3123
3124                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3125                        write!(formatter, "expected one of: {:?}", &FIELDS)
3126                    }
3127
3128                    #[allow(unused_variables)]
3129                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
3130                    where
3131                        E: serde::de::Error,
3132                    {
3133                        match value {
3134                            "columns" => Ok(GeneratedField::Columns),
3135                            "withProperties" | "with_properties" => Ok(GeneratedField::WithProperties),
3136                            "split" => Ok(GeneratedField::Split),
3137                            "secretRefs" | "secret_refs" => Ok(GeneratedField::SecretRefs),
3138                            "icebergScanType" | "iceberg_scan_type" => Ok(GeneratedField::IcebergScanType),
3139                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
3140                        }
3141                    }
3142                }
3143                deserializer.deserialize_identifier(GeneratedVisitor)
3144            }
3145        }
3146        struct GeneratedVisitor;
3147        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3148            type Value = IcebergScanNode;
3149
3150            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3151                formatter.write_str("struct batch_plan.IcebergScanNode")
3152            }
3153
3154            fn visit_map<V>(self, mut map_: V) -> std::result::Result<IcebergScanNode, V::Error>
3155                where
3156                    V: serde::de::MapAccess<'de>,
3157            {
3158                let mut columns__ = None;
3159                let mut with_properties__ = None;
3160                let mut split__ = None;
3161                let mut secret_refs__ = None;
3162                let mut iceberg_scan_type__ = None;
3163                while let Some(k) = map_.next_key()? {
3164                    match k {
3165                        GeneratedField::Columns => {
3166                            if columns__.is_some() {
3167                                return Err(serde::de::Error::duplicate_field("columns"));
3168                            }
3169                            columns__ = Some(map_.next_value()?);
3170                        }
3171                        GeneratedField::WithProperties => {
3172                            if with_properties__.is_some() {
3173                                return Err(serde::de::Error::duplicate_field("withProperties"));
3174                            }
3175                            with_properties__ = Some(
3176                                map_.next_value::<std::collections::BTreeMap<_, _>>()?
3177                            );
3178                        }
3179                        GeneratedField::Split => {
3180                            if split__.is_some() {
3181                                return Err(serde::de::Error::duplicate_field("split"));
3182                            }
3183                            split__ = 
3184                                Some(map_.next_value::<Vec<::pbjson::private::BytesDeserialize<_>>>()?
3185                                    .into_iter().map(|x| x.0).collect())
3186                            ;
3187                        }
3188                        GeneratedField::SecretRefs => {
3189                            if secret_refs__.is_some() {
3190                                return Err(serde::de::Error::duplicate_field("secretRefs"));
3191                            }
3192                            secret_refs__ = Some(
3193                                map_.next_value::<std::collections::BTreeMap<_, _>>()?
3194                            );
3195                        }
3196                        GeneratedField::IcebergScanType => {
3197                            if iceberg_scan_type__.is_some() {
3198                                return Err(serde::de::Error::duplicate_field("icebergScanType"));
3199                            }
3200                            iceberg_scan_type__ = Some(map_.next_value::<iceberg_scan_node::IcebergScanType>()? as i32);
3201                        }
3202                    }
3203                }
3204                Ok(IcebergScanNode {
3205                    columns: columns__.unwrap_or_default(),
3206                    with_properties: with_properties__.unwrap_or_default(),
3207                    split: split__.unwrap_or_default(),
3208                    secret_refs: secret_refs__.unwrap_or_default(),
3209                    iceberg_scan_type: iceberg_scan_type__.unwrap_or_default(),
3210                })
3211            }
3212        }
3213        deserializer.deserialize_struct("batch_plan.IcebergScanNode", FIELDS, GeneratedVisitor)
3214    }
3215}
3216impl serde::Serialize for iceberg_scan_node::IcebergScanType {
3217    #[allow(deprecated)]
3218    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3219    where
3220        S: serde::Serializer,
3221    {
3222        let variant = match self {
3223            Self::Unspecified => "ICEBERG_SCAN_TYPE_UNSPECIFIED",
3224            Self::DataScan => "ICEBERG_SCAN_TYPE_DATA_SCAN",
3225            Self::EqualityDeleteScan => "ICEBERG_SCAN_TYPE_EQUALITY_DELETE_SCAN",
3226            Self::PositionDeleteScan => "ICEBERG_SCAN_TYPE_POSITION_DELETE_SCAN",
3227            Self::CountStar => "ICEBERG_SCAN_TYPE_COUNT_STAR",
3228        };
3229        serializer.serialize_str(variant)
3230    }
3231}
3232impl<'de> serde::Deserialize<'de> for iceberg_scan_node::IcebergScanType {
3233    #[allow(deprecated)]
3234    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3235    where
3236        D: serde::Deserializer<'de>,
3237    {
3238        const FIELDS: &[&str] = &[
3239            "ICEBERG_SCAN_TYPE_UNSPECIFIED",
3240            "ICEBERG_SCAN_TYPE_DATA_SCAN",
3241            "ICEBERG_SCAN_TYPE_EQUALITY_DELETE_SCAN",
3242            "ICEBERG_SCAN_TYPE_POSITION_DELETE_SCAN",
3243            "ICEBERG_SCAN_TYPE_COUNT_STAR",
3244        ];
3245
3246        struct GeneratedVisitor;
3247
3248        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3249            type Value = iceberg_scan_node::IcebergScanType;
3250
3251            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3252                write!(formatter, "expected one of: {:?}", &FIELDS)
3253            }
3254
3255            fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
3256            where
3257                E: serde::de::Error,
3258            {
3259                i32::try_from(v)
3260                    .ok()
3261                    .and_then(|x| x.try_into().ok())
3262                    .ok_or_else(|| {
3263                        serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
3264                    })
3265            }
3266
3267            fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
3268            where
3269                E: serde::de::Error,
3270            {
3271                i32::try_from(v)
3272                    .ok()
3273                    .and_then(|x| x.try_into().ok())
3274                    .ok_or_else(|| {
3275                        serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
3276                    })
3277            }
3278
3279            fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3280            where
3281                E: serde::de::Error,
3282            {
3283                match value {
3284                    "ICEBERG_SCAN_TYPE_UNSPECIFIED" => Ok(iceberg_scan_node::IcebergScanType::Unspecified),
3285                    "ICEBERG_SCAN_TYPE_DATA_SCAN" => Ok(iceberg_scan_node::IcebergScanType::DataScan),
3286                    "ICEBERG_SCAN_TYPE_EQUALITY_DELETE_SCAN" => Ok(iceberg_scan_node::IcebergScanType::EqualityDeleteScan),
3287                    "ICEBERG_SCAN_TYPE_POSITION_DELETE_SCAN" => Ok(iceberg_scan_node::IcebergScanType::PositionDeleteScan),
3288                    "ICEBERG_SCAN_TYPE_COUNT_STAR" => Ok(iceberg_scan_node::IcebergScanType::CountStar),
3289                    _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
3290                }
3291            }
3292        }
3293        deserializer.deserialize_any(GeneratedVisitor)
3294    }
3295}
3296impl serde::Serialize for InsertNode {
3297    #[allow(deprecated)]
3298    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3299    where
3300        S: serde::Serializer,
3301    {
3302        use serde::ser::SerializeStruct;
3303        let mut len = 0;
3304        if self.table_id != 0 {
3305            len += 1;
3306        }
3307        if self.table_version_id != 0 {
3308            len += 1;
3309        }
3310        if !self.column_indices.is_empty() {
3311            len += 1;
3312        }
3313        if self.default_columns.is_some() {
3314            len += 1;
3315        }
3316        if self.row_id_index.is_some() {
3317            len += 1;
3318        }
3319        if self.returning {
3320            len += 1;
3321        }
3322        if self.session_id != 0 {
3323            len += 1;
3324        }
3325        let mut struct_ser = serializer.serialize_struct("batch_plan.InsertNode", len)?;
3326        if self.table_id != 0 {
3327            struct_ser.serialize_field("tableId", &self.table_id)?;
3328        }
3329        if self.table_version_id != 0 {
3330            #[allow(clippy::needless_borrow)]
3331            #[allow(clippy::needless_borrows_for_generic_args)]
3332            struct_ser.serialize_field("tableVersionId", ToString::to_string(&self.table_version_id).as_str())?;
3333        }
3334        if !self.column_indices.is_empty() {
3335            struct_ser.serialize_field("columnIndices", &self.column_indices)?;
3336        }
3337        if let Some(v) = self.default_columns.as_ref() {
3338            struct_ser.serialize_field("defaultColumns", v)?;
3339        }
3340        if let Some(v) = self.row_id_index.as_ref() {
3341            struct_ser.serialize_field("rowIdIndex", v)?;
3342        }
3343        if self.returning {
3344            struct_ser.serialize_field("returning", &self.returning)?;
3345        }
3346        if self.session_id != 0 {
3347            struct_ser.serialize_field("sessionId", &self.session_id)?;
3348        }
3349        struct_ser.end()
3350    }
3351}
3352impl<'de> serde::Deserialize<'de> for InsertNode {
3353    #[allow(deprecated)]
3354    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3355    where
3356        D: serde::Deserializer<'de>,
3357    {
3358        const FIELDS: &[&str] = &[
3359            "table_id",
3360            "tableId",
3361            "table_version_id",
3362            "tableVersionId",
3363            "column_indices",
3364            "columnIndices",
3365            "default_columns",
3366            "defaultColumns",
3367            "row_id_index",
3368            "rowIdIndex",
3369            "returning",
3370            "session_id",
3371            "sessionId",
3372        ];
3373
3374        #[allow(clippy::enum_variant_names)]
3375        enum GeneratedField {
3376            TableId,
3377            TableVersionId,
3378            ColumnIndices,
3379            DefaultColumns,
3380            RowIdIndex,
3381            Returning,
3382            SessionId,
3383        }
3384        impl<'de> serde::Deserialize<'de> for GeneratedField {
3385            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
3386            where
3387                D: serde::Deserializer<'de>,
3388            {
3389                struct GeneratedVisitor;
3390
3391                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3392                    type Value = GeneratedField;
3393
3394                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3395                        write!(formatter, "expected one of: {:?}", &FIELDS)
3396                    }
3397
3398                    #[allow(unused_variables)]
3399                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
3400                    where
3401                        E: serde::de::Error,
3402                    {
3403                        match value {
3404                            "tableId" | "table_id" => Ok(GeneratedField::TableId),
3405                            "tableVersionId" | "table_version_id" => Ok(GeneratedField::TableVersionId),
3406                            "columnIndices" | "column_indices" => Ok(GeneratedField::ColumnIndices),
3407                            "defaultColumns" | "default_columns" => Ok(GeneratedField::DefaultColumns),
3408                            "rowIdIndex" | "row_id_index" => Ok(GeneratedField::RowIdIndex),
3409                            "returning" => Ok(GeneratedField::Returning),
3410                            "sessionId" | "session_id" => Ok(GeneratedField::SessionId),
3411                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
3412                        }
3413                    }
3414                }
3415                deserializer.deserialize_identifier(GeneratedVisitor)
3416            }
3417        }
3418        struct GeneratedVisitor;
3419        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3420            type Value = InsertNode;
3421
3422            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3423                formatter.write_str("struct batch_plan.InsertNode")
3424            }
3425
3426            fn visit_map<V>(self, mut map_: V) -> std::result::Result<InsertNode, V::Error>
3427                where
3428                    V: serde::de::MapAccess<'de>,
3429            {
3430                let mut table_id__ = None;
3431                let mut table_version_id__ = None;
3432                let mut column_indices__ = None;
3433                let mut default_columns__ = None;
3434                let mut row_id_index__ = None;
3435                let mut returning__ = None;
3436                let mut session_id__ = None;
3437                while let Some(k) = map_.next_key()? {
3438                    match k {
3439                        GeneratedField::TableId => {
3440                            if table_id__.is_some() {
3441                                return Err(serde::de::Error::duplicate_field("tableId"));
3442                            }
3443                            table_id__ = 
3444                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
3445                            ;
3446                        }
3447                        GeneratedField::TableVersionId => {
3448                            if table_version_id__.is_some() {
3449                                return Err(serde::de::Error::duplicate_field("tableVersionId"));
3450                            }
3451                            table_version_id__ = 
3452                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
3453                            ;
3454                        }
3455                        GeneratedField::ColumnIndices => {
3456                            if column_indices__.is_some() {
3457                                return Err(serde::de::Error::duplicate_field("columnIndices"));
3458                            }
3459                            column_indices__ = 
3460                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
3461                                    .into_iter().map(|x| x.0).collect())
3462                            ;
3463                        }
3464                        GeneratedField::DefaultColumns => {
3465                            if default_columns__.is_some() {
3466                                return Err(serde::de::Error::duplicate_field("defaultColumns"));
3467                            }
3468                            default_columns__ = map_.next_value()?;
3469                        }
3470                        GeneratedField::RowIdIndex => {
3471                            if row_id_index__.is_some() {
3472                                return Err(serde::de::Error::duplicate_field("rowIdIndex"));
3473                            }
3474                            row_id_index__ = 
3475                                map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
3476                            ;
3477                        }
3478                        GeneratedField::Returning => {
3479                            if returning__.is_some() {
3480                                return Err(serde::de::Error::duplicate_field("returning"));
3481                            }
3482                            returning__ = Some(map_.next_value()?);
3483                        }
3484                        GeneratedField::SessionId => {
3485                            if session_id__.is_some() {
3486                                return Err(serde::de::Error::duplicate_field("sessionId"));
3487                            }
3488                            session_id__ = 
3489                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
3490                            ;
3491                        }
3492                    }
3493                }
3494                Ok(InsertNode {
3495                    table_id: table_id__.unwrap_or_default(),
3496                    table_version_id: table_version_id__.unwrap_or_default(),
3497                    column_indices: column_indices__.unwrap_or_default(),
3498                    default_columns: default_columns__,
3499                    row_id_index: row_id_index__,
3500                    returning: returning__.unwrap_or_default(),
3501                    session_id: session_id__.unwrap_or_default(),
3502                })
3503            }
3504        }
3505        deserializer.deserialize_struct("batch_plan.InsertNode", FIELDS, GeneratedVisitor)
3506    }
3507}
3508impl serde::Serialize for LimitNode {
3509    #[allow(deprecated)]
3510    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3511    where
3512        S: serde::Serializer,
3513    {
3514        use serde::ser::SerializeStruct;
3515        let mut len = 0;
3516        if self.limit != 0 {
3517            len += 1;
3518        }
3519        if self.offset != 0 {
3520            len += 1;
3521        }
3522        let mut struct_ser = serializer.serialize_struct("batch_plan.LimitNode", len)?;
3523        if self.limit != 0 {
3524            #[allow(clippy::needless_borrow)]
3525            #[allow(clippy::needless_borrows_for_generic_args)]
3526            struct_ser.serialize_field("limit", ToString::to_string(&self.limit).as_str())?;
3527        }
3528        if self.offset != 0 {
3529            #[allow(clippy::needless_borrow)]
3530            #[allow(clippy::needless_borrows_for_generic_args)]
3531            struct_ser.serialize_field("offset", ToString::to_string(&self.offset).as_str())?;
3532        }
3533        struct_ser.end()
3534    }
3535}
3536impl<'de> serde::Deserialize<'de> for LimitNode {
3537    #[allow(deprecated)]
3538    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3539    where
3540        D: serde::Deserializer<'de>,
3541    {
3542        const FIELDS: &[&str] = &[
3543            "limit",
3544            "offset",
3545        ];
3546
3547        #[allow(clippy::enum_variant_names)]
3548        enum GeneratedField {
3549            Limit,
3550            Offset,
3551        }
3552        impl<'de> serde::Deserialize<'de> for GeneratedField {
3553            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
3554            where
3555                D: serde::Deserializer<'de>,
3556            {
3557                struct GeneratedVisitor;
3558
3559                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3560                    type Value = GeneratedField;
3561
3562                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3563                        write!(formatter, "expected one of: {:?}", &FIELDS)
3564                    }
3565
3566                    #[allow(unused_variables)]
3567                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
3568                    where
3569                        E: serde::de::Error,
3570                    {
3571                        match value {
3572                            "limit" => Ok(GeneratedField::Limit),
3573                            "offset" => Ok(GeneratedField::Offset),
3574                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
3575                        }
3576                    }
3577                }
3578                deserializer.deserialize_identifier(GeneratedVisitor)
3579            }
3580        }
3581        struct GeneratedVisitor;
3582        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3583            type Value = LimitNode;
3584
3585            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3586                formatter.write_str("struct batch_plan.LimitNode")
3587            }
3588
3589            fn visit_map<V>(self, mut map_: V) -> std::result::Result<LimitNode, V::Error>
3590                where
3591                    V: serde::de::MapAccess<'de>,
3592            {
3593                let mut limit__ = None;
3594                let mut offset__ = None;
3595                while let Some(k) = map_.next_key()? {
3596                    match k {
3597                        GeneratedField::Limit => {
3598                            if limit__.is_some() {
3599                                return Err(serde::de::Error::duplicate_field("limit"));
3600                            }
3601                            limit__ = 
3602                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
3603                            ;
3604                        }
3605                        GeneratedField::Offset => {
3606                            if offset__.is_some() {
3607                                return Err(serde::de::Error::duplicate_field("offset"));
3608                            }
3609                            offset__ = 
3610                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
3611                            ;
3612                        }
3613                    }
3614                }
3615                Ok(LimitNode {
3616                    limit: limit__.unwrap_or_default(),
3617                    offset: offset__.unwrap_or_default(),
3618                })
3619            }
3620        }
3621        deserializer.deserialize_struct("batch_plan.LimitNode", FIELDS, GeneratedVisitor)
3622    }
3623}
3624impl serde::Serialize for LocalExecutePlan {
3625    #[allow(deprecated)]
3626    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3627    where
3628        S: serde::Serializer,
3629    {
3630        use serde::ser::SerializeStruct;
3631        let mut len = 0;
3632        if self.plan.is_some() {
3633            len += 1;
3634        }
3635        if self.epoch.is_some() {
3636            len += 1;
3637        }
3638        if !self.tracing_context.is_empty() {
3639            len += 1;
3640        }
3641        let mut struct_ser = serializer.serialize_struct("batch_plan.LocalExecutePlan", len)?;
3642        if let Some(v) = self.plan.as_ref() {
3643            struct_ser.serialize_field("plan", v)?;
3644        }
3645        if let Some(v) = self.epoch.as_ref() {
3646            struct_ser.serialize_field("epoch", v)?;
3647        }
3648        if !self.tracing_context.is_empty() {
3649            struct_ser.serialize_field("tracingContext", &self.tracing_context)?;
3650        }
3651        struct_ser.end()
3652    }
3653}
3654impl<'de> serde::Deserialize<'de> for LocalExecutePlan {
3655    #[allow(deprecated)]
3656    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3657    where
3658        D: serde::Deserializer<'de>,
3659    {
3660        const FIELDS: &[&str] = &[
3661            "plan",
3662            "epoch",
3663            "tracing_context",
3664            "tracingContext",
3665        ];
3666
3667        #[allow(clippy::enum_variant_names)]
3668        enum GeneratedField {
3669            Plan,
3670            Epoch,
3671            TracingContext,
3672        }
3673        impl<'de> serde::Deserialize<'de> for GeneratedField {
3674            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
3675            where
3676                D: serde::Deserializer<'de>,
3677            {
3678                struct GeneratedVisitor;
3679
3680                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3681                    type Value = GeneratedField;
3682
3683                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3684                        write!(formatter, "expected one of: {:?}", &FIELDS)
3685                    }
3686
3687                    #[allow(unused_variables)]
3688                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
3689                    where
3690                        E: serde::de::Error,
3691                    {
3692                        match value {
3693                            "plan" => Ok(GeneratedField::Plan),
3694                            "epoch" => Ok(GeneratedField::Epoch),
3695                            "tracingContext" | "tracing_context" => Ok(GeneratedField::TracingContext),
3696                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
3697                        }
3698                    }
3699                }
3700                deserializer.deserialize_identifier(GeneratedVisitor)
3701            }
3702        }
3703        struct GeneratedVisitor;
3704        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3705            type Value = LocalExecutePlan;
3706
3707            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3708                formatter.write_str("struct batch_plan.LocalExecutePlan")
3709            }
3710
3711            fn visit_map<V>(self, mut map_: V) -> std::result::Result<LocalExecutePlan, V::Error>
3712                where
3713                    V: serde::de::MapAccess<'de>,
3714            {
3715                let mut plan__ = None;
3716                let mut epoch__ = None;
3717                let mut tracing_context__ = None;
3718                while let Some(k) = map_.next_key()? {
3719                    match k {
3720                        GeneratedField::Plan => {
3721                            if plan__.is_some() {
3722                                return Err(serde::de::Error::duplicate_field("plan"));
3723                            }
3724                            plan__ = map_.next_value()?;
3725                        }
3726                        GeneratedField::Epoch => {
3727                            if epoch__.is_some() {
3728                                return Err(serde::de::Error::duplicate_field("epoch"));
3729                            }
3730                            epoch__ = map_.next_value()?;
3731                        }
3732                        GeneratedField::TracingContext => {
3733                            if tracing_context__.is_some() {
3734                                return Err(serde::de::Error::duplicate_field("tracingContext"));
3735                            }
3736                            tracing_context__ = Some(
3737                                map_.next_value::<std::collections::HashMap<_, _>>()?
3738                            );
3739                        }
3740                    }
3741                }
3742                Ok(LocalExecutePlan {
3743                    plan: plan__,
3744                    epoch: epoch__,
3745                    tracing_context: tracing_context__.unwrap_or_default(),
3746                })
3747            }
3748        }
3749        deserializer.deserialize_struct("batch_plan.LocalExecutePlan", FIELDS, GeneratedVisitor)
3750    }
3751}
3752impl serde::Serialize for LocalLookupJoinNode {
3753    #[allow(deprecated)]
3754    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3755    where
3756        S: serde::Serializer,
3757    {
3758        use serde::ser::SerializeStruct;
3759        let mut len = 0;
3760        if self.join_type != 0 {
3761            len += 1;
3762        }
3763        if self.condition.is_some() {
3764            len += 1;
3765        }
3766        if !self.outer_side_key.is_empty() {
3767            len += 1;
3768        }
3769        if !self.inner_side_key.is_empty() {
3770            len += 1;
3771        }
3772        if self.lookup_prefix_len != 0 {
3773            len += 1;
3774        }
3775        if self.inner_side_table_desc.is_some() {
3776            len += 1;
3777        }
3778        if !self.inner_side_vnode_mapping.is_empty() {
3779            len += 1;
3780        }
3781        if !self.inner_side_column_ids.is_empty() {
3782            len += 1;
3783        }
3784        if !self.output_indices.is_empty() {
3785            len += 1;
3786        }
3787        if !self.worker_nodes.is_empty() {
3788            len += 1;
3789        }
3790        if !self.null_safe.is_empty() {
3791            len += 1;
3792        }
3793        if self.as_of.is_some() {
3794            len += 1;
3795        }
3796        if self.asof_desc.is_some() {
3797            len += 1;
3798        }
3799        let mut struct_ser = serializer.serialize_struct("batch_plan.LocalLookupJoinNode", len)?;
3800        if self.join_type != 0 {
3801            let v = super::plan_common::JoinType::try_from(self.join_type)
3802                .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.join_type)))?;
3803            struct_ser.serialize_field("joinType", &v)?;
3804        }
3805        if let Some(v) = self.condition.as_ref() {
3806            struct_ser.serialize_field("condition", v)?;
3807        }
3808        if !self.outer_side_key.is_empty() {
3809            struct_ser.serialize_field("outerSideKey", &self.outer_side_key)?;
3810        }
3811        if !self.inner_side_key.is_empty() {
3812            struct_ser.serialize_field("innerSideKey", &self.inner_side_key)?;
3813        }
3814        if self.lookup_prefix_len != 0 {
3815            struct_ser.serialize_field("lookupPrefixLen", &self.lookup_prefix_len)?;
3816        }
3817        if let Some(v) = self.inner_side_table_desc.as_ref() {
3818            struct_ser.serialize_field("innerSideTableDesc", v)?;
3819        }
3820        if !self.inner_side_vnode_mapping.is_empty() {
3821            struct_ser.serialize_field("innerSideVnodeMapping", &self.inner_side_vnode_mapping.iter().map(ToString::to_string).collect::<Vec<_>>())?;
3822        }
3823        if !self.inner_side_column_ids.is_empty() {
3824            struct_ser.serialize_field("innerSideColumnIds", &self.inner_side_column_ids)?;
3825        }
3826        if !self.output_indices.is_empty() {
3827            struct_ser.serialize_field("outputIndices", &self.output_indices)?;
3828        }
3829        if !self.worker_nodes.is_empty() {
3830            struct_ser.serialize_field("workerNodes", &self.worker_nodes)?;
3831        }
3832        if !self.null_safe.is_empty() {
3833            struct_ser.serialize_field("nullSafe", &self.null_safe)?;
3834        }
3835        if let Some(v) = self.as_of.as_ref() {
3836            struct_ser.serialize_field("asOf", v)?;
3837        }
3838        if let Some(v) = self.asof_desc.as_ref() {
3839            struct_ser.serialize_field("asofDesc", v)?;
3840        }
3841        struct_ser.end()
3842    }
3843}
3844impl<'de> serde::Deserialize<'de> for LocalLookupJoinNode {
3845    #[allow(deprecated)]
3846    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3847    where
3848        D: serde::Deserializer<'de>,
3849    {
3850        const FIELDS: &[&str] = &[
3851            "join_type",
3852            "joinType",
3853            "condition",
3854            "outer_side_key",
3855            "outerSideKey",
3856            "inner_side_key",
3857            "innerSideKey",
3858            "lookup_prefix_len",
3859            "lookupPrefixLen",
3860            "inner_side_table_desc",
3861            "innerSideTableDesc",
3862            "inner_side_vnode_mapping",
3863            "innerSideVnodeMapping",
3864            "inner_side_column_ids",
3865            "innerSideColumnIds",
3866            "output_indices",
3867            "outputIndices",
3868            "worker_nodes",
3869            "workerNodes",
3870            "null_safe",
3871            "nullSafe",
3872            "as_of",
3873            "asOf",
3874            "asof_desc",
3875            "asofDesc",
3876        ];
3877
3878        #[allow(clippy::enum_variant_names)]
3879        enum GeneratedField {
3880            JoinType,
3881            Condition,
3882            OuterSideKey,
3883            InnerSideKey,
3884            LookupPrefixLen,
3885            InnerSideTableDesc,
3886            InnerSideVnodeMapping,
3887            InnerSideColumnIds,
3888            OutputIndices,
3889            WorkerNodes,
3890            NullSafe,
3891            AsOf,
3892            AsofDesc,
3893        }
3894        impl<'de> serde::Deserialize<'de> for GeneratedField {
3895            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
3896            where
3897                D: serde::Deserializer<'de>,
3898            {
3899                struct GeneratedVisitor;
3900
3901                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3902                    type Value = GeneratedField;
3903
3904                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3905                        write!(formatter, "expected one of: {:?}", &FIELDS)
3906                    }
3907
3908                    #[allow(unused_variables)]
3909                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
3910                    where
3911                        E: serde::de::Error,
3912                    {
3913                        match value {
3914                            "joinType" | "join_type" => Ok(GeneratedField::JoinType),
3915                            "condition" => Ok(GeneratedField::Condition),
3916                            "outerSideKey" | "outer_side_key" => Ok(GeneratedField::OuterSideKey),
3917                            "innerSideKey" | "inner_side_key" => Ok(GeneratedField::InnerSideKey),
3918                            "lookupPrefixLen" | "lookup_prefix_len" => Ok(GeneratedField::LookupPrefixLen),
3919                            "innerSideTableDesc" | "inner_side_table_desc" => Ok(GeneratedField::InnerSideTableDesc),
3920                            "innerSideVnodeMapping" | "inner_side_vnode_mapping" => Ok(GeneratedField::InnerSideVnodeMapping),
3921                            "innerSideColumnIds" | "inner_side_column_ids" => Ok(GeneratedField::InnerSideColumnIds),
3922                            "outputIndices" | "output_indices" => Ok(GeneratedField::OutputIndices),
3923                            "workerNodes" | "worker_nodes" => Ok(GeneratedField::WorkerNodes),
3924                            "nullSafe" | "null_safe" => Ok(GeneratedField::NullSafe),
3925                            "asOf" | "as_of" => Ok(GeneratedField::AsOf),
3926                            "asofDesc" | "asof_desc" => Ok(GeneratedField::AsofDesc),
3927                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
3928                        }
3929                    }
3930                }
3931                deserializer.deserialize_identifier(GeneratedVisitor)
3932            }
3933        }
3934        struct GeneratedVisitor;
3935        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3936            type Value = LocalLookupJoinNode;
3937
3938            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3939                formatter.write_str("struct batch_plan.LocalLookupJoinNode")
3940            }
3941
3942            fn visit_map<V>(self, mut map_: V) -> std::result::Result<LocalLookupJoinNode, V::Error>
3943                where
3944                    V: serde::de::MapAccess<'de>,
3945            {
3946                let mut join_type__ = None;
3947                let mut condition__ = None;
3948                let mut outer_side_key__ = None;
3949                let mut inner_side_key__ = None;
3950                let mut lookup_prefix_len__ = None;
3951                let mut inner_side_table_desc__ = None;
3952                let mut inner_side_vnode_mapping__ = None;
3953                let mut inner_side_column_ids__ = None;
3954                let mut output_indices__ = None;
3955                let mut worker_nodes__ = None;
3956                let mut null_safe__ = None;
3957                let mut as_of__ = None;
3958                let mut asof_desc__ = None;
3959                while let Some(k) = map_.next_key()? {
3960                    match k {
3961                        GeneratedField::JoinType => {
3962                            if join_type__.is_some() {
3963                                return Err(serde::de::Error::duplicate_field("joinType"));
3964                            }
3965                            join_type__ = Some(map_.next_value::<super::plan_common::JoinType>()? as i32);
3966                        }
3967                        GeneratedField::Condition => {
3968                            if condition__.is_some() {
3969                                return Err(serde::de::Error::duplicate_field("condition"));
3970                            }
3971                            condition__ = map_.next_value()?;
3972                        }
3973                        GeneratedField::OuterSideKey => {
3974                            if outer_side_key__.is_some() {
3975                                return Err(serde::de::Error::duplicate_field("outerSideKey"));
3976                            }
3977                            outer_side_key__ = 
3978                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
3979                                    .into_iter().map(|x| x.0).collect())
3980                            ;
3981                        }
3982                        GeneratedField::InnerSideKey => {
3983                            if inner_side_key__.is_some() {
3984                                return Err(serde::de::Error::duplicate_field("innerSideKey"));
3985                            }
3986                            inner_side_key__ = 
3987                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
3988                                    .into_iter().map(|x| x.0).collect())
3989                            ;
3990                        }
3991                        GeneratedField::LookupPrefixLen => {
3992                            if lookup_prefix_len__.is_some() {
3993                                return Err(serde::de::Error::duplicate_field("lookupPrefixLen"));
3994                            }
3995                            lookup_prefix_len__ = 
3996                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
3997                            ;
3998                        }
3999                        GeneratedField::InnerSideTableDesc => {
4000                            if inner_side_table_desc__.is_some() {
4001                                return Err(serde::de::Error::duplicate_field("innerSideTableDesc"));
4002                            }
4003                            inner_side_table_desc__ = map_.next_value()?;
4004                        }
4005                        GeneratedField::InnerSideVnodeMapping => {
4006                            if inner_side_vnode_mapping__.is_some() {
4007                                return Err(serde::de::Error::duplicate_field("innerSideVnodeMapping"));
4008                            }
4009                            inner_side_vnode_mapping__ = 
4010                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
4011                                    .into_iter().map(|x| x.0).collect())
4012                            ;
4013                        }
4014                        GeneratedField::InnerSideColumnIds => {
4015                            if inner_side_column_ids__.is_some() {
4016                                return Err(serde::de::Error::duplicate_field("innerSideColumnIds"));
4017                            }
4018                            inner_side_column_ids__ = 
4019                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
4020                                    .into_iter().map(|x| x.0).collect())
4021                            ;
4022                        }
4023                        GeneratedField::OutputIndices => {
4024                            if output_indices__.is_some() {
4025                                return Err(serde::de::Error::duplicate_field("outputIndices"));
4026                            }
4027                            output_indices__ = 
4028                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
4029                                    .into_iter().map(|x| x.0).collect())
4030                            ;
4031                        }
4032                        GeneratedField::WorkerNodes => {
4033                            if worker_nodes__.is_some() {
4034                                return Err(serde::de::Error::duplicate_field("workerNodes"));
4035                            }
4036                            worker_nodes__ = Some(map_.next_value()?);
4037                        }
4038                        GeneratedField::NullSafe => {
4039                            if null_safe__.is_some() {
4040                                return Err(serde::de::Error::duplicate_field("nullSafe"));
4041                            }
4042                            null_safe__ = Some(map_.next_value()?);
4043                        }
4044                        GeneratedField::AsOf => {
4045                            if as_of__.is_some() {
4046                                return Err(serde::de::Error::duplicate_field("asOf"));
4047                            }
4048                            as_of__ = map_.next_value()?;
4049                        }
4050                        GeneratedField::AsofDesc => {
4051                            if asof_desc__.is_some() {
4052                                return Err(serde::de::Error::duplicate_field("asofDesc"));
4053                            }
4054                            asof_desc__ = map_.next_value()?;
4055                        }
4056                    }
4057                }
4058                Ok(LocalLookupJoinNode {
4059                    join_type: join_type__.unwrap_or_default(),
4060                    condition: condition__,
4061                    outer_side_key: outer_side_key__.unwrap_or_default(),
4062                    inner_side_key: inner_side_key__.unwrap_or_default(),
4063                    lookup_prefix_len: lookup_prefix_len__.unwrap_or_default(),
4064                    inner_side_table_desc: inner_side_table_desc__,
4065                    inner_side_vnode_mapping: inner_side_vnode_mapping__.unwrap_or_default(),
4066                    inner_side_column_ids: inner_side_column_ids__.unwrap_or_default(),
4067                    output_indices: output_indices__.unwrap_or_default(),
4068                    worker_nodes: worker_nodes__.unwrap_or_default(),
4069                    null_safe: null_safe__.unwrap_or_default(),
4070                    as_of: as_of__,
4071                    asof_desc: asof_desc__,
4072                })
4073            }
4074        }
4075        deserializer.deserialize_struct("batch_plan.LocalLookupJoinNode", FIELDS, GeneratedVisitor)
4076    }
4077}
4078impl serde::Serialize for LogRowSeqScanNode {
4079    #[allow(deprecated)]
4080    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4081    where
4082        S: serde::Serializer,
4083    {
4084        use serde::ser::SerializeStruct;
4085        let mut len = 0;
4086        if self.table_desc.is_some() {
4087            len += 1;
4088        }
4089        if !self.column_ids.is_empty() {
4090            len += 1;
4091        }
4092        if self.vnode_bitmap.is_some() {
4093            len += 1;
4094        }
4095        if self.old_epoch.is_some() {
4096            len += 1;
4097        }
4098        if self.new_epoch.is_some() {
4099            len += 1;
4100        }
4101        if self.ordered {
4102            len += 1;
4103        }
4104        let mut struct_ser = serializer.serialize_struct("batch_plan.LogRowSeqScanNode", len)?;
4105        if let Some(v) = self.table_desc.as_ref() {
4106            struct_ser.serialize_field("tableDesc", v)?;
4107        }
4108        if !self.column_ids.is_empty() {
4109            struct_ser.serialize_field("columnIds", &self.column_ids)?;
4110        }
4111        if let Some(v) = self.vnode_bitmap.as_ref() {
4112            struct_ser.serialize_field("vnodeBitmap", v)?;
4113        }
4114        if let Some(v) = self.old_epoch.as_ref() {
4115            struct_ser.serialize_field("oldEpoch", v)?;
4116        }
4117        if let Some(v) = self.new_epoch.as_ref() {
4118            struct_ser.serialize_field("newEpoch", v)?;
4119        }
4120        if self.ordered {
4121            struct_ser.serialize_field("ordered", &self.ordered)?;
4122        }
4123        struct_ser.end()
4124    }
4125}
4126impl<'de> serde::Deserialize<'de> for LogRowSeqScanNode {
4127    #[allow(deprecated)]
4128    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4129    where
4130        D: serde::Deserializer<'de>,
4131    {
4132        const FIELDS: &[&str] = &[
4133            "table_desc",
4134            "tableDesc",
4135            "column_ids",
4136            "columnIds",
4137            "vnode_bitmap",
4138            "vnodeBitmap",
4139            "old_epoch",
4140            "oldEpoch",
4141            "new_epoch",
4142            "newEpoch",
4143            "ordered",
4144        ];
4145
4146        #[allow(clippy::enum_variant_names)]
4147        enum GeneratedField {
4148            TableDesc,
4149            ColumnIds,
4150            VnodeBitmap,
4151            OldEpoch,
4152            NewEpoch,
4153            Ordered,
4154        }
4155        impl<'de> serde::Deserialize<'de> for GeneratedField {
4156            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
4157            where
4158                D: serde::Deserializer<'de>,
4159            {
4160                struct GeneratedVisitor;
4161
4162                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
4163                    type Value = GeneratedField;
4164
4165                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4166                        write!(formatter, "expected one of: {:?}", &FIELDS)
4167                    }
4168
4169                    #[allow(unused_variables)]
4170                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
4171                    where
4172                        E: serde::de::Error,
4173                    {
4174                        match value {
4175                            "tableDesc" | "table_desc" => Ok(GeneratedField::TableDesc),
4176                            "columnIds" | "column_ids" => Ok(GeneratedField::ColumnIds),
4177                            "vnodeBitmap" | "vnode_bitmap" => Ok(GeneratedField::VnodeBitmap),
4178                            "oldEpoch" | "old_epoch" => Ok(GeneratedField::OldEpoch),
4179                            "newEpoch" | "new_epoch" => Ok(GeneratedField::NewEpoch),
4180                            "ordered" => Ok(GeneratedField::Ordered),
4181                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
4182                        }
4183                    }
4184                }
4185                deserializer.deserialize_identifier(GeneratedVisitor)
4186            }
4187        }
4188        struct GeneratedVisitor;
4189        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
4190            type Value = LogRowSeqScanNode;
4191
4192            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4193                formatter.write_str("struct batch_plan.LogRowSeqScanNode")
4194            }
4195
4196            fn visit_map<V>(self, mut map_: V) -> std::result::Result<LogRowSeqScanNode, V::Error>
4197                where
4198                    V: serde::de::MapAccess<'de>,
4199            {
4200                let mut table_desc__ = None;
4201                let mut column_ids__ = None;
4202                let mut vnode_bitmap__ = None;
4203                let mut old_epoch__ = None;
4204                let mut new_epoch__ = None;
4205                let mut ordered__ = None;
4206                while let Some(k) = map_.next_key()? {
4207                    match k {
4208                        GeneratedField::TableDesc => {
4209                            if table_desc__.is_some() {
4210                                return Err(serde::de::Error::duplicate_field("tableDesc"));
4211                            }
4212                            table_desc__ = map_.next_value()?;
4213                        }
4214                        GeneratedField::ColumnIds => {
4215                            if column_ids__.is_some() {
4216                                return Err(serde::de::Error::duplicate_field("columnIds"));
4217                            }
4218                            column_ids__ = 
4219                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
4220                                    .into_iter().map(|x| x.0).collect())
4221                            ;
4222                        }
4223                        GeneratedField::VnodeBitmap => {
4224                            if vnode_bitmap__.is_some() {
4225                                return Err(serde::de::Error::duplicate_field("vnodeBitmap"));
4226                            }
4227                            vnode_bitmap__ = map_.next_value()?;
4228                        }
4229                        GeneratedField::OldEpoch => {
4230                            if old_epoch__.is_some() {
4231                                return Err(serde::de::Error::duplicate_field("oldEpoch"));
4232                            }
4233                            old_epoch__ = map_.next_value()?;
4234                        }
4235                        GeneratedField::NewEpoch => {
4236                            if new_epoch__.is_some() {
4237                                return Err(serde::de::Error::duplicate_field("newEpoch"));
4238                            }
4239                            new_epoch__ = map_.next_value()?;
4240                        }
4241                        GeneratedField::Ordered => {
4242                            if ordered__.is_some() {
4243                                return Err(serde::de::Error::duplicate_field("ordered"));
4244                            }
4245                            ordered__ = Some(map_.next_value()?);
4246                        }
4247                    }
4248                }
4249                Ok(LogRowSeqScanNode {
4250                    table_desc: table_desc__,
4251                    column_ids: column_ids__.unwrap_or_default(),
4252                    vnode_bitmap: vnode_bitmap__,
4253                    old_epoch: old_epoch__,
4254                    new_epoch: new_epoch__,
4255                    ordered: ordered__.unwrap_or_default(),
4256                })
4257            }
4258        }
4259        deserializer.deserialize_struct("batch_plan.LogRowSeqScanNode", FIELDS, GeneratedVisitor)
4260    }
4261}
4262impl serde::Serialize for MaxOneRowNode {
4263    #[allow(deprecated)]
4264    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4265    where
4266        S: serde::Serializer,
4267    {
4268        use serde::ser::SerializeStruct;
4269        let len = 0;
4270        let struct_ser = serializer.serialize_struct("batch_plan.MaxOneRowNode", len)?;
4271        struct_ser.end()
4272    }
4273}
4274impl<'de> serde::Deserialize<'de> for MaxOneRowNode {
4275    #[allow(deprecated)]
4276    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4277    where
4278        D: serde::Deserializer<'de>,
4279    {
4280        const FIELDS: &[&str] = &[
4281        ];
4282
4283        #[allow(clippy::enum_variant_names)]
4284        enum GeneratedField {
4285        }
4286        impl<'de> serde::Deserialize<'de> for GeneratedField {
4287            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
4288            where
4289                D: serde::Deserializer<'de>,
4290            {
4291                struct GeneratedVisitor;
4292
4293                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
4294                    type Value = GeneratedField;
4295
4296                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4297                        write!(formatter, "expected one of: {:?}", &FIELDS)
4298                    }
4299
4300                    #[allow(unused_variables)]
4301                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
4302                    where
4303                        E: serde::de::Error,
4304                    {
4305                            Err(serde::de::Error::unknown_field(value, FIELDS))
4306                    }
4307                }
4308                deserializer.deserialize_identifier(GeneratedVisitor)
4309            }
4310        }
4311        struct GeneratedVisitor;
4312        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
4313            type Value = MaxOneRowNode;
4314
4315            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4316                formatter.write_str("struct batch_plan.MaxOneRowNode")
4317            }
4318
4319            fn visit_map<V>(self, mut map_: V) -> std::result::Result<MaxOneRowNode, V::Error>
4320                where
4321                    V: serde::de::MapAccess<'de>,
4322            {
4323                while map_.next_key::<GeneratedField>()?.is_some() {
4324                    let _ = map_.next_value::<serde::de::IgnoredAny>()?;
4325                }
4326                Ok(MaxOneRowNode {
4327                })
4328            }
4329        }
4330        deserializer.deserialize_struct("batch_plan.MaxOneRowNode", FIELDS, GeneratedVisitor)
4331    }
4332}
4333impl serde::Serialize for MergeSortExchangeNode {
4334    #[allow(deprecated)]
4335    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4336    where
4337        S: serde::Serializer,
4338    {
4339        use serde::ser::SerializeStruct;
4340        let mut len = 0;
4341        if self.exchange.is_some() {
4342            len += 1;
4343        }
4344        if !self.column_orders.is_empty() {
4345            len += 1;
4346        }
4347        let mut struct_ser = serializer.serialize_struct("batch_plan.MergeSortExchangeNode", len)?;
4348        if let Some(v) = self.exchange.as_ref() {
4349            struct_ser.serialize_field("exchange", v)?;
4350        }
4351        if !self.column_orders.is_empty() {
4352            struct_ser.serialize_field("columnOrders", &self.column_orders)?;
4353        }
4354        struct_ser.end()
4355    }
4356}
4357impl<'de> serde::Deserialize<'de> for MergeSortExchangeNode {
4358    #[allow(deprecated)]
4359    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4360    where
4361        D: serde::Deserializer<'de>,
4362    {
4363        const FIELDS: &[&str] = &[
4364            "exchange",
4365            "column_orders",
4366            "columnOrders",
4367        ];
4368
4369        #[allow(clippy::enum_variant_names)]
4370        enum GeneratedField {
4371            Exchange,
4372            ColumnOrders,
4373        }
4374        impl<'de> serde::Deserialize<'de> for GeneratedField {
4375            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
4376            where
4377                D: serde::Deserializer<'de>,
4378            {
4379                struct GeneratedVisitor;
4380
4381                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
4382                    type Value = GeneratedField;
4383
4384                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4385                        write!(formatter, "expected one of: {:?}", &FIELDS)
4386                    }
4387
4388                    #[allow(unused_variables)]
4389                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
4390                    where
4391                        E: serde::de::Error,
4392                    {
4393                        match value {
4394                            "exchange" => Ok(GeneratedField::Exchange),
4395                            "columnOrders" | "column_orders" => Ok(GeneratedField::ColumnOrders),
4396                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
4397                        }
4398                    }
4399                }
4400                deserializer.deserialize_identifier(GeneratedVisitor)
4401            }
4402        }
4403        struct GeneratedVisitor;
4404        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
4405            type Value = MergeSortExchangeNode;
4406
4407            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4408                formatter.write_str("struct batch_plan.MergeSortExchangeNode")
4409            }
4410
4411            fn visit_map<V>(self, mut map_: V) -> std::result::Result<MergeSortExchangeNode, V::Error>
4412                where
4413                    V: serde::de::MapAccess<'de>,
4414            {
4415                let mut exchange__ = None;
4416                let mut column_orders__ = None;
4417                while let Some(k) = map_.next_key()? {
4418                    match k {
4419                        GeneratedField::Exchange => {
4420                            if exchange__.is_some() {
4421                                return Err(serde::de::Error::duplicate_field("exchange"));
4422                            }
4423                            exchange__ = map_.next_value()?;
4424                        }
4425                        GeneratedField::ColumnOrders => {
4426                            if column_orders__.is_some() {
4427                                return Err(serde::de::Error::duplicate_field("columnOrders"));
4428                            }
4429                            column_orders__ = Some(map_.next_value()?);
4430                        }
4431                    }
4432                }
4433                Ok(MergeSortExchangeNode {
4434                    exchange: exchange__,
4435                    column_orders: column_orders__.unwrap_or_default(),
4436                })
4437            }
4438        }
4439        deserializer.deserialize_struct("batch_plan.MergeSortExchangeNode", FIELDS, GeneratedVisitor)
4440    }
4441}
4442impl serde::Serialize for MySqlQueryNode {
4443    #[allow(deprecated)]
4444    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4445    where
4446        S: serde::Serializer,
4447    {
4448        use serde::ser::SerializeStruct;
4449        let mut len = 0;
4450        if !self.columns.is_empty() {
4451            len += 1;
4452        }
4453        if !self.hostname.is_empty() {
4454            len += 1;
4455        }
4456        if !self.port.is_empty() {
4457            len += 1;
4458        }
4459        if !self.username.is_empty() {
4460            len += 1;
4461        }
4462        if !self.password.is_empty() {
4463            len += 1;
4464        }
4465        if !self.database.is_empty() {
4466            len += 1;
4467        }
4468        if !self.query.is_empty() {
4469            len += 1;
4470        }
4471        let mut struct_ser = serializer.serialize_struct("batch_plan.MySqlQueryNode", len)?;
4472        if !self.columns.is_empty() {
4473            struct_ser.serialize_field("columns", &self.columns)?;
4474        }
4475        if !self.hostname.is_empty() {
4476            struct_ser.serialize_field("hostname", &self.hostname)?;
4477        }
4478        if !self.port.is_empty() {
4479            struct_ser.serialize_field("port", &self.port)?;
4480        }
4481        if !self.username.is_empty() {
4482            struct_ser.serialize_field("username", &self.username)?;
4483        }
4484        if !self.password.is_empty() {
4485            struct_ser.serialize_field("password", &self.password)?;
4486        }
4487        if !self.database.is_empty() {
4488            struct_ser.serialize_field("database", &self.database)?;
4489        }
4490        if !self.query.is_empty() {
4491            struct_ser.serialize_field("query", &self.query)?;
4492        }
4493        struct_ser.end()
4494    }
4495}
4496impl<'de> serde::Deserialize<'de> for MySqlQueryNode {
4497    #[allow(deprecated)]
4498    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4499    where
4500        D: serde::Deserializer<'de>,
4501    {
4502        const FIELDS: &[&str] = &[
4503            "columns",
4504            "hostname",
4505            "port",
4506            "username",
4507            "password",
4508            "database",
4509            "query",
4510        ];
4511
4512        #[allow(clippy::enum_variant_names)]
4513        enum GeneratedField {
4514            Columns,
4515            Hostname,
4516            Port,
4517            Username,
4518            Password,
4519            Database,
4520            Query,
4521        }
4522        impl<'de> serde::Deserialize<'de> for GeneratedField {
4523            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
4524            where
4525                D: serde::Deserializer<'de>,
4526            {
4527                struct GeneratedVisitor;
4528
4529                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
4530                    type Value = GeneratedField;
4531
4532                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4533                        write!(formatter, "expected one of: {:?}", &FIELDS)
4534                    }
4535
4536                    #[allow(unused_variables)]
4537                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
4538                    where
4539                        E: serde::de::Error,
4540                    {
4541                        match value {
4542                            "columns" => Ok(GeneratedField::Columns),
4543                            "hostname" => Ok(GeneratedField::Hostname),
4544                            "port" => Ok(GeneratedField::Port),
4545                            "username" => Ok(GeneratedField::Username),
4546                            "password" => Ok(GeneratedField::Password),
4547                            "database" => Ok(GeneratedField::Database),
4548                            "query" => Ok(GeneratedField::Query),
4549                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
4550                        }
4551                    }
4552                }
4553                deserializer.deserialize_identifier(GeneratedVisitor)
4554            }
4555        }
4556        struct GeneratedVisitor;
4557        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
4558            type Value = MySqlQueryNode;
4559
4560            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4561                formatter.write_str("struct batch_plan.MySqlQueryNode")
4562            }
4563
4564            fn visit_map<V>(self, mut map_: V) -> std::result::Result<MySqlQueryNode, V::Error>
4565                where
4566                    V: serde::de::MapAccess<'de>,
4567            {
4568                let mut columns__ = None;
4569                let mut hostname__ = None;
4570                let mut port__ = None;
4571                let mut username__ = None;
4572                let mut password__ = None;
4573                let mut database__ = None;
4574                let mut query__ = None;
4575                while let Some(k) = map_.next_key()? {
4576                    match k {
4577                        GeneratedField::Columns => {
4578                            if columns__.is_some() {
4579                                return Err(serde::de::Error::duplicate_field("columns"));
4580                            }
4581                            columns__ = Some(map_.next_value()?);
4582                        }
4583                        GeneratedField::Hostname => {
4584                            if hostname__.is_some() {
4585                                return Err(serde::de::Error::duplicate_field("hostname"));
4586                            }
4587                            hostname__ = Some(map_.next_value()?);
4588                        }
4589                        GeneratedField::Port => {
4590                            if port__.is_some() {
4591                                return Err(serde::de::Error::duplicate_field("port"));
4592                            }
4593                            port__ = Some(map_.next_value()?);
4594                        }
4595                        GeneratedField::Username => {
4596                            if username__.is_some() {
4597                                return Err(serde::de::Error::duplicate_field("username"));
4598                            }
4599                            username__ = Some(map_.next_value()?);
4600                        }
4601                        GeneratedField::Password => {
4602                            if password__.is_some() {
4603                                return Err(serde::de::Error::duplicate_field("password"));
4604                            }
4605                            password__ = Some(map_.next_value()?);
4606                        }
4607                        GeneratedField::Database => {
4608                            if database__.is_some() {
4609                                return Err(serde::de::Error::duplicate_field("database"));
4610                            }
4611                            database__ = Some(map_.next_value()?);
4612                        }
4613                        GeneratedField::Query => {
4614                            if query__.is_some() {
4615                                return Err(serde::de::Error::duplicate_field("query"));
4616                            }
4617                            query__ = Some(map_.next_value()?);
4618                        }
4619                    }
4620                }
4621                Ok(MySqlQueryNode {
4622                    columns: columns__.unwrap_or_default(),
4623                    hostname: hostname__.unwrap_or_default(),
4624                    port: port__.unwrap_or_default(),
4625                    username: username__.unwrap_or_default(),
4626                    password: password__.unwrap_or_default(),
4627                    database: database__.unwrap_or_default(),
4628                    query: query__.unwrap_or_default(),
4629                })
4630            }
4631        }
4632        deserializer.deserialize_struct("batch_plan.MySqlQueryNode", FIELDS, GeneratedVisitor)
4633    }
4634}
4635impl serde::Serialize for NestedLoopJoinNode {
4636    #[allow(deprecated)]
4637    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4638    where
4639        S: serde::Serializer,
4640    {
4641        use serde::ser::SerializeStruct;
4642        let mut len = 0;
4643        if self.join_type != 0 {
4644            len += 1;
4645        }
4646        if self.join_cond.is_some() {
4647            len += 1;
4648        }
4649        if !self.output_indices.is_empty() {
4650            len += 1;
4651        }
4652        let mut struct_ser = serializer.serialize_struct("batch_plan.NestedLoopJoinNode", len)?;
4653        if self.join_type != 0 {
4654            let v = super::plan_common::JoinType::try_from(self.join_type)
4655                .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.join_type)))?;
4656            struct_ser.serialize_field("joinType", &v)?;
4657        }
4658        if let Some(v) = self.join_cond.as_ref() {
4659            struct_ser.serialize_field("joinCond", v)?;
4660        }
4661        if !self.output_indices.is_empty() {
4662            struct_ser.serialize_field("outputIndices", &self.output_indices)?;
4663        }
4664        struct_ser.end()
4665    }
4666}
4667impl<'de> serde::Deserialize<'de> for NestedLoopJoinNode {
4668    #[allow(deprecated)]
4669    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4670    where
4671        D: serde::Deserializer<'de>,
4672    {
4673        const FIELDS: &[&str] = &[
4674            "join_type",
4675            "joinType",
4676            "join_cond",
4677            "joinCond",
4678            "output_indices",
4679            "outputIndices",
4680        ];
4681
4682        #[allow(clippy::enum_variant_names)]
4683        enum GeneratedField {
4684            JoinType,
4685            JoinCond,
4686            OutputIndices,
4687        }
4688        impl<'de> serde::Deserialize<'de> for GeneratedField {
4689            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
4690            where
4691                D: serde::Deserializer<'de>,
4692            {
4693                struct GeneratedVisitor;
4694
4695                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
4696                    type Value = GeneratedField;
4697
4698                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4699                        write!(formatter, "expected one of: {:?}", &FIELDS)
4700                    }
4701
4702                    #[allow(unused_variables)]
4703                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
4704                    where
4705                        E: serde::de::Error,
4706                    {
4707                        match value {
4708                            "joinType" | "join_type" => Ok(GeneratedField::JoinType),
4709                            "joinCond" | "join_cond" => Ok(GeneratedField::JoinCond),
4710                            "outputIndices" | "output_indices" => Ok(GeneratedField::OutputIndices),
4711                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
4712                        }
4713                    }
4714                }
4715                deserializer.deserialize_identifier(GeneratedVisitor)
4716            }
4717        }
4718        struct GeneratedVisitor;
4719        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
4720            type Value = NestedLoopJoinNode;
4721
4722            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4723                formatter.write_str("struct batch_plan.NestedLoopJoinNode")
4724            }
4725
4726            fn visit_map<V>(self, mut map_: V) -> std::result::Result<NestedLoopJoinNode, V::Error>
4727                where
4728                    V: serde::de::MapAccess<'de>,
4729            {
4730                let mut join_type__ = None;
4731                let mut join_cond__ = None;
4732                let mut output_indices__ = None;
4733                while let Some(k) = map_.next_key()? {
4734                    match k {
4735                        GeneratedField::JoinType => {
4736                            if join_type__.is_some() {
4737                                return Err(serde::de::Error::duplicate_field("joinType"));
4738                            }
4739                            join_type__ = Some(map_.next_value::<super::plan_common::JoinType>()? as i32);
4740                        }
4741                        GeneratedField::JoinCond => {
4742                            if join_cond__.is_some() {
4743                                return Err(serde::de::Error::duplicate_field("joinCond"));
4744                            }
4745                            join_cond__ = map_.next_value()?;
4746                        }
4747                        GeneratedField::OutputIndices => {
4748                            if output_indices__.is_some() {
4749                                return Err(serde::de::Error::duplicate_field("outputIndices"));
4750                            }
4751                            output_indices__ = 
4752                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
4753                                    .into_iter().map(|x| x.0).collect())
4754                            ;
4755                        }
4756                    }
4757                }
4758                Ok(NestedLoopJoinNode {
4759                    join_type: join_type__.unwrap_or_default(),
4760                    join_cond: join_cond__,
4761                    output_indices: output_indices__.unwrap_or_default(),
4762                })
4763            }
4764        }
4765        deserializer.deserialize_struct("batch_plan.NestedLoopJoinNode", FIELDS, GeneratedVisitor)
4766    }
4767}
4768impl serde::Serialize for PlanFragment {
4769    #[allow(deprecated)]
4770    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4771    where
4772        S: serde::Serializer,
4773    {
4774        use serde::ser::SerializeStruct;
4775        let mut len = 0;
4776        if self.root.is_some() {
4777            len += 1;
4778        }
4779        if self.exchange_info.is_some() {
4780            len += 1;
4781        }
4782        let mut struct_ser = serializer.serialize_struct("batch_plan.PlanFragment", len)?;
4783        if let Some(v) = self.root.as_ref() {
4784            struct_ser.serialize_field("root", v)?;
4785        }
4786        if let Some(v) = self.exchange_info.as_ref() {
4787            struct_ser.serialize_field("exchangeInfo", v)?;
4788        }
4789        struct_ser.end()
4790    }
4791}
4792impl<'de> serde::Deserialize<'de> for PlanFragment {
4793    #[allow(deprecated)]
4794    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4795    where
4796        D: serde::Deserializer<'de>,
4797    {
4798        const FIELDS: &[&str] = &[
4799            "root",
4800            "exchange_info",
4801            "exchangeInfo",
4802        ];
4803
4804        #[allow(clippy::enum_variant_names)]
4805        enum GeneratedField {
4806            Root,
4807            ExchangeInfo,
4808        }
4809        impl<'de> serde::Deserialize<'de> for GeneratedField {
4810            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
4811            where
4812                D: serde::Deserializer<'de>,
4813            {
4814                struct GeneratedVisitor;
4815
4816                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
4817                    type Value = GeneratedField;
4818
4819                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4820                        write!(formatter, "expected one of: {:?}", &FIELDS)
4821                    }
4822
4823                    #[allow(unused_variables)]
4824                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
4825                    where
4826                        E: serde::de::Error,
4827                    {
4828                        match value {
4829                            "root" => Ok(GeneratedField::Root),
4830                            "exchangeInfo" | "exchange_info" => Ok(GeneratedField::ExchangeInfo),
4831                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
4832                        }
4833                    }
4834                }
4835                deserializer.deserialize_identifier(GeneratedVisitor)
4836            }
4837        }
4838        struct GeneratedVisitor;
4839        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
4840            type Value = PlanFragment;
4841
4842            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4843                formatter.write_str("struct batch_plan.PlanFragment")
4844            }
4845
4846            fn visit_map<V>(self, mut map_: V) -> std::result::Result<PlanFragment, V::Error>
4847                where
4848                    V: serde::de::MapAccess<'de>,
4849            {
4850                let mut root__ = None;
4851                let mut exchange_info__ = None;
4852                while let Some(k) = map_.next_key()? {
4853                    match k {
4854                        GeneratedField::Root => {
4855                            if root__.is_some() {
4856                                return Err(serde::de::Error::duplicate_field("root"));
4857                            }
4858                            root__ = map_.next_value()?;
4859                        }
4860                        GeneratedField::ExchangeInfo => {
4861                            if exchange_info__.is_some() {
4862                                return Err(serde::de::Error::duplicate_field("exchangeInfo"));
4863                            }
4864                            exchange_info__ = map_.next_value()?;
4865                        }
4866                    }
4867                }
4868                Ok(PlanFragment {
4869                    root: root__,
4870                    exchange_info: exchange_info__,
4871                })
4872            }
4873        }
4874        deserializer.deserialize_struct("batch_plan.PlanFragment", FIELDS, GeneratedVisitor)
4875    }
4876}
4877impl serde::Serialize for PlanNode {
4878    #[allow(deprecated)]
4879    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4880    where
4881        S: serde::Serializer,
4882    {
4883        use serde::ser::SerializeStruct;
4884        let mut len = 0;
4885        if !self.children.is_empty() {
4886            len += 1;
4887        }
4888        if !self.identity.is_empty() {
4889            len += 1;
4890        }
4891        if self.node_body.is_some() {
4892            len += 1;
4893        }
4894        let mut struct_ser = serializer.serialize_struct("batch_plan.PlanNode", len)?;
4895        if !self.children.is_empty() {
4896            struct_ser.serialize_field("children", &self.children)?;
4897        }
4898        if !self.identity.is_empty() {
4899            struct_ser.serialize_field("identity", &self.identity)?;
4900        }
4901        if let Some(v) = self.node_body.as_ref() {
4902            match v {
4903                plan_node::NodeBody::Insert(v) => {
4904                    struct_ser.serialize_field("insert", v)?;
4905                }
4906                plan_node::NodeBody::Delete(v) => {
4907                    struct_ser.serialize_field("delete", v)?;
4908                }
4909                plan_node::NodeBody::Update(v) => {
4910                    struct_ser.serialize_field("update", v)?;
4911                }
4912                plan_node::NodeBody::Project(v) => {
4913                    struct_ser.serialize_field("project", v)?;
4914                }
4915                plan_node::NodeBody::HashAgg(v) => {
4916                    struct_ser.serialize_field("hashAgg", v)?;
4917                }
4918                plan_node::NodeBody::Filter(v) => {
4919                    struct_ser.serialize_field("filter", v)?;
4920                }
4921                plan_node::NodeBody::Exchange(v) => {
4922                    struct_ser.serialize_field("exchange", v)?;
4923                }
4924                plan_node::NodeBody::Sort(v) => {
4925                    struct_ser.serialize_field("sort", v)?;
4926                }
4927                plan_node::NodeBody::NestedLoopJoin(v) => {
4928                    struct_ser.serialize_field("nestedLoopJoin", v)?;
4929                }
4930                plan_node::NodeBody::TopN(v) => {
4931                    struct_ser.serialize_field("topN", v)?;
4932                }
4933                plan_node::NodeBody::SortAgg(v) => {
4934                    struct_ser.serialize_field("sortAgg", v)?;
4935                }
4936                plan_node::NodeBody::RowSeqScan(v) => {
4937                    struct_ser.serialize_field("rowSeqScan", v)?;
4938                }
4939                plan_node::NodeBody::Limit(v) => {
4940                    struct_ser.serialize_field("limit", v)?;
4941                }
4942                plan_node::NodeBody::Values(v) => {
4943                    struct_ser.serialize_field("values", v)?;
4944                }
4945                plan_node::NodeBody::HashJoin(v) => {
4946                    struct_ser.serialize_field("hashJoin", v)?;
4947                }
4948                plan_node::NodeBody::MergeSortExchange(v) => {
4949                    struct_ser.serialize_field("mergeSortExchange", v)?;
4950                }
4951                plan_node::NodeBody::HopWindow(v) => {
4952                    struct_ser.serialize_field("hopWindow", v)?;
4953                }
4954                plan_node::NodeBody::TableFunction(v) => {
4955                    struct_ser.serialize_field("tableFunction", v)?;
4956                }
4957                plan_node::NodeBody::SysRowSeqScan(v) => {
4958                    struct_ser.serialize_field("sysRowSeqScan", v)?;
4959                }
4960                plan_node::NodeBody::Expand(v) => {
4961                    struct_ser.serialize_field("expand", v)?;
4962                }
4963                plan_node::NodeBody::LocalLookupJoin(v) => {
4964                    struct_ser.serialize_field("localLookupJoin", v)?;
4965                }
4966                plan_node::NodeBody::ProjectSet(v) => {
4967                    struct_ser.serialize_field("projectSet", v)?;
4968                }
4969                plan_node::NodeBody::Union(v) => {
4970                    struct_ser.serialize_field("union", v)?;
4971                }
4972                plan_node::NodeBody::GroupTopN(v) => {
4973                    struct_ser.serialize_field("groupTopN", v)?;
4974                }
4975                plan_node::NodeBody::DistributedLookupJoin(v) => {
4976                    struct_ser.serialize_field("distributedLookupJoin", v)?;
4977                }
4978                plan_node::NodeBody::Source(v) => {
4979                    struct_ser.serialize_field("source", v)?;
4980                }
4981                plan_node::NodeBody::SortOverWindow(v) => {
4982                    struct_ser.serialize_field("sortOverWindow", v)?;
4983                }
4984                plan_node::NodeBody::MaxOneRow(v) => {
4985                    struct_ser.serialize_field("maxOneRow", v)?;
4986                }
4987                plan_node::NodeBody::LogRowSeqScan(v) => {
4988                    struct_ser.serialize_field("logRowSeqScan", v)?;
4989                }
4990                plan_node::NodeBody::FileScan(v) => {
4991                    struct_ser.serialize_field("fileScan", v)?;
4992                }
4993                plan_node::NodeBody::IcebergScan(v) => {
4994                    struct_ser.serialize_field("icebergScan", v)?;
4995                }
4996                plan_node::NodeBody::PostgresQuery(v) => {
4997                    struct_ser.serialize_field("postgresQuery", v)?;
4998                }
4999                plan_node::NodeBody::MysqlQuery(v) => {
5000                    struct_ser.serialize_field("mysqlQuery", v)?;
5001                }
5002                plan_node::NodeBody::GcsFileScan(v) => {
5003                    struct_ser.serialize_field("gcsFileScan", v)?;
5004                }
5005                plan_node::NodeBody::AzblobFileScan(v) => {
5006                    struct_ser.serialize_field("azblobFileScan", v)?;
5007                }
5008                plan_node::NodeBody::BlockExecutor(v) => {
5009                    struct_ser.serialize_field("blockExecutor", v)?;
5010                }
5011                plan_node::NodeBody::BusyLoopExecutor(v) => {
5012                    struct_ser.serialize_field("busyLoopExecutor", v)?;
5013                }
5014            }
5015        }
5016        struct_ser.end()
5017    }
5018}
5019impl<'de> serde::Deserialize<'de> for PlanNode {
5020    #[allow(deprecated)]
5021    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5022    where
5023        D: serde::Deserializer<'de>,
5024    {
5025        const FIELDS: &[&str] = &[
5026            "children",
5027            "identity",
5028            "insert",
5029            "delete",
5030            "update",
5031            "project",
5032            "hash_agg",
5033            "hashAgg",
5034            "filter",
5035            "exchange",
5036            "sort",
5037            "nested_loop_join",
5038            "nestedLoopJoin",
5039            "top_n",
5040            "topN",
5041            "sort_agg",
5042            "sortAgg",
5043            "row_seq_scan",
5044            "rowSeqScan",
5045            "limit",
5046            "values",
5047            "hash_join",
5048            "hashJoin",
5049            "merge_sort_exchange",
5050            "mergeSortExchange",
5051            "hop_window",
5052            "hopWindow",
5053            "table_function",
5054            "tableFunction",
5055            "sys_row_seq_scan",
5056            "sysRowSeqScan",
5057            "expand",
5058            "local_lookup_join",
5059            "localLookupJoin",
5060            "project_set",
5061            "projectSet",
5062            "union",
5063            "group_top_n",
5064            "groupTopN",
5065            "distributed_lookup_join",
5066            "distributedLookupJoin",
5067            "source",
5068            "sort_over_window",
5069            "sortOverWindow",
5070            "max_one_row",
5071            "maxOneRow",
5072            "log_row_seq_scan",
5073            "logRowSeqScan",
5074            "file_scan",
5075            "fileScan",
5076            "iceberg_scan",
5077            "icebergScan",
5078            "postgres_query",
5079            "postgresQuery",
5080            "mysql_query",
5081            "mysqlQuery",
5082            "gcs_file_scan",
5083            "gcsFileScan",
5084            "azblob_file_scan",
5085            "azblobFileScan",
5086            "block_executor",
5087            "blockExecutor",
5088            "busy_loop_executor",
5089            "busyLoopExecutor",
5090        ];
5091
5092        #[allow(clippy::enum_variant_names)]
5093        enum GeneratedField {
5094            Children,
5095            Identity,
5096            Insert,
5097            Delete,
5098            Update,
5099            Project,
5100            HashAgg,
5101            Filter,
5102            Exchange,
5103            Sort,
5104            NestedLoopJoin,
5105            TopN,
5106            SortAgg,
5107            RowSeqScan,
5108            Limit,
5109            Values,
5110            HashJoin,
5111            MergeSortExchange,
5112            HopWindow,
5113            TableFunction,
5114            SysRowSeqScan,
5115            Expand,
5116            LocalLookupJoin,
5117            ProjectSet,
5118            Union,
5119            GroupTopN,
5120            DistributedLookupJoin,
5121            Source,
5122            SortOverWindow,
5123            MaxOneRow,
5124            LogRowSeqScan,
5125            FileScan,
5126            IcebergScan,
5127            PostgresQuery,
5128            MysqlQuery,
5129            GcsFileScan,
5130            AzblobFileScan,
5131            BlockExecutor,
5132            BusyLoopExecutor,
5133        }
5134        impl<'de> serde::Deserialize<'de> for GeneratedField {
5135            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
5136            where
5137                D: serde::Deserializer<'de>,
5138            {
5139                struct GeneratedVisitor;
5140
5141                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
5142                    type Value = GeneratedField;
5143
5144                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5145                        write!(formatter, "expected one of: {:?}", &FIELDS)
5146                    }
5147
5148                    #[allow(unused_variables)]
5149                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
5150                    where
5151                        E: serde::de::Error,
5152                    {
5153                        match value {
5154                            "children" => Ok(GeneratedField::Children),
5155                            "identity" => Ok(GeneratedField::Identity),
5156                            "insert" => Ok(GeneratedField::Insert),
5157                            "delete" => Ok(GeneratedField::Delete),
5158                            "update" => Ok(GeneratedField::Update),
5159                            "project" => Ok(GeneratedField::Project),
5160                            "hashAgg" | "hash_agg" => Ok(GeneratedField::HashAgg),
5161                            "filter" => Ok(GeneratedField::Filter),
5162                            "exchange" => Ok(GeneratedField::Exchange),
5163                            "sort" => Ok(GeneratedField::Sort),
5164                            "nestedLoopJoin" | "nested_loop_join" => Ok(GeneratedField::NestedLoopJoin),
5165                            "topN" | "top_n" => Ok(GeneratedField::TopN),
5166                            "sortAgg" | "sort_agg" => Ok(GeneratedField::SortAgg),
5167                            "rowSeqScan" | "row_seq_scan" => Ok(GeneratedField::RowSeqScan),
5168                            "limit" => Ok(GeneratedField::Limit),
5169                            "values" => Ok(GeneratedField::Values),
5170                            "hashJoin" | "hash_join" => Ok(GeneratedField::HashJoin),
5171                            "mergeSortExchange" | "merge_sort_exchange" => Ok(GeneratedField::MergeSortExchange),
5172                            "hopWindow" | "hop_window" => Ok(GeneratedField::HopWindow),
5173                            "tableFunction" | "table_function" => Ok(GeneratedField::TableFunction),
5174                            "sysRowSeqScan" | "sys_row_seq_scan" => Ok(GeneratedField::SysRowSeqScan),
5175                            "expand" => Ok(GeneratedField::Expand),
5176                            "localLookupJoin" | "local_lookup_join" => Ok(GeneratedField::LocalLookupJoin),
5177                            "projectSet" | "project_set" => Ok(GeneratedField::ProjectSet),
5178                            "union" => Ok(GeneratedField::Union),
5179                            "groupTopN" | "group_top_n" => Ok(GeneratedField::GroupTopN),
5180                            "distributedLookupJoin" | "distributed_lookup_join" => Ok(GeneratedField::DistributedLookupJoin),
5181                            "source" => Ok(GeneratedField::Source),
5182                            "sortOverWindow" | "sort_over_window" => Ok(GeneratedField::SortOverWindow),
5183                            "maxOneRow" | "max_one_row" => Ok(GeneratedField::MaxOneRow),
5184                            "logRowSeqScan" | "log_row_seq_scan" => Ok(GeneratedField::LogRowSeqScan),
5185                            "fileScan" | "file_scan" => Ok(GeneratedField::FileScan),
5186                            "icebergScan" | "iceberg_scan" => Ok(GeneratedField::IcebergScan),
5187                            "postgresQuery" | "postgres_query" => Ok(GeneratedField::PostgresQuery),
5188                            "mysqlQuery" | "mysql_query" => Ok(GeneratedField::MysqlQuery),
5189                            "gcsFileScan" | "gcs_file_scan" => Ok(GeneratedField::GcsFileScan),
5190                            "azblobFileScan" | "azblob_file_scan" => Ok(GeneratedField::AzblobFileScan),
5191                            "blockExecutor" | "block_executor" => Ok(GeneratedField::BlockExecutor),
5192                            "busyLoopExecutor" | "busy_loop_executor" => Ok(GeneratedField::BusyLoopExecutor),
5193                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
5194                        }
5195                    }
5196                }
5197                deserializer.deserialize_identifier(GeneratedVisitor)
5198            }
5199        }
5200        struct GeneratedVisitor;
5201        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
5202            type Value = PlanNode;
5203
5204            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5205                formatter.write_str("struct batch_plan.PlanNode")
5206            }
5207
5208            fn visit_map<V>(self, mut map_: V) -> std::result::Result<PlanNode, V::Error>
5209                where
5210                    V: serde::de::MapAccess<'de>,
5211            {
5212                let mut children__ = None;
5213                let mut identity__ = None;
5214                let mut node_body__ = None;
5215                while let Some(k) = map_.next_key()? {
5216                    match k {
5217                        GeneratedField::Children => {
5218                            if children__.is_some() {
5219                                return Err(serde::de::Error::duplicate_field("children"));
5220                            }
5221                            children__ = Some(map_.next_value()?);
5222                        }
5223                        GeneratedField::Identity => {
5224                            if identity__.is_some() {
5225                                return Err(serde::de::Error::duplicate_field("identity"));
5226                            }
5227                            identity__ = Some(map_.next_value()?);
5228                        }
5229                        GeneratedField::Insert => {
5230                            if node_body__.is_some() {
5231                                return Err(serde::de::Error::duplicate_field("insert"));
5232                            }
5233                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Insert)
5234;
5235                        }
5236                        GeneratedField::Delete => {
5237                            if node_body__.is_some() {
5238                                return Err(serde::de::Error::duplicate_field("delete"));
5239                            }
5240                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Delete)
5241;
5242                        }
5243                        GeneratedField::Update => {
5244                            if node_body__.is_some() {
5245                                return Err(serde::de::Error::duplicate_field("update"));
5246                            }
5247                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Update)
5248;
5249                        }
5250                        GeneratedField::Project => {
5251                            if node_body__.is_some() {
5252                                return Err(serde::de::Error::duplicate_field("project"));
5253                            }
5254                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Project)
5255;
5256                        }
5257                        GeneratedField::HashAgg => {
5258                            if node_body__.is_some() {
5259                                return Err(serde::de::Error::duplicate_field("hashAgg"));
5260                            }
5261                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::HashAgg)
5262;
5263                        }
5264                        GeneratedField::Filter => {
5265                            if node_body__.is_some() {
5266                                return Err(serde::de::Error::duplicate_field("filter"));
5267                            }
5268                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Filter)
5269;
5270                        }
5271                        GeneratedField::Exchange => {
5272                            if node_body__.is_some() {
5273                                return Err(serde::de::Error::duplicate_field("exchange"));
5274                            }
5275                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Exchange)
5276;
5277                        }
5278                        GeneratedField::Sort => {
5279                            if node_body__.is_some() {
5280                                return Err(serde::de::Error::duplicate_field("sort"));
5281                            }
5282                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Sort)
5283;
5284                        }
5285                        GeneratedField::NestedLoopJoin => {
5286                            if node_body__.is_some() {
5287                                return Err(serde::de::Error::duplicate_field("nestedLoopJoin"));
5288                            }
5289                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::NestedLoopJoin)
5290;
5291                        }
5292                        GeneratedField::TopN => {
5293                            if node_body__.is_some() {
5294                                return Err(serde::de::Error::duplicate_field("topN"));
5295                            }
5296                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::TopN)
5297;
5298                        }
5299                        GeneratedField::SortAgg => {
5300                            if node_body__.is_some() {
5301                                return Err(serde::de::Error::duplicate_field("sortAgg"));
5302                            }
5303                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::SortAgg)
5304;
5305                        }
5306                        GeneratedField::RowSeqScan => {
5307                            if node_body__.is_some() {
5308                                return Err(serde::de::Error::duplicate_field("rowSeqScan"));
5309                            }
5310                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::RowSeqScan)
5311;
5312                        }
5313                        GeneratedField::Limit => {
5314                            if node_body__.is_some() {
5315                                return Err(serde::de::Error::duplicate_field("limit"));
5316                            }
5317                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Limit)
5318;
5319                        }
5320                        GeneratedField::Values => {
5321                            if node_body__.is_some() {
5322                                return Err(serde::de::Error::duplicate_field("values"));
5323                            }
5324                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Values)
5325;
5326                        }
5327                        GeneratedField::HashJoin => {
5328                            if node_body__.is_some() {
5329                                return Err(serde::de::Error::duplicate_field("hashJoin"));
5330                            }
5331                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::HashJoin)
5332;
5333                        }
5334                        GeneratedField::MergeSortExchange => {
5335                            if node_body__.is_some() {
5336                                return Err(serde::de::Error::duplicate_field("mergeSortExchange"));
5337                            }
5338                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::MergeSortExchange)
5339;
5340                        }
5341                        GeneratedField::HopWindow => {
5342                            if node_body__.is_some() {
5343                                return Err(serde::de::Error::duplicate_field("hopWindow"));
5344                            }
5345                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::HopWindow)
5346;
5347                        }
5348                        GeneratedField::TableFunction => {
5349                            if node_body__.is_some() {
5350                                return Err(serde::de::Error::duplicate_field("tableFunction"));
5351                            }
5352                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::TableFunction)
5353;
5354                        }
5355                        GeneratedField::SysRowSeqScan => {
5356                            if node_body__.is_some() {
5357                                return Err(serde::de::Error::duplicate_field("sysRowSeqScan"));
5358                            }
5359                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::SysRowSeqScan)
5360;
5361                        }
5362                        GeneratedField::Expand => {
5363                            if node_body__.is_some() {
5364                                return Err(serde::de::Error::duplicate_field("expand"));
5365                            }
5366                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Expand)
5367;
5368                        }
5369                        GeneratedField::LocalLookupJoin => {
5370                            if node_body__.is_some() {
5371                                return Err(serde::de::Error::duplicate_field("localLookupJoin"));
5372                            }
5373                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::LocalLookupJoin)
5374;
5375                        }
5376                        GeneratedField::ProjectSet => {
5377                            if node_body__.is_some() {
5378                                return Err(serde::de::Error::duplicate_field("projectSet"));
5379                            }
5380                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::ProjectSet)
5381;
5382                        }
5383                        GeneratedField::Union => {
5384                            if node_body__.is_some() {
5385                                return Err(serde::de::Error::duplicate_field("union"));
5386                            }
5387                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Union)
5388;
5389                        }
5390                        GeneratedField::GroupTopN => {
5391                            if node_body__.is_some() {
5392                                return Err(serde::de::Error::duplicate_field("groupTopN"));
5393                            }
5394                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::GroupTopN)
5395;
5396                        }
5397                        GeneratedField::DistributedLookupJoin => {
5398                            if node_body__.is_some() {
5399                                return Err(serde::de::Error::duplicate_field("distributedLookupJoin"));
5400                            }
5401                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::DistributedLookupJoin)
5402;
5403                        }
5404                        GeneratedField::Source => {
5405                            if node_body__.is_some() {
5406                                return Err(serde::de::Error::duplicate_field("source"));
5407                            }
5408                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Source)
5409;
5410                        }
5411                        GeneratedField::SortOverWindow => {
5412                            if node_body__.is_some() {
5413                                return Err(serde::de::Error::duplicate_field("sortOverWindow"));
5414                            }
5415                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::SortOverWindow)
5416;
5417                        }
5418                        GeneratedField::MaxOneRow => {
5419                            if node_body__.is_some() {
5420                                return Err(serde::de::Error::duplicate_field("maxOneRow"));
5421                            }
5422                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::MaxOneRow)
5423;
5424                        }
5425                        GeneratedField::LogRowSeqScan => {
5426                            if node_body__.is_some() {
5427                                return Err(serde::de::Error::duplicate_field("logRowSeqScan"));
5428                            }
5429                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::LogRowSeqScan)
5430;
5431                        }
5432                        GeneratedField::FileScan => {
5433                            if node_body__.is_some() {
5434                                return Err(serde::de::Error::duplicate_field("fileScan"));
5435                            }
5436                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::FileScan)
5437;
5438                        }
5439                        GeneratedField::IcebergScan => {
5440                            if node_body__.is_some() {
5441                                return Err(serde::de::Error::duplicate_field("icebergScan"));
5442                            }
5443                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::IcebergScan)
5444;
5445                        }
5446                        GeneratedField::PostgresQuery => {
5447                            if node_body__.is_some() {
5448                                return Err(serde::de::Error::duplicate_field("postgresQuery"));
5449                            }
5450                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::PostgresQuery)
5451;
5452                        }
5453                        GeneratedField::MysqlQuery => {
5454                            if node_body__.is_some() {
5455                                return Err(serde::de::Error::duplicate_field("mysqlQuery"));
5456                            }
5457                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::MysqlQuery)
5458;
5459                        }
5460                        GeneratedField::GcsFileScan => {
5461                            if node_body__.is_some() {
5462                                return Err(serde::de::Error::duplicate_field("gcsFileScan"));
5463                            }
5464                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::GcsFileScan)
5465;
5466                        }
5467                        GeneratedField::AzblobFileScan => {
5468                            if node_body__.is_some() {
5469                                return Err(serde::de::Error::duplicate_field("azblobFileScan"));
5470                            }
5471                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::AzblobFileScan)
5472;
5473                        }
5474                        GeneratedField::BlockExecutor => {
5475                            if node_body__.is_some() {
5476                                return Err(serde::de::Error::duplicate_field("blockExecutor"));
5477                            }
5478                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::BlockExecutor);
5479                        }
5480                        GeneratedField::BusyLoopExecutor => {
5481                            if node_body__.is_some() {
5482                                return Err(serde::de::Error::duplicate_field("busyLoopExecutor"));
5483                            }
5484                            node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::BusyLoopExecutor);
5485                        }
5486                    }
5487                }
5488                Ok(PlanNode {
5489                    children: children__.unwrap_or_default(),
5490                    identity: identity__.unwrap_or_default(),
5491                    node_body: node_body__,
5492                })
5493            }
5494        }
5495        deserializer.deserialize_struct("batch_plan.PlanNode", FIELDS, GeneratedVisitor)
5496    }
5497}
5498impl serde::Serialize for PostgresQueryNode {
5499    #[allow(deprecated)]
5500    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5501    where
5502        S: serde::Serializer,
5503    {
5504        use serde::ser::SerializeStruct;
5505        let mut len = 0;
5506        if !self.columns.is_empty() {
5507            len += 1;
5508        }
5509        if !self.hostname.is_empty() {
5510            len += 1;
5511        }
5512        if !self.port.is_empty() {
5513            len += 1;
5514        }
5515        if !self.username.is_empty() {
5516            len += 1;
5517        }
5518        if !self.password.is_empty() {
5519            len += 1;
5520        }
5521        if !self.database.is_empty() {
5522            len += 1;
5523        }
5524        if !self.query.is_empty() {
5525            len += 1;
5526        }
5527        let mut struct_ser = serializer.serialize_struct("batch_plan.PostgresQueryNode", len)?;
5528        if !self.columns.is_empty() {
5529            struct_ser.serialize_field("columns", &self.columns)?;
5530        }
5531        if !self.hostname.is_empty() {
5532            struct_ser.serialize_field("hostname", &self.hostname)?;
5533        }
5534        if !self.port.is_empty() {
5535            struct_ser.serialize_field("port", &self.port)?;
5536        }
5537        if !self.username.is_empty() {
5538            struct_ser.serialize_field("username", &self.username)?;
5539        }
5540        if !self.password.is_empty() {
5541            struct_ser.serialize_field("password", &self.password)?;
5542        }
5543        if !self.database.is_empty() {
5544            struct_ser.serialize_field("database", &self.database)?;
5545        }
5546        if !self.query.is_empty() {
5547            struct_ser.serialize_field("query", &self.query)?;
5548        }
5549        struct_ser.end()
5550    }
5551}
5552impl<'de> serde::Deserialize<'de> for PostgresQueryNode {
5553    #[allow(deprecated)]
5554    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5555    where
5556        D: serde::Deserializer<'de>,
5557    {
5558        const FIELDS: &[&str] = &[
5559            "columns",
5560            "hostname",
5561            "port",
5562            "username",
5563            "password",
5564            "database",
5565            "query",
5566        ];
5567
5568        #[allow(clippy::enum_variant_names)]
5569        enum GeneratedField {
5570            Columns,
5571            Hostname,
5572            Port,
5573            Username,
5574            Password,
5575            Database,
5576            Query,
5577        }
5578        impl<'de> serde::Deserialize<'de> for GeneratedField {
5579            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
5580            where
5581                D: serde::Deserializer<'de>,
5582            {
5583                struct GeneratedVisitor;
5584
5585                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
5586                    type Value = GeneratedField;
5587
5588                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5589                        write!(formatter, "expected one of: {:?}", &FIELDS)
5590                    }
5591
5592                    #[allow(unused_variables)]
5593                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
5594                    where
5595                        E: serde::de::Error,
5596                    {
5597                        match value {
5598                            "columns" => Ok(GeneratedField::Columns),
5599                            "hostname" => Ok(GeneratedField::Hostname),
5600                            "port" => Ok(GeneratedField::Port),
5601                            "username" => Ok(GeneratedField::Username),
5602                            "password" => Ok(GeneratedField::Password),
5603                            "database" => Ok(GeneratedField::Database),
5604                            "query" => Ok(GeneratedField::Query),
5605                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
5606                        }
5607                    }
5608                }
5609                deserializer.deserialize_identifier(GeneratedVisitor)
5610            }
5611        }
5612        struct GeneratedVisitor;
5613        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
5614            type Value = PostgresQueryNode;
5615
5616            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5617                formatter.write_str("struct batch_plan.PostgresQueryNode")
5618            }
5619
5620            fn visit_map<V>(self, mut map_: V) -> std::result::Result<PostgresQueryNode, V::Error>
5621                where
5622                    V: serde::de::MapAccess<'de>,
5623            {
5624                let mut columns__ = None;
5625                let mut hostname__ = None;
5626                let mut port__ = None;
5627                let mut username__ = None;
5628                let mut password__ = None;
5629                let mut database__ = None;
5630                let mut query__ = None;
5631                while let Some(k) = map_.next_key()? {
5632                    match k {
5633                        GeneratedField::Columns => {
5634                            if columns__.is_some() {
5635                                return Err(serde::de::Error::duplicate_field("columns"));
5636                            }
5637                            columns__ = Some(map_.next_value()?);
5638                        }
5639                        GeneratedField::Hostname => {
5640                            if hostname__.is_some() {
5641                                return Err(serde::de::Error::duplicate_field("hostname"));
5642                            }
5643                            hostname__ = Some(map_.next_value()?);
5644                        }
5645                        GeneratedField::Port => {
5646                            if port__.is_some() {
5647                                return Err(serde::de::Error::duplicate_field("port"));
5648                            }
5649                            port__ = Some(map_.next_value()?);
5650                        }
5651                        GeneratedField::Username => {
5652                            if username__.is_some() {
5653                                return Err(serde::de::Error::duplicate_field("username"));
5654                            }
5655                            username__ = Some(map_.next_value()?);
5656                        }
5657                        GeneratedField::Password => {
5658                            if password__.is_some() {
5659                                return Err(serde::de::Error::duplicate_field("password"));
5660                            }
5661                            password__ = Some(map_.next_value()?);
5662                        }
5663                        GeneratedField::Database => {
5664                            if database__.is_some() {
5665                                return Err(serde::de::Error::duplicate_field("database"));
5666                            }
5667                            database__ = Some(map_.next_value()?);
5668                        }
5669                        GeneratedField::Query => {
5670                            if query__.is_some() {
5671                                return Err(serde::de::Error::duplicate_field("query"));
5672                            }
5673                            query__ = Some(map_.next_value()?);
5674                        }
5675                    }
5676                }
5677                Ok(PostgresQueryNode {
5678                    columns: columns__.unwrap_or_default(),
5679                    hostname: hostname__.unwrap_or_default(),
5680                    port: port__.unwrap_or_default(),
5681                    username: username__.unwrap_or_default(),
5682                    password: password__.unwrap_or_default(),
5683                    database: database__.unwrap_or_default(),
5684                    query: query__.unwrap_or_default(),
5685                })
5686            }
5687        }
5688        deserializer.deserialize_struct("batch_plan.PostgresQueryNode", FIELDS, GeneratedVisitor)
5689    }
5690}
5691impl serde::Serialize for ProjectNode {
5692    #[allow(deprecated)]
5693    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5694    where
5695        S: serde::Serializer,
5696    {
5697        use serde::ser::SerializeStruct;
5698        let mut len = 0;
5699        if !self.select_list.is_empty() {
5700            len += 1;
5701        }
5702        let mut struct_ser = serializer.serialize_struct("batch_plan.ProjectNode", len)?;
5703        if !self.select_list.is_empty() {
5704            struct_ser.serialize_field("selectList", &self.select_list)?;
5705        }
5706        struct_ser.end()
5707    }
5708}
5709impl<'de> serde::Deserialize<'de> for ProjectNode {
5710    #[allow(deprecated)]
5711    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5712    where
5713        D: serde::Deserializer<'de>,
5714    {
5715        const FIELDS: &[&str] = &[
5716            "select_list",
5717            "selectList",
5718        ];
5719
5720        #[allow(clippy::enum_variant_names)]
5721        enum GeneratedField {
5722            SelectList,
5723        }
5724        impl<'de> serde::Deserialize<'de> for GeneratedField {
5725            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
5726            where
5727                D: serde::Deserializer<'de>,
5728            {
5729                struct GeneratedVisitor;
5730
5731                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
5732                    type Value = GeneratedField;
5733
5734                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5735                        write!(formatter, "expected one of: {:?}", &FIELDS)
5736                    }
5737
5738                    #[allow(unused_variables)]
5739                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
5740                    where
5741                        E: serde::de::Error,
5742                    {
5743                        match value {
5744                            "selectList" | "select_list" => Ok(GeneratedField::SelectList),
5745                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
5746                        }
5747                    }
5748                }
5749                deserializer.deserialize_identifier(GeneratedVisitor)
5750            }
5751        }
5752        struct GeneratedVisitor;
5753        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
5754            type Value = ProjectNode;
5755
5756            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5757                formatter.write_str("struct batch_plan.ProjectNode")
5758            }
5759
5760            fn visit_map<V>(self, mut map_: V) -> std::result::Result<ProjectNode, V::Error>
5761                where
5762                    V: serde::de::MapAccess<'de>,
5763            {
5764                let mut select_list__ = None;
5765                while let Some(k) = map_.next_key()? {
5766                    match k {
5767                        GeneratedField::SelectList => {
5768                            if select_list__.is_some() {
5769                                return Err(serde::de::Error::duplicate_field("selectList"));
5770                            }
5771                            select_list__ = Some(map_.next_value()?);
5772                        }
5773                    }
5774                }
5775                Ok(ProjectNode {
5776                    select_list: select_list__.unwrap_or_default(),
5777                })
5778            }
5779        }
5780        deserializer.deserialize_struct("batch_plan.ProjectNode", FIELDS, GeneratedVisitor)
5781    }
5782}
5783impl serde::Serialize for ProjectSetNode {
5784    #[allow(deprecated)]
5785    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5786    where
5787        S: serde::Serializer,
5788    {
5789        use serde::ser::SerializeStruct;
5790        let mut len = 0;
5791        if !self.select_list.is_empty() {
5792            len += 1;
5793        }
5794        let mut struct_ser = serializer.serialize_struct("batch_plan.ProjectSetNode", len)?;
5795        if !self.select_list.is_empty() {
5796            struct_ser.serialize_field("selectList", &self.select_list)?;
5797        }
5798        struct_ser.end()
5799    }
5800}
5801impl<'de> serde::Deserialize<'de> for ProjectSetNode {
5802    #[allow(deprecated)]
5803    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5804    where
5805        D: serde::Deserializer<'de>,
5806    {
5807        const FIELDS: &[&str] = &[
5808            "select_list",
5809            "selectList",
5810        ];
5811
5812        #[allow(clippy::enum_variant_names)]
5813        enum GeneratedField {
5814            SelectList,
5815        }
5816        impl<'de> serde::Deserialize<'de> for GeneratedField {
5817            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
5818            where
5819                D: serde::Deserializer<'de>,
5820            {
5821                struct GeneratedVisitor;
5822
5823                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
5824                    type Value = GeneratedField;
5825
5826                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5827                        write!(formatter, "expected one of: {:?}", &FIELDS)
5828                    }
5829
5830                    #[allow(unused_variables)]
5831                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
5832                    where
5833                        E: serde::de::Error,
5834                    {
5835                        match value {
5836                            "selectList" | "select_list" => Ok(GeneratedField::SelectList),
5837                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
5838                        }
5839                    }
5840                }
5841                deserializer.deserialize_identifier(GeneratedVisitor)
5842            }
5843        }
5844        struct GeneratedVisitor;
5845        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
5846            type Value = ProjectSetNode;
5847
5848            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5849                formatter.write_str("struct batch_plan.ProjectSetNode")
5850            }
5851
5852            fn visit_map<V>(self, mut map_: V) -> std::result::Result<ProjectSetNode, V::Error>
5853                where
5854                    V: serde::de::MapAccess<'de>,
5855            {
5856                let mut select_list__ = None;
5857                while let Some(k) = map_.next_key()? {
5858                    match k {
5859                        GeneratedField::SelectList => {
5860                            if select_list__.is_some() {
5861                                return Err(serde::de::Error::duplicate_field("selectList"));
5862                            }
5863                            select_list__ = Some(map_.next_value()?);
5864                        }
5865                    }
5866                }
5867                Ok(ProjectSetNode {
5868                    select_list: select_list__.unwrap_or_default(),
5869                })
5870            }
5871        }
5872        deserializer.deserialize_struct("batch_plan.ProjectSetNode", FIELDS, GeneratedVisitor)
5873    }
5874}
5875impl serde::Serialize for RowSeqScanNode {
5876    #[allow(deprecated)]
5877    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5878    where
5879        S: serde::Serializer,
5880    {
5881        use serde::ser::SerializeStruct;
5882        let mut len = 0;
5883        if self.table_desc.is_some() {
5884            len += 1;
5885        }
5886        if !self.column_ids.is_empty() {
5887            len += 1;
5888        }
5889        if !self.scan_ranges.is_empty() {
5890            len += 1;
5891        }
5892        if self.vnode_bitmap.is_some() {
5893            len += 1;
5894        }
5895        if self.ordered {
5896            len += 1;
5897        }
5898        if self.limit.is_some() {
5899            len += 1;
5900        }
5901        if self.as_of.is_some() {
5902            len += 1;
5903        }
5904        let mut struct_ser = serializer.serialize_struct("batch_plan.RowSeqScanNode", len)?;
5905        if let Some(v) = self.table_desc.as_ref() {
5906            struct_ser.serialize_field("tableDesc", v)?;
5907        }
5908        if !self.column_ids.is_empty() {
5909            struct_ser.serialize_field("columnIds", &self.column_ids)?;
5910        }
5911        if !self.scan_ranges.is_empty() {
5912            struct_ser.serialize_field("scanRanges", &self.scan_ranges)?;
5913        }
5914        if let Some(v) = self.vnode_bitmap.as_ref() {
5915            struct_ser.serialize_field("vnodeBitmap", v)?;
5916        }
5917        if self.ordered {
5918            struct_ser.serialize_field("ordered", &self.ordered)?;
5919        }
5920        if let Some(v) = self.limit.as_ref() {
5921            #[allow(clippy::needless_borrow)]
5922            #[allow(clippy::needless_borrows_for_generic_args)]
5923            struct_ser.serialize_field("limit", ToString::to_string(&v).as_str())?;
5924        }
5925        if let Some(v) = self.as_of.as_ref() {
5926            struct_ser.serialize_field("asOf", v)?;
5927        }
5928        struct_ser.end()
5929    }
5930}
5931impl<'de> serde::Deserialize<'de> for RowSeqScanNode {
5932    #[allow(deprecated)]
5933    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5934    where
5935        D: serde::Deserializer<'de>,
5936    {
5937        const FIELDS: &[&str] = &[
5938            "table_desc",
5939            "tableDesc",
5940            "column_ids",
5941            "columnIds",
5942            "scan_ranges",
5943            "scanRanges",
5944            "vnode_bitmap",
5945            "vnodeBitmap",
5946            "ordered",
5947            "limit",
5948            "as_of",
5949            "asOf",
5950        ];
5951
5952        #[allow(clippy::enum_variant_names)]
5953        enum GeneratedField {
5954            TableDesc,
5955            ColumnIds,
5956            ScanRanges,
5957            VnodeBitmap,
5958            Ordered,
5959            Limit,
5960            AsOf,
5961        }
5962        impl<'de> serde::Deserialize<'de> for GeneratedField {
5963            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
5964            where
5965                D: serde::Deserializer<'de>,
5966            {
5967                struct GeneratedVisitor;
5968
5969                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
5970                    type Value = GeneratedField;
5971
5972                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5973                        write!(formatter, "expected one of: {:?}", &FIELDS)
5974                    }
5975
5976                    #[allow(unused_variables)]
5977                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
5978                    where
5979                        E: serde::de::Error,
5980                    {
5981                        match value {
5982                            "tableDesc" | "table_desc" => Ok(GeneratedField::TableDesc),
5983                            "columnIds" | "column_ids" => Ok(GeneratedField::ColumnIds),
5984                            "scanRanges" | "scan_ranges" => Ok(GeneratedField::ScanRanges),
5985                            "vnodeBitmap" | "vnode_bitmap" => Ok(GeneratedField::VnodeBitmap),
5986                            "ordered" => Ok(GeneratedField::Ordered),
5987                            "limit" => Ok(GeneratedField::Limit),
5988                            "asOf" | "as_of" => Ok(GeneratedField::AsOf),
5989                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
5990                        }
5991                    }
5992                }
5993                deserializer.deserialize_identifier(GeneratedVisitor)
5994            }
5995        }
5996        struct GeneratedVisitor;
5997        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
5998            type Value = RowSeqScanNode;
5999
6000            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6001                formatter.write_str("struct batch_plan.RowSeqScanNode")
6002            }
6003
6004            fn visit_map<V>(self, mut map_: V) -> std::result::Result<RowSeqScanNode, V::Error>
6005                where
6006                    V: serde::de::MapAccess<'de>,
6007            {
6008                let mut table_desc__ = None;
6009                let mut column_ids__ = None;
6010                let mut scan_ranges__ = None;
6011                let mut vnode_bitmap__ = None;
6012                let mut ordered__ = None;
6013                let mut limit__ = None;
6014                let mut as_of__ = None;
6015                while let Some(k) = map_.next_key()? {
6016                    match k {
6017                        GeneratedField::TableDesc => {
6018                            if table_desc__.is_some() {
6019                                return Err(serde::de::Error::duplicate_field("tableDesc"));
6020                            }
6021                            table_desc__ = map_.next_value()?;
6022                        }
6023                        GeneratedField::ColumnIds => {
6024                            if column_ids__.is_some() {
6025                                return Err(serde::de::Error::duplicate_field("columnIds"));
6026                            }
6027                            column_ids__ = 
6028                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
6029                                    .into_iter().map(|x| x.0).collect())
6030                            ;
6031                        }
6032                        GeneratedField::ScanRanges => {
6033                            if scan_ranges__.is_some() {
6034                                return Err(serde::de::Error::duplicate_field("scanRanges"));
6035                            }
6036                            scan_ranges__ = Some(map_.next_value()?);
6037                        }
6038                        GeneratedField::VnodeBitmap => {
6039                            if vnode_bitmap__.is_some() {
6040                                return Err(serde::de::Error::duplicate_field("vnodeBitmap"));
6041                            }
6042                            vnode_bitmap__ = map_.next_value()?;
6043                        }
6044                        GeneratedField::Ordered => {
6045                            if ordered__.is_some() {
6046                                return Err(serde::de::Error::duplicate_field("ordered"));
6047                            }
6048                            ordered__ = Some(map_.next_value()?);
6049                        }
6050                        GeneratedField::Limit => {
6051                            if limit__.is_some() {
6052                                return Err(serde::de::Error::duplicate_field("limit"));
6053                            }
6054                            limit__ = 
6055                                map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
6056                            ;
6057                        }
6058                        GeneratedField::AsOf => {
6059                            if as_of__.is_some() {
6060                                return Err(serde::de::Error::duplicate_field("asOf"));
6061                            }
6062                            as_of__ = map_.next_value()?;
6063                        }
6064                    }
6065                }
6066                Ok(RowSeqScanNode {
6067                    table_desc: table_desc__,
6068                    column_ids: column_ids__.unwrap_or_default(),
6069                    scan_ranges: scan_ranges__.unwrap_or_default(),
6070                    vnode_bitmap: vnode_bitmap__,
6071                    ordered: ordered__.unwrap_or_default(),
6072                    limit: limit__,
6073                    as_of: as_of__,
6074                })
6075            }
6076        }
6077        deserializer.deserialize_struct("batch_plan.RowSeqScanNode", FIELDS, GeneratedVisitor)
6078    }
6079}
6080impl serde::Serialize for ScanRange {
6081    #[allow(deprecated)]
6082    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6083    where
6084        S: serde::Serializer,
6085    {
6086        use serde::ser::SerializeStruct;
6087        let mut len = 0;
6088        if !self.eq_conds.is_empty() {
6089            len += 1;
6090        }
6091        if self.lower_bound.is_some() {
6092            len += 1;
6093        }
6094        if self.upper_bound.is_some() {
6095            len += 1;
6096        }
6097        let mut struct_ser = serializer.serialize_struct("batch_plan.ScanRange", len)?;
6098        if !self.eq_conds.is_empty() {
6099            struct_ser.serialize_field("eqConds", &self.eq_conds.iter().map(pbjson::private::base64::encode).collect::<Vec<_>>())?;
6100        }
6101        if let Some(v) = self.lower_bound.as_ref() {
6102            struct_ser.serialize_field("lowerBound", v)?;
6103        }
6104        if let Some(v) = self.upper_bound.as_ref() {
6105            struct_ser.serialize_field("upperBound", v)?;
6106        }
6107        struct_ser.end()
6108    }
6109}
6110impl<'de> serde::Deserialize<'de> for ScanRange {
6111    #[allow(deprecated)]
6112    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6113    where
6114        D: serde::Deserializer<'de>,
6115    {
6116        const FIELDS: &[&str] = &[
6117            "eq_conds",
6118            "eqConds",
6119            "lower_bound",
6120            "lowerBound",
6121            "upper_bound",
6122            "upperBound",
6123        ];
6124
6125        #[allow(clippy::enum_variant_names)]
6126        enum GeneratedField {
6127            EqConds,
6128            LowerBound,
6129            UpperBound,
6130        }
6131        impl<'de> serde::Deserialize<'de> for GeneratedField {
6132            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
6133            where
6134                D: serde::Deserializer<'de>,
6135            {
6136                struct GeneratedVisitor;
6137
6138                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
6139                    type Value = GeneratedField;
6140
6141                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6142                        write!(formatter, "expected one of: {:?}", &FIELDS)
6143                    }
6144
6145                    #[allow(unused_variables)]
6146                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
6147                    where
6148                        E: serde::de::Error,
6149                    {
6150                        match value {
6151                            "eqConds" | "eq_conds" => Ok(GeneratedField::EqConds),
6152                            "lowerBound" | "lower_bound" => Ok(GeneratedField::LowerBound),
6153                            "upperBound" | "upper_bound" => Ok(GeneratedField::UpperBound),
6154                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
6155                        }
6156                    }
6157                }
6158                deserializer.deserialize_identifier(GeneratedVisitor)
6159            }
6160        }
6161        struct GeneratedVisitor;
6162        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
6163            type Value = ScanRange;
6164
6165            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6166                formatter.write_str("struct batch_plan.ScanRange")
6167            }
6168
6169            fn visit_map<V>(self, mut map_: V) -> std::result::Result<ScanRange, V::Error>
6170                where
6171                    V: serde::de::MapAccess<'de>,
6172            {
6173                let mut eq_conds__ = None;
6174                let mut lower_bound__ = None;
6175                let mut upper_bound__ = None;
6176                while let Some(k) = map_.next_key()? {
6177                    match k {
6178                        GeneratedField::EqConds => {
6179                            if eq_conds__.is_some() {
6180                                return Err(serde::de::Error::duplicate_field("eqConds"));
6181                            }
6182                            eq_conds__ = 
6183                                Some(map_.next_value::<Vec<::pbjson::private::BytesDeserialize<_>>>()?
6184                                    .into_iter().map(|x| x.0).collect())
6185                            ;
6186                        }
6187                        GeneratedField::LowerBound => {
6188                            if lower_bound__.is_some() {
6189                                return Err(serde::de::Error::duplicate_field("lowerBound"));
6190                            }
6191                            lower_bound__ = map_.next_value()?;
6192                        }
6193                        GeneratedField::UpperBound => {
6194                            if upper_bound__.is_some() {
6195                                return Err(serde::de::Error::duplicate_field("upperBound"));
6196                            }
6197                            upper_bound__ = map_.next_value()?;
6198                        }
6199                    }
6200                }
6201                Ok(ScanRange {
6202                    eq_conds: eq_conds__.unwrap_or_default(),
6203                    lower_bound: lower_bound__,
6204                    upper_bound: upper_bound__,
6205                })
6206            }
6207        }
6208        deserializer.deserialize_struct("batch_plan.ScanRange", FIELDS, GeneratedVisitor)
6209    }
6210}
6211impl serde::Serialize for scan_range::Bound {
6212    #[allow(deprecated)]
6213    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6214    where
6215        S: serde::Serializer,
6216    {
6217        use serde::ser::SerializeStruct;
6218        let mut len = 0;
6219        if !self.value.is_empty() {
6220            len += 1;
6221        }
6222        if self.inclusive {
6223            len += 1;
6224        }
6225        let mut struct_ser = serializer.serialize_struct("batch_plan.ScanRange.Bound", len)?;
6226        if !self.value.is_empty() {
6227            struct_ser.serialize_field("value", &self.value.iter().map(pbjson::private::base64::encode).collect::<Vec<_>>())?;
6228        }
6229        if self.inclusive {
6230            struct_ser.serialize_field("inclusive", &self.inclusive)?;
6231        }
6232        struct_ser.end()
6233    }
6234}
6235impl<'de> serde::Deserialize<'de> for scan_range::Bound {
6236    #[allow(deprecated)]
6237    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6238    where
6239        D: serde::Deserializer<'de>,
6240    {
6241        const FIELDS: &[&str] = &[
6242            "value",
6243            "inclusive",
6244        ];
6245
6246        #[allow(clippy::enum_variant_names)]
6247        enum GeneratedField {
6248            Value,
6249            Inclusive,
6250        }
6251        impl<'de> serde::Deserialize<'de> for GeneratedField {
6252            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
6253            where
6254                D: serde::Deserializer<'de>,
6255            {
6256                struct GeneratedVisitor;
6257
6258                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
6259                    type Value = GeneratedField;
6260
6261                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6262                        write!(formatter, "expected one of: {:?}", &FIELDS)
6263                    }
6264
6265                    #[allow(unused_variables)]
6266                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
6267                    where
6268                        E: serde::de::Error,
6269                    {
6270                        match value {
6271                            "value" => Ok(GeneratedField::Value),
6272                            "inclusive" => Ok(GeneratedField::Inclusive),
6273                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
6274                        }
6275                    }
6276                }
6277                deserializer.deserialize_identifier(GeneratedVisitor)
6278            }
6279        }
6280        struct GeneratedVisitor;
6281        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
6282            type Value = scan_range::Bound;
6283
6284            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6285                formatter.write_str("struct batch_plan.ScanRange.Bound")
6286            }
6287
6288            fn visit_map<V>(self, mut map_: V) -> std::result::Result<scan_range::Bound, V::Error>
6289                where
6290                    V: serde::de::MapAccess<'de>,
6291            {
6292                let mut value__ = None;
6293                let mut inclusive__ = None;
6294                while let Some(k) = map_.next_key()? {
6295                    match k {
6296                        GeneratedField::Value => {
6297                            if value__.is_some() {
6298                                return Err(serde::de::Error::duplicate_field("value"));
6299                            }
6300                            value__ = 
6301                                Some(map_.next_value::<Vec<::pbjson::private::BytesDeserialize<_>>>()?
6302                                    .into_iter().map(|x| x.0).collect())
6303                            ;
6304                        }
6305                        GeneratedField::Inclusive => {
6306                            if inclusive__.is_some() {
6307                                return Err(serde::de::Error::duplicate_field("inclusive"));
6308                            }
6309                            inclusive__ = Some(map_.next_value()?);
6310                        }
6311                    }
6312                }
6313                Ok(scan_range::Bound {
6314                    value: value__.unwrap_or_default(),
6315                    inclusive: inclusive__.unwrap_or_default(),
6316                })
6317            }
6318        }
6319        deserializer.deserialize_struct("batch_plan.ScanRange.Bound", FIELDS, GeneratedVisitor)
6320    }
6321}
6322impl serde::Serialize for SortAggNode {
6323    #[allow(deprecated)]
6324    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6325    where
6326        S: serde::Serializer,
6327    {
6328        use serde::ser::SerializeStruct;
6329        let mut len = 0;
6330        if !self.group_key.is_empty() {
6331            len += 1;
6332        }
6333        if !self.agg_calls.is_empty() {
6334            len += 1;
6335        }
6336        let mut struct_ser = serializer.serialize_struct("batch_plan.SortAggNode", len)?;
6337        if !self.group_key.is_empty() {
6338            struct_ser.serialize_field("groupKey", &self.group_key)?;
6339        }
6340        if !self.agg_calls.is_empty() {
6341            struct_ser.serialize_field("aggCalls", &self.agg_calls)?;
6342        }
6343        struct_ser.end()
6344    }
6345}
6346impl<'de> serde::Deserialize<'de> for SortAggNode {
6347    #[allow(deprecated)]
6348    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6349    where
6350        D: serde::Deserializer<'de>,
6351    {
6352        const FIELDS: &[&str] = &[
6353            "group_key",
6354            "groupKey",
6355            "agg_calls",
6356            "aggCalls",
6357        ];
6358
6359        #[allow(clippy::enum_variant_names)]
6360        enum GeneratedField {
6361            GroupKey,
6362            AggCalls,
6363        }
6364        impl<'de> serde::Deserialize<'de> for GeneratedField {
6365            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
6366            where
6367                D: serde::Deserializer<'de>,
6368            {
6369                struct GeneratedVisitor;
6370
6371                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
6372                    type Value = GeneratedField;
6373
6374                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6375                        write!(formatter, "expected one of: {:?}", &FIELDS)
6376                    }
6377
6378                    #[allow(unused_variables)]
6379                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
6380                    where
6381                        E: serde::de::Error,
6382                    {
6383                        match value {
6384                            "groupKey" | "group_key" => Ok(GeneratedField::GroupKey),
6385                            "aggCalls" | "agg_calls" => Ok(GeneratedField::AggCalls),
6386                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
6387                        }
6388                    }
6389                }
6390                deserializer.deserialize_identifier(GeneratedVisitor)
6391            }
6392        }
6393        struct GeneratedVisitor;
6394        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
6395            type Value = SortAggNode;
6396
6397            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6398                formatter.write_str("struct batch_plan.SortAggNode")
6399            }
6400
6401            fn visit_map<V>(self, mut map_: V) -> std::result::Result<SortAggNode, V::Error>
6402                where
6403                    V: serde::de::MapAccess<'de>,
6404            {
6405                let mut group_key__ = None;
6406                let mut agg_calls__ = None;
6407                while let Some(k) = map_.next_key()? {
6408                    match k {
6409                        GeneratedField::GroupKey => {
6410                            if group_key__.is_some() {
6411                                return Err(serde::de::Error::duplicate_field("groupKey"));
6412                            }
6413                            group_key__ = Some(map_.next_value()?);
6414                        }
6415                        GeneratedField::AggCalls => {
6416                            if agg_calls__.is_some() {
6417                                return Err(serde::de::Error::duplicate_field("aggCalls"));
6418                            }
6419                            agg_calls__ = Some(map_.next_value()?);
6420                        }
6421                    }
6422                }
6423                Ok(SortAggNode {
6424                    group_key: group_key__.unwrap_or_default(),
6425                    agg_calls: agg_calls__.unwrap_or_default(),
6426                })
6427            }
6428        }
6429        deserializer.deserialize_struct("batch_plan.SortAggNode", FIELDS, GeneratedVisitor)
6430    }
6431}
6432impl serde::Serialize for SortMergeJoinNode {
6433    #[allow(deprecated)]
6434    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6435    where
6436        S: serde::Serializer,
6437    {
6438        use serde::ser::SerializeStruct;
6439        let mut len = 0;
6440        if self.join_type != 0 {
6441            len += 1;
6442        }
6443        if !self.left_key.is_empty() {
6444            len += 1;
6445        }
6446        if !self.right_key.is_empty() {
6447            len += 1;
6448        }
6449        if self.direction != 0 {
6450            len += 1;
6451        }
6452        if !self.output_indices.is_empty() {
6453            len += 1;
6454        }
6455        let mut struct_ser = serializer.serialize_struct("batch_plan.SortMergeJoinNode", len)?;
6456        if self.join_type != 0 {
6457            let v = super::plan_common::JoinType::try_from(self.join_type)
6458                .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.join_type)))?;
6459            struct_ser.serialize_field("joinType", &v)?;
6460        }
6461        if !self.left_key.is_empty() {
6462            struct_ser.serialize_field("leftKey", &self.left_key)?;
6463        }
6464        if !self.right_key.is_empty() {
6465            struct_ser.serialize_field("rightKey", &self.right_key)?;
6466        }
6467        if self.direction != 0 {
6468            let v = super::common::Direction::try_from(self.direction)
6469                .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.direction)))?;
6470            struct_ser.serialize_field("direction", &v)?;
6471        }
6472        if !self.output_indices.is_empty() {
6473            struct_ser.serialize_field("outputIndices", &self.output_indices)?;
6474        }
6475        struct_ser.end()
6476    }
6477}
6478impl<'de> serde::Deserialize<'de> for SortMergeJoinNode {
6479    #[allow(deprecated)]
6480    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6481    where
6482        D: serde::Deserializer<'de>,
6483    {
6484        const FIELDS: &[&str] = &[
6485            "join_type",
6486            "joinType",
6487            "left_key",
6488            "leftKey",
6489            "right_key",
6490            "rightKey",
6491            "direction",
6492            "output_indices",
6493            "outputIndices",
6494        ];
6495
6496        #[allow(clippy::enum_variant_names)]
6497        enum GeneratedField {
6498            JoinType,
6499            LeftKey,
6500            RightKey,
6501            Direction,
6502            OutputIndices,
6503        }
6504        impl<'de> serde::Deserialize<'de> for GeneratedField {
6505            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
6506            where
6507                D: serde::Deserializer<'de>,
6508            {
6509                struct GeneratedVisitor;
6510
6511                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
6512                    type Value = GeneratedField;
6513
6514                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6515                        write!(formatter, "expected one of: {:?}", &FIELDS)
6516                    }
6517
6518                    #[allow(unused_variables)]
6519                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
6520                    where
6521                        E: serde::de::Error,
6522                    {
6523                        match value {
6524                            "joinType" | "join_type" => Ok(GeneratedField::JoinType),
6525                            "leftKey" | "left_key" => Ok(GeneratedField::LeftKey),
6526                            "rightKey" | "right_key" => Ok(GeneratedField::RightKey),
6527                            "direction" => Ok(GeneratedField::Direction),
6528                            "outputIndices" | "output_indices" => Ok(GeneratedField::OutputIndices),
6529                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
6530                        }
6531                    }
6532                }
6533                deserializer.deserialize_identifier(GeneratedVisitor)
6534            }
6535        }
6536        struct GeneratedVisitor;
6537        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
6538            type Value = SortMergeJoinNode;
6539
6540            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6541                formatter.write_str("struct batch_plan.SortMergeJoinNode")
6542            }
6543
6544            fn visit_map<V>(self, mut map_: V) -> std::result::Result<SortMergeJoinNode, V::Error>
6545                where
6546                    V: serde::de::MapAccess<'de>,
6547            {
6548                let mut join_type__ = None;
6549                let mut left_key__ = None;
6550                let mut right_key__ = None;
6551                let mut direction__ = None;
6552                let mut output_indices__ = None;
6553                while let Some(k) = map_.next_key()? {
6554                    match k {
6555                        GeneratedField::JoinType => {
6556                            if join_type__.is_some() {
6557                                return Err(serde::de::Error::duplicate_field("joinType"));
6558                            }
6559                            join_type__ = Some(map_.next_value::<super::plan_common::JoinType>()? as i32);
6560                        }
6561                        GeneratedField::LeftKey => {
6562                            if left_key__.is_some() {
6563                                return Err(serde::de::Error::duplicate_field("leftKey"));
6564                            }
6565                            left_key__ = 
6566                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
6567                                    .into_iter().map(|x| x.0).collect())
6568                            ;
6569                        }
6570                        GeneratedField::RightKey => {
6571                            if right_key__.is_some() {
6572                                return Err(serde::de::Error::duplicate_field("rightKey"));
6573                            }
6574                            right_key__ = 
6575                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
6576                                    .into_iter().map(|x| x.0).collect())
6577                            ;
6578                        }
6579                        GeneratedField::Direction => {
6580                            if direction__.is_some() {
6581                                return Err(serde::de::Error::duplicate_field("direction"));
6582                            }
6583                            direction__ = Some(map_.next_value::<super::common::Direction>()? as i32);
6584                        }
6585                        GeneratedField::OutputIndices => {
6586                            if output_indices__.is_some() {
6587                                return Err(serde::de::Error::duplicate_field("outputIndices"));
6588                            }
6589                            output_indices__ = 
6590                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
6591                                    .into_iter().map(|x| x.0).collect())
6592                            ;
6593                        }
6594                    }
6595                }
6596                Ok(SortMergeJoinNode {
6597                    join_type: join_type__.unwrap_or_default(),
6598                    left_key: left_key__.unwrap_or_default(),
6599                    right_key: right_key__.unwrap_or_default(),
6600                    direction: direction__.unwrap_or_default(),
6601                    output_indices: output_indices__.unwrap_or_default(),
6602                })
6603            }
6604        }
6605        deserializer.deserialize_struct("batch_plan.SortMergeJoinNode", FIELDS, GeneratedVisitor)
6606    }
6607}
6608impl serde::Serialize for SortNode {
6609    #[allow(deprecated)]
6610    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6611    where
6612        S: serde::Serializer,
6613    {
6614        use serde::ser::SerializeStruct;
6615        let mut len = 0;
6616        if !self.column_orders.is_empty() {
6617            len += 1;
6618        }
6619        let mut struct_ser = serializer.serialize_struct("batch_plan.SortNode", len)?;
6620        if !self.column_orders.is_empty() {
6621            struct_ser.serialize_field("columnOrders", &self.column_orders)?;
6622        }
6623        struct_ser.end()
6624    }
6625}
6626impl<'de> serde::Deserialize<'de> for SortNode {
6627    #[allow(deprecated)]
6628    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6629    where
6630        D: serde::Deserializer<'de>,
6631    {
6632        const FIELDS: &[&str] = &[
6633            "column_orders",
6634            "columnOrders",
6635        ];
6636
6637        #[allow(clippy::enum_variant_names)]
6638        enum GeneratedField {
6639            ColumnOrders,
6640        }
6641        impl<'de> serde::Deserialize<'de> for GeneratedField {
6642            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
6643            where
6644                D: serde::Deserializer<'de>,
6645            {
6646                struct GeneratedVisitor;
6647
6648                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
6649                    type Value = GeneratedField;
6650
6651                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6652                        write!(formatter, "expected one of: {:?}", &FIELDS)
6653                    }
6654
6655                    #[allow(unused_variables)]
6656                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
6657                    where
6658                        E: serde::de::Error,
6659                    {
6660                        match value {
6661                            "columnOrders" | "column_orders" => Ok(GeneratedField::ColumnOrders),
6662                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
6663                        }
6664                    }
6665                }
6666                deserializer.deserialize_identifier(GeneratedVisitor)
6667            }
6668        }
6669        struct GeneratedVisitor;
6670        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
6671            type Value = SortNode;
6672
6673            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6674                formatter.write_str("struct batch_plan.SortNode")
6675            }
6676
6677            fn visit_map<V>(self, mut map_: V) -> std::result::Result<SortNode, V::Error>
6678                where
6679                    V: serde::de::MapAccess<'de>,
6680            {
6681                let mut column_orders__ = None;
6682                while let Some(k) = map_.next_key()? {
6683                    match k {
6684                        GeneratedField::ColumnOrders => {
6685                            if column_orders__.is_some() {
6686                                return Err(serde::de::Error::duplicate_field("columnOrders"));
6687                            }
6688                            column_orders__ = Some(map_.next_value()?);
6689                        }
6690                    }
6691                }
6692                Ok(SortNode {
6693                    column_orders: column_orders__.unwrap_or_default(),
6694                })
6695            }
6696        }
6697        deserializer.deserialize_struct("batch_plan.SortNode", FIELDS, GeneratedVisitor)
6698    }
6699}
6700impl serde::Serialize for SortOverWindowNode {
6701    #[allow(deprecated)]
6702    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6703    where
6704        S: serde::Serializer,
6705    {
6706        use serde::ser::SerializeStruct;
6707        let mut len = 0;
6708        if !self.calls.is_empty() {
6709            len += 1;
6710        }
6711        if !self.partition_by.is_empty() {
6712            len += 1;
6713        }
6714        if !self.order_by.is_empty() {
6715            len += 1;
6716        }
6717        let mut struct_ser = serializer.serialize_struct("batch_plan.SortOverWindowNode", len)?;
6718        if !self.calls.is_empty() {
6719            struct_ser.serialize_field("calls", &self.calls)?;
6720        }
6721        if !self.partition_by.is_empty() {
6722            struct_ser.serialize_field("partitionBy", &self.partition_by)?;
6723        }
6724        if !self.order_by.is_empty() {
6725            struct_ser.serialize_field("orderBy", &self.order_by)?;
6726        }
6727        struct_ser.end()
6728    }
6729}
6730impl<'de> serde::Deserialize<'de> for SortOverWindowNode {
6731    #[allow(deprecated)]
6732    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6733    where
6734        D: serde::Deserializer<'de>,
6735    {
6736        const FIELDS: &[&str] = &[
6737            "calls",
6738            "partition_by",
6739            "partitionBy",
6740            "order_by",
6741            "orderBy",
6742        ];
6743
6744        #[allow(clippy::enum_variant_names)]
6745        enum GeneratedField {
6746            Calls,
6747            PartitionBy,
6748            OrderBy,
6749        }
6750        impl<'de> serde::Deserialize<'de> for GeneratedField {
6751            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
6752            where
6753                D: serde::Deserializer<'de>,
6754            {
6755                struct GeneratedVisitor;
6756
6757                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
6758                    type Value = GeneratedField;
6759
6760                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6761                        write!(formatter, "expected one of: {:?}", &FIELDS)
6762                    }
6763
6764                    #[allow(unused_variables)]
6765                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
6766                    where
6767                        E: serde::de::Error,
6768                    {
6769                        match value {
6770                            "calls" => Ok(GeneratedField::Calls),
6771                            "partitionBy" | "partition_by" => Ok(GeneratedField::PartitionBy),
6772                            "orderBy" | "order_by" => Ok(GeneratedField::OrderBy),
6773                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
6774                        }
6775                    }
6776                }
6777                deserializer.deserialize_identifier(GeneratedVisitor)
6778            }
6779        }
6780        struct GeneratedVisitor;
6781        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
6782            type Value = SortOverWindowNode;
6783
6784            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6785                formatter.write_str("struct batch_plan.SortOverWindowNode")
6786            }
6787
6788            fn visit_map<V>(self, mut map_: V) -> std::result::Result<SortOverWindowNode, V::Error>
6789                where
6790                    V: serde::de::MapAccess<'de>,
6791            {
6792                let mut calls__ = None;
6793                let mut partition_by__ = None;
6794                let mut order_by__ = None;
6795                while let Some(k) = map_.next_key()? {
6796                    match k {
6797                        GeneratedField::Calls => {
6798                            if calls__.is_some() {
6799                                return Err(serde::de::Error::duplicate_field("calls"));
6800                            }
6801                            calls__ = Some(map_.next_value()?);
6802                        }
6803                        GeneratedField::PartitionBy => {
6804                            if partition_by__.is_some() {
6805                                return Err(serde::de::Error::duplicate_field("partitionBy"));
6806                            }
6807                            partition_by__ = 
6808                                Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
6809                                    .into_iter().map(|x| x.0).collect())
6810                            ;
6811                        }
6812                        GeneratedField::OrderBy => {
6813                            if order_by__.is_some() {
6814                                return Err(serde::de::Error::duplicate_field("orderBy"));
6815                            }
6816                            order_by__ = Some(map_.next_value()?);
6817                        }
6818                    }
6819                }
6820                Ok(SortOverWindowNode {
6821                    calls: calls__.unwrap_or_default(),
6822                    partition_by: partition_by__.unwrap_or_default(),
6823                    order_by: order_by__.unwrap_or_default(),
6824                })
6825            }
6826        }
6827        deserializer.deserialize_struct("batch_plan.SortOverWindowNode", FIELDS, GeneratedVisitor)
6828    }
6829}
6830impl serde::Serialize for SourceNode {
6831    #[allow(deprecated)]
6832    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6833    where
6834        S: serde::Serializer,
6835    {
6836        use serde::ser::SerializeStruct;
6837        let mut len = 0;
6838        if self.source_id != 0 {
6839            len += 1;
6840        }
6841        if !self.columns.is_empty() {
6842            len += 1;
6843        }
6844        if !self.with_properties.is_empty() {
6845            len += 1;
6846        }
6847        if !self.split.is_empty() {
6848            len += 1;
6849        }
6850        if self.info.is_some() {
6851            len += 1;
6852        }
6853        if !self.secret_refs.is_empty() {
6854            len += 1;
6855        }
6856        let mut struct_ser = serializer.serialize_struct("batch_plan.SourceNode", len)?;
6857        if self.source_id != 0 {
6858            struct_ser.serialize_field("sourceId", &self.source_id)?;
6859        }
6860        if !self.columns.is_empty() {
6861            struct_ser.serialize_field("columns", &self.columns)?;
6862        }
6863        if !self.with_properties.is_empty() {
6864            struct_ser.serialize_field("withProperties", &self.with_properties)?;
6865        }
6866        if !self.split.is_empty() {
6867            struct_ser.serialize_field("split", &self.split.iter().map(pbjson::private::base64::encode).collect::<Vec<_>>())?;
6868        }
6869        if let Some(v) = self.info.as_ref() {
6870            struct_ser.serialize_field("info", v)?;
6871        }
6872        if !self.secret_refs.is_empty() {
6873            struct_ser.serialize_field("secretRefs", &self.secret_refs)?;
6874        }
6875        struct_ser.end()
6876    }
6877}
6878impl<'de> serde::Deserialize<'de> for SourceNode {
6879    #[allow(deprecated)]
6880    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6881    where
6882        D: serde::Deserializer<'de>,
6883    {
6884        const FIELDS: &[&str] = &[
6885            "source_id",
6886            "sourceId",
6887            "columns",
6888            "with_properties",
6889            "withProperties",
6890            "split",
6891            "info",
6892            "secret_refs",
6893            "secretRefs",
6894        ];
6895
6896        #[allow(clippy::enum_variant_names)]
6897        enum GeneratedField {
6898            SourceId,
6899            Columns,
6900            WithProperties,
6901            Split,
6902            Info,
6903            SecretRefs,
6904        }
6905        impl<'de> serde::Deserialize<'de> for GeneratedField {
6906            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
6907            where
6908                D: serde::Deserializer<'de>,
6909            {
6910                struct GeneratedVisitor;
6911
6912                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
6913                    type Value = GeneratedField;
6914
6915                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6916                        write!(formatter, "expected one of: {:?}", &FIELDS)
6917                    }
6918
6919                    #[allow(unused_variables)]
6920                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
6921                    where
6922                        E: serde::de::Error,
6923                    {
6924                        match value {
6925                            "sourceId" | "source_id" => Ok(GeneratedField::SourceId),
6926                            "columns" => Ok(GeneratedField::Columns),
6927                            "withProperties" | "with_properties" => Ok(GeneratedField::WithProperties),
6928                            "split" => Ok(GeneratedField::Split),
6929                            "info" => Ok(GeneratedField::Info),
6930                            "secretRefs" | "secret_refs" => Ok(GeneratedField::SecretRefs),
6931                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
6932                        }
6933                    }
6934                }
6935                deserializer.deserialize_identifier(GeneratedVisitor)
6936            }
6937        }
6938        struct GeneratedVisitor;
6939        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
6940            type Value = SourceNode;
6941
6942            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6943                formatter.write_str("struct batch_plan.SourceNode")
6944            }
6945
6946            fn visit_map<V>(self, mut map_: V) -> std::result::Result<SourceNode, V::Error>
6947                where
6948                    V: serde::de::MapAccess<'de>,
6949            {
6950                let mut source_id__ = None;
6951                let mut columns__ = None;
6952                let mut with_properties__ = None;
6953                let mut split__ = None;
6954                let mut info__ = None;
6955                let mut secret_refs__ = None;
6956                while let Some(k) = map_.next_key()? {
6957                    match k {
6958                        GeneratedField::SourceId => {
6959                            if source_id__.is_some() {
6960                                return Err(serde::de::Error::duplicate_field("sourceId"));
6961                            }
6962                            source_id__ = 
6963                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
6964                            ;
6965                        }
6966                        GeneratedField::Columns => {
6967                            if columns__.is_some() {
6968                                return Err(serde::de::Error::duplicate_field("columns"));
6969                            }
6970                            columns__ = Some(map_.next_value()?);
6971                        }
6972                        GeneratedField::WithProperties => {
6973                            if with_properties__.is_some() {
6974                                return Err(serde::de::Error::duplicate_field("withProperties"));
6975                            }
6976                            with_properties__ = Some(
6977                                map_.next_value::<std::collections::BTreeMap<_, _>>()?
6978                            );
6979                        }
6980                        GeneratedField::Split => {
6981                            if split__.is_some() {
6982                                return Err(serde::de::Error::duplicate_field("split"));
6983                            }
6984                            split__ = 
6985                                Some(map_.next_value::<Vec<::pbjson::private::BytesDeserialize<_>>>()?
6986                                    .into_iter().map(|x| x.0).collect())
6987                            ;
6988                        }
6989                        GeneratedField::Info => {
6990                            if info__.is_some() {
6991                                return Err(serde::de::Error::duplicate_field("info"));
6992                            }
6993                            info__ = map_.next_value()?;
6994                        }
6995                        GeneratedField::SecretRefs => {
6996                            if secret_refs__.is_some() {
6997                                return Err(serde::de::Error::duplicate_field("secretRefs"));
6998                            }
6999                            secret_refs__ = Some(
7000                                map_.next_value::<std::collections::BTreeMap<_, _>>()?
7001                            );
7002                        }
7003                    }
7004                }
7005                Ok(SourceNode {
7006                    source_id: source_id__.unwrap_or_default(),
7007                    columns: columns__.unwrap_or_default(),
7008                    with_properties: with_properties__.unwrap_or_default(),
7009                    split: split__.unwrap_or_default(),
7010                    info: info__,
7011                    secret_refs: secret_refs__.unwrap_or_default(),
7012                })
7013            }
7014        }
7015        deserializer.deserialize_struct("batch_plan.SourceNode", FIELDS, GeneratedVisitor)
7016    }
7017}
7018impl serde::Serialize for SysRowSeqScanNode {
7019    #[allow(deprecated)]
7020    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7021    where
7022        S: serde::Serializer,
7023    {
7024        use serde::ser::SerializeStruct;
7025        let mut len = 0;
7026        if self.table_id != 0 {
7027            len += 1;
7028        }
7029        if !self.column_descs.is_empty() {
7030            len += 1;
7031        }
7032        let mut struct_ser = serializer.serialize_struct("batch_plan.SysRowSeqScanNode", len)?;
7033        if self.table_id != 0 {
7034            struct_ser.serialize_field("tableId", &self.table_id)?;
7035        }
7036        if !self.column_descs.is_empty() {
7037            struct_ser.serialize_field("columnDescs", &self.column_descs)?;
7038        }
7039        struct_ser.end()
7040    }
7041}
7042impl<'de> serde::Deserialize<'de> for SysRowSeqScanNode {
7043    #[allow(deprecated)]
7044    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7045    where
7046        D: serde::Deserializer<'de>,
7047    {
7048        const FIELDS: &[&str] = &[
7049            "table_id",
7050            "tableId",
7051            "column_descs",
7052            "columnDescs",
7053        ];
7054
7055        #[allow(clippy::enum_variant_names)]
7056        enum GeneratedField {
7057            TableId,
7058            ColumnDescs,
7059        }
7060        impl<'de> serde::Deserialize<'de> for GeneratedField {
7061            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
7062            where
7063                D: serde::Deserializer<'de>,
7064            {
7065                struct GeneratedVisitor;
7066
7067                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
7068                    type Value = GeneratedField;
7069
7070                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7071                        write!(formatter, "expected one of: {:?}", &FIELDS)
7072                    }
7073
7074                    #[allow(unused_variables)]
7075                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
7076                    where
7077                        E: serde::de::Error,
7078                    {
7079                        match value {
7080                            "tableId" | "table_id" => Ok(GeneratedField::TableId),
7081                            "columnDescs" | "column_descs" => Ok(GeneratedField::ColumnDescs),
7082                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
7083                        }
7084                    }
7085                }
7086                deserializer.deserialize_identifier(GeneratedVisitor)
7087            }
7088        }
7089        struct GeneratedVisitor;
7090        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
7091            type Value = SysRowSeqScanNode;
7092
7093            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7094                formatter.write_str("struct batch_plan.SysRowSeqScanNode")
7095            }
7096
7097            fn visit_map<V>(self, mut map_: V) -> std::result::Result<SysRowSeqScanNode, V::Error>
7098                where
7099                    V: serde::de::MapAccess<'de>,
7100            {
7101                let mut table_id__ = None;
7102                let mut column_descs__ = None;
7103                while let Some(k) = map_.next_key()? {
7104                    match k {
7105                        GeneratedField::TableId => {
7106                            if table_id__.is_some() {
7107                                return Err(serde::de::Error::duplicate_field("tableId"));
7108                            }
7109                            table_id__ = 
7110                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
7111                            ;
7112                        }
7113                        GeneratedField::ColumnDescs => {
7114                            if column_descs__.is_some() {
7115                                return Err(serde::de::Error::duplicate_field("columnDescs"));
7116                            }
7117                            column_descs__ = Some(map_.next_value()?);
7118                        }
7119                    }
7120                }
7121                Ok(SysRowSeqScanNode {
7122                    table_id: table_id__.unwrap_or_default(),
7123                    column_descs: column_descs__.unwrap_or_default(),
7124                })
7125            }
7126        }
7127        deserializer.deserialize_struct("batch_plan.SysRowSeqScanNode", FIELDS, GeneratedVisitor)
7128    }
7129}
7130impl serde::Serialize for TableFunctionNode {
7131    #[allow(deprecated)]
7132    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7133    where
7134        S: serde::Serializer,
7135    {
7136        use serde::ser::SerializeStruct;
7137        let mut len = 0;
7138        if self.table_function.is_some() {
7139            len += 1;
7140        }
7141        let mut struct_ser = serializer.serialize_struct("batch_plan.TableFunctionNode", len)?;
7142        if let Some(v) = self.table_function.as_ref() {
7143            struct_ser.serialize_field("tableFunction", v)?;
7144        }
7145        struct_ser.end()
7146    }
7147}
7148impl<'de> serde::Deserialize<'de> for TableFunctionNode {
7149    #[allow(deprecated)]
7150    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7151    where
7152        D: serde::Deserializer<'de>,
7153    {
7154        const FIELDS: &[&str] = &[
7155            "table_function",
7156            "tableFunction",
7157        ];
7158
7159        #[allow(clippy::enum_variant_names)]
7160        enum GeneratedField {
7161            TableFunction,
7162        }
7163        impl<'de> serde::Deserialize<'de> for GeneratedField {
7164            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
7165            where
7166                D: serde::Deserializer<'de>,
7167            {
7168                struct GeneratedVisitor;
7169
7170                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
7171                    type Value = GeneratedField;
7172
7173                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7174                        write!(formatter, "expected one of: {:?}", &FIELDS)
7175                    }
7176
7177                    #[allow(unused_variables)]
7178                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
7179                    where
7180                        E: serde::de::Error,
7181                    {
7182                        match value {
7183                            "tableFunction" | "table_function" => Ok(GeneratedField::TableFunction),
7184                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
7185                        }
7186                    }
7187                }
7188                deserializer.deserialize_identifier(GeneratedVisitor)
7189            }
7190        }
7191        struct GeneratedVisitor;
7192        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
7193            type Value = TableFunctionNode;
7194
7195            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7196                formatter.write_str("struct batch_plan.TableFunctionNode")
7197            }
7198
7199            fn visit_map<V>(self, mut map_: V) -> std::result::Result<TableFunctionNode, V::Error>
7200                where
7201                    V: serde::de::MapAccess<'de>,
7202            {
7203                let mut table_function__ = None;
7204                while let Some(k) = map_.next_key()? {
7205                    match k {
7206                        GeneratedField::TableFunction => {
7207                            if table_function__.is_some() {
7208                                return Err(serde::de::Error::duplicate_field("tableFunction"));
7209                            }
7210                            table_function__ = map_.next_value()?;
7211                        }
7212                    }
7213                }
7214                Ok(TableFunctionNode {
7215                    table_function: table_function__,
7216                })
7217            }
7218        }
7219        deserializer.deserialize_struct("batch_plan.TableFunctionNode", FIELDS, GeneratedVisitor)
7220    }
7221}
7222impl serde::Serialize for TaskId {
7223    #[allow(deprecated)]
7224    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7225    where
7226        S: serde::Serializer,
7227    {
7228        use serde::ser::SerializeStruct;
7229        let mut len = 0;
7230        if !self.query_id.is_empty() {
7231            len += 1;
7232        }
7233        if self.stage_id != 0 {
7234            len += 1;
7235        }
7236        if self.task_id != 0 {
7237            len += 1;
7238        }
7239        let mut struct_ser = serializer.serialize_struct("batch_plan.TaskId", len)?;
7240        if !self.query_id.is_empty() {
7241            struct_ser.serialize_field("queryId", &self.query_id)?;
7242        }
7243        if self.stage_id != 0 {
7244            struct_ser.serialize_field("stageId", &self.stage_id)?;
7245        }
7246        if self.task_id != 0 {
7247            #[allow(clippy::needless_borrow)]
7248            #[allow(clippy::needless_borrows_for_generic_args)]
7249            struct_ser.serialize_field("taskId", ToString::to_string(&self.task_id).as_str())?;
7250        }
7251        struct_ser.end()
7252    }
7253}
7254impl<'de> serde::Deserialize<'de> for TaskId {
7255    #[allow(deprecated)]
7256    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7257    where
7258        D: serde::Deserializer<'de>,
7259    {
7260        const FIELDS: &[&str] = &[
7261            "query_id",
7262            "queryId",
7263            "stage_id",
7264            "stageId",
7265            "task_id",
7266            "taskId",
7267        ];
7268
7269        #[allow(clippy::enum_variant_names)]
7270        enum GeneratedField {
7271            QueryId,
7272            StageId,
7273            TaskId,
7274        }
7275        impl<'de> serde::Deserialize<'de> for GeneratedField {
7276            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
7277            where
7278                D: serde::Deserializer<'de>,
7279            {
7280                struct GeneratedVisitor;
7281
7282                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
7283                    type Value = GeneratedField;
7284
7285                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7286                        write!(formatter, "expected one of: {:?}", &FIELDS)
7287                    }
7288
7289                    #[allow(unused_variables)]
7290                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
7291                    where
7292                        E: serde::de::Error,
7293                    {
7294                        match value {
7295                            "queryId" | "query_id" => Ok(GeneratedField::QueryId),
7296                            "stageId" | "stage_id" => Ok(GeneratedField::StageId),
7297                            "taskId" | "task_id" => Ok(GeneratedField::TaskId),
7298                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
7299                        }
7300                    }
7301                }
7302                deserializer.deserialize_identifier(GeneratedVisitor)
7303            }
7304        }
7305        struct GeneratedVisitor;
7306        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
7307            type Value = TaskId;
7308
7309            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7310                formatter.write_str("struct batch_plan.TaskId")
7311            }
7312
7313            fn visit_map<V>(self, mut map_: V) -> std::result::Result<TaskId, V::Error>
7314                where
7315                    V: serde::de::MapAccess<'de>,
7316            {
7317                let mut query_id__ = None;
7318                let mut stage_id__ = None;
7319                let mut task_id__ = None;
7320                while let Some(k) = map_.next_key()? {
7321                    match k {
7322                        GeneratedField::QueryId => {
7323                            if query_id__.is_some() {
7324                                return Err(serde::de::Error::duplicate_field("queryId"));
7325                            }
7326                            query_id__ = Some(map_.next_value()?);
7327                        }
7328                        GeneratedField::StageId => {
7329                            if stage_id__.is_some() {
7330                                return Err(serde::de::Error::duplicate_field("stageId"));
7331                            }
7332                            stage_id__ = 
7333                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
7334                            ;
7335                        }
7336                        GeneratedField::TaskId => {
7337                            if task_id__.is_some() {
7338                                return Err(serde::de::Error::duplicate_field("taskId"));
7339                            }
7340                            task_id__ = 
7341                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
7342                            ;
7343                        }
7344                    }
7345                }
7346                Ok(TaskId {
7347                    query_id: query_id__.unwrap_or_default(),
7348                    stage_id: stage_id__.unwrap_or_default(),
7349                    task_id: task_id__.unwrap_or_default(),
7350                })
7351            }
7352        }
7353        deserializer.deserialize_struct("batch_plan.TaskId", FIELDS, GeneratedVisitor)
7354    }
7355}
7356impl serde::Serialize for TaskOutputId {
7357    #[allow(deprecated)]
7358    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7359    where
7360        S: serde::Serializer,
7361    {
7362        use serde::ser::SerializeStruct;
7363        let mut len = 0;
7364        if self.task_id.is_some() {
7365            len += 1;
7366        }
7367        if self.output_id != 0 {
7368            len += 1;
7369        }
7370        let mut struct_ser = serializer.serialize_struct("batch_plan.TaskOutputId", len)?;
7371        if let Some(v) = self.task_id.as_ref() {
7372            struct_ser.serialize_field("taskId", v)?;
7373        }
7374        if self.output_id != 0 {
7375            #[allow(clippy::needless_borrow)]
7376            #[allow(clippy::needless_borrows_for_generic_args)]
7377            struct_ser.serialize_field("outputId", ToString::to_string(&self.output_id).as_str())?;
7378        }
7379        struct_ser.end()
7380    }
7381}
7382impl<'de> serde::Deserialize<'de> for TaskOutputId {
7383    #[allow(deprecated)]
7384    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7385    where
7386        D: serde::Deserializer<'de>,
7387    {
7388        const FIELDS: &[&str] = &[
7389            "task_id",
7390            "taskId",
7391            "output_id",
7392            "outputId",
7393        ];
7394
7395        #[allow(clippy::enum_variant_names)]
7396        enum GeneratedField {
7397            TaskId,
7398            OutputId,
7399        }
7400        impl<'de> serde::Deserialize<'de> for GeneratedField {
7401            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
7402            where
7403                D: serde::Deserializer<'de>,
7404            {
7405                struct GeneratedVisitor;
7406
7407                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
7408                    type Value = GeneratedField;
7409
7410                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7411                        write!(formatter, "expected one of: {:?}", &FIELDS)
7412                    }
7413
7414                    #[allow(unused_variables)]
7415                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
7416                    where
7417                        E: serde::de::Error,
7418                    {
7419                        match value {
7420                            "taskId" | "task_id" => Ok(GeneratedField::TaskId),
7421                            "outputId" | "output_id" => Ok(GeneratedField::OutputId),
7422                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
7423                        }
7424                    }
7425                }
7426                deserializer.deserialize_identifier(GeneratedVisitor)
7427            }
7428        }
7429        struct GeneratedVisitor;
7430        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
7431            type Value = TaskOutputId;
7432
7433            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7434                formatter.write_str("struct batch_plan.TaskOutputId")
7435            }
7436
7437            fn visit_map<V>(self, mut map_: V) -> std::result::Result<TaskOutputId, V::Error>
7438                where
7439                    V: serde::de::MapAccess<'de>,
7440            {
7441                let mut task_id__ = None;
7442                let mut output_id__ = None;
7443                while let Some(k) = map_.next_key()? {
7444                    match k {
7445                        GeneratedField::TaskId => {
7446                            if task_id__.is_some() {
7447                                return Err(serde::de::Error::duplicate_field("taskId"));
7448                            }
7449                            task_id__ = map_.next_value()?;
7450                        }
7451                        GeneratedField::OutputId => {
7452                            if output_id__.is_some() {
7453                                return Err(serde::de::Error::duplicate_field("outputId"));
7454                            }
7455                            output_id__ = 
7456                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
7457                            ;
7458                        }
7459                    }
7460                }
7461                Ok(TaskOutputId {
7462                    task_id: task_id__,
7463                    output_id: output_id__.unwrap_or_default(),
7464                })
7465            }
7466        }
7467        deserializer.deserialize_struct("batch_plan.TaskOutputId", FIELDS, GeneratedVisitor)
7468    }
7469}
7470impl serde::Serialize for TopNNode {
7471    #[allow(deprecated)]
7472    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7473    where
7474        S: serde::Serializer,
7475    {
7476        use serde::ser::SerializeStruct;
7477        let mut len = 0;
7478        if !self.column_orders.is_empty() {
7479            len += 1;
7480        }
7481        if self.limit != 0 {
7482            len += 1;
7483        }
7484        if self.offset != 0 {
7485            len += 1;
7486        }
7487        if self.with_ties {
7488            len += 1;
7489        }
7490        let mut struct_ser = serializer.serialize_struct("batch_plan.TopNNode", len)?;
7491        if !self.column_orders.is_empty() {
7492            struct_ser.serialize_field("columnOrders", &self.column_orders)?;
7493        }
7494        if self.limit != 0 {
7495            #[allow(clippy::needless_borrow)]
7496            #[allow(clippy::needless_borrows_for_generic_args)]
7497            struct_ser.serialize_field("limit", ToString::to_string(&self.limit).as_str())?;
7498        }
7499        if self.offset != 0 {
7500            #[allow(clippy::needless_borrow)]
7501            #[allow(clippy::needless_borrows_for_generic_args)]
7502            struct_ser.serialize_field("offset", ToString::to_string(&self.offset).as_str())?;
7503        }
7504        if self.with_ties {
7505            struct_ser.serialize_field("withTies", &self.with_ties)?;
7506        }
7507        struct_ser.end()
7508    }
7509}
7510impl<'de> serde::Deserialize<'de> for TopNNode {
7511    #[allow(deprecated)]
7512    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7513    where
7514        D: serde::Deserializer<'de>,
7515    {
7516        const FIELDS: &[&str] = &[
7517            "column_orders",
7518            "columnOrders",
7519            "limit",
7520            "offset",
7521            "with_ties",
7522            "withTies",
7523        ];
7524
7525        #[allow(clippy::enum_variant_names)]
7526        enum GeneratedField {
7527            ColumnOrders,
7528            Limit,
7529            Offset,
7530            WithTies,
7531        }
7532        impl<'de> serde::Deserialize<'de> for GeneratedField {
7533            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
7534            where
7535                D: serde::Deserializer<'de>,
7536            {
7537                struct GeneratedVisitor;
7538
7539                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
7540                    type Value = GeneratedField;
7541
7542                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7543                        write!(formatter, "expected one of: {:?}", &FIELDS)
7544                    }
7545
7546                    #[allow(unused_variables)]
7547                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
7548                    where
7549                        E: serde::de::Error,
7550                    {
7551                        match value {
7552                            "columnOrders" | "column_orders" => Ok(GeneratedField::ColumnOrders),
7553                            "limit" => Ok(GeneratedField::Limit),
7554                            "offset" => Ok(GeneratedField::Offset),
7555                            "withTies" | "with_ties" => Ok(GeneratedField::WithTies),
7556                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
7557                        }
7558                    }
7559                }
7560                deserializer.deserialize_identifier(GeneratedVisitor)
7561            }
7562        }
7563        struct GeneratedVisitor;
7564        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
7565            type Value = TopNNode;
7566
7567            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7568                formatter.write_str("struct batch_plan.TopNNode")
7569            }
7570
7571            fn visit_map<V>(self, mut map_: V) -> std::result::Result<TopNNode, V::Error>
7572                where
7573                    V: serde::de::MapAccess<'de>,
7574            {
7575                let mut column_orders__ = None;
7576                let mut limit__ = None;
7577                let mut offset__ = None;
7578                let mut with_ties__ = None;
7579                while let Some(k) = map_.next_key()? {
7580                    match k {
7581                        GeneratedField::ColumnOrders => {
7582                            if column_orders__.is_some() {
7583                                return Err(serde::de::Error::duplicate_field("columnOrders"));
7584                            }
7585                            column_orders__ = Some(map_.next_value()?);
7586                        }
7587                        GeneratedField::Limit => {
7588                            if limit__.is_some() {
7589                                return Err(serde::de::Error::duplicate_field("limit"));
7590                            }
7591                            limit__ = 
7592                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
7593                            ;
7594                        }
7595                        GeneratedField::Offset => {
7596                            if offset__.is_some() {
7597                                return Err(serde::de::Error::duplicate_field("offset"));
7598                            }
7599                            offset__ = 
7600                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
7601                            ;
7602                        }
7603                        GeneratedField::WithTies => {
7604                            if with_ties__.is_some() {
7605                                return Err(serde::de::Error::duplicate_field("withTies"));
7606                            }
7607                            with_ties__ = Some(map_.next_value()?);
7608                        }
7609                    }
7610                }
7611                Ok(TopNNode {
7612                    column_orders: column_orders__.unwrap_or_default(),
7613                    limit: limit__.unwrap_or_default(),
7614                    offset: offset__.unwrap_or_default(),
7615                    with_ties: with_ties__.unwrap_or_default(),
7616                })
7617            }
7618        }
7619        deserializer.deserialize_struct("batch_plan.TopNNode", FIELDS, GeneratedVisitor)
7620    }
7621}
7622impl serde::Serialize for UnionNode {
7623    #[allow(deprecated)]
7624    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7625    where
7626        S: serde::Serializer,
7627    {
7628        use serde::ser::SerializeStruct;
7629        let len = 0;
7630        let struct_ser = serializer.serialize_struct("batch_plan.UnionNode", len)?;
7631        struct_ser.end()
7632    }
7633}
7634impl<'de> serde::Deserialize<'de> for UnionNode {
7635    #[allow(deprecated)]
7636    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7637    where
7638        D: serde::Deserializer<'de>,
7639    {
7640        const FIELDS: &[&str] = &[
7641        ];
7642
7643        #[allow(clippy::enum_variant_names)]
7644        enum GeneratedField {
7645        }
7646        impl<'de> serde::Deserialize<'de> for GeneratedField {
7647            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
7648            where
7649                D: serde::Deserializer<'de>,
7650            {
7651                struct GeneratedVisitor;
7652
7653                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
7654                    type Value = GeneratedField;
7655
7656                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7657                        write!(formatter, "expected one of: {:?}", &FIELDS)
7658                    }
7659
7660                    #[allow(unused_variables)]
7661                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
7662                    where
7663                        E: serde::de::Error,
7664                    {
7665                            Err(serde::de::Error::unknown_field(value, FIELDS))
7666                    }
7667                }
7668                deserializer.deserialize_identifier(GeneratedVisitor)
7669            }
7670        }
7671        struct GeneratedVisitor;
7672        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
7673            type Value = UnionNode;
7674
7675            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7676                formatter.write_str("struct batch_plan.UnionNode")
7677            }
7678
7679            fn visit_map<V>(self, mut map_: V) -> std::result::Result<UnionNode, V::Error>
7680                where
7681                    V: serde::de::MapAccess<'de>,
7682            {
7683                while map_.next_key::<GeneratedField>()?.is_some() {
7684                    let _ = map_.next_value::<serde::de::IgnoredAny>()?;
7685                }
7686                Ok(UnionNode {
7687                })
7688            }
7689        }
7690        deserializer.deserialize_struct("batch_plan.UnionNode", FIELDS, GeneratedVisitor)
7691    }
7692}
7693impl serde::Serialize for UpdateNode {
7694    #[allow(deprecated)]
7695    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7696    where
7697        S: serde::Serializer,
7698    {
7699        use serde::ser::SerializeStruct;
7700        let mut len = 0;
7701        if self.table_id != 0 {
7702            len += 1;
7703        }
7704        if self.table_version_id != 0 {
7705            len += 1;
7706        }
7707        if !self.old_exprs.is_empty() {
7708            len += 1;
7709        }
7710        if !self.new_exprs.is_empty() {
7711            len += 1;
7712        }
7713        if self.returning {
7714            len += 1;
7715        }
7716        if self.session_id != 0 {
7717            len += 1;
7718        }
7719        let mut struct_ser = serializer.serialize_struct("batch_plan.UpdateNode", len)?;
7720        if self.table_id != 0 {
7721            struct_ser.serialize_field("tableId", &self.table_id)?;
7722        }
7723        if self.table_version_id != 0 {
7724            #[allow(clippy::needless_borrow)]
7725            #[allow(clippy::needless_borrows_for_generic_args)]
7726            struct_ser.serialize_field("tableVersionId", ToString::to_string(&self.table_version_id).as_str())?;
7727        }
7728        if !self.old_exprs.is_empty() {
7729            struct_ser.serialize_field("oldExprs", &self.old_exprs)?;
7730        }
7731        if !self.new_exprs.is_empty() {
7732            struct_ser.serialize_field("newExprs", &self.new_exprs)?;
7733        }
7734        if self.returning {
7735            struct_ser.serialize_field("returning", &self.returning)?;
7736        }
7737        if self.session_id != 0 {
7738            struct_ser.serialize_field("sessionId", &self.session_id)?;
7739        }
7740        struct_ser.end()
7741    }
7742}
7743impl<'de> serde::Deserialize<'de> for UpdateNode {
7744    #[allow(deprecated)]
7745    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7746    where
7747        D: serde::Deserializer<'de>,
7748    {
7749        const FIELDS: &[&str] = &[
7750            "table_id",
7751            "tableId",
7752            "table_version_id",
7753            "tableVersionId",
7754            "old_exprs",
7755            "oldExprs",
7756            "new_exprs",
7757            "newExprs",
7758            "returning",
7759            "session_id",
7760            "sessionId",
7761        ];
7762
7763        #[allow(clippy::enum_variant_names)]
7764        enum GeneratedField {
7765            TableId,
7766            TableVersionId,
7767            OldExprs,
7768            NewExprs,
7769            Returning,
7770            SessionId,
7771        }
7772        impl<'de> serde::Deserialize<'de> for GeneratedField {
7773            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
7774            where
7775                D: serde::Deserializer<'de>,
7776            {
7777                struct GeneratedVisitor;
7778
7779                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
7780                    type Value = GeneratedField;
7781
7782                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7783                        write!(formatter, "expected one of: {:?}", &FIELDS)
7784                    }
7785
7786                    #[allow(unused_variables)]
7787                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
7788                    where
7789                        E: serde::de::Error,
7790                    {
7791                        match value {
7792                            "tableId" | "table_id" => Ok(GeneratedField::TableId),
7793                            "tableVersionId" | "table_version_id" => Ok(GeneratedField::TableVersionId),
7794                            "oldExprs" | "old_exprs" => Ok(GeneratedField::OldExprs),
7795                            "newExprs" | "new_exprs" => Ok(GeneratedField::NewExprs),
7796                            "returning" => Ok(GeneratedField::Returning),
7797                            "sessionId" | "session_id" => Ok(GeneratedField::SessionId),
7798                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
7799                        }
7800                    }
7801                }
7802                deserializer.deserialize_identifier(GeneratedVisitor)
7803            }
7804        }
7805        struct GeneratedVisitor;
7806        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
7807            type Value = UpdateNode;
7808
7809            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7810                formatter.write_str("struct batch_plan.UpdateNode")
7811            }
7812
7813            fn visit_map<V>(self, mut map_: V) -> std::result::Result<UpdateNode, V::Error>
7814                where
7815                    V: serde::de::MapAccess<'de>,
7816            {
7817                let mut table_id__ = None;
7818                let mut table_version_id__ = None;
7819                let mut old_exprs__ = None;
7820                let mut new_exprs__ = None;
7821                let mut returning__ = None;
7822                let mut session_id__ = None;
7823                while let Some(k) = map_.next_key()? {
7824                    match k {
7825                        GeneratedField::TableId => {
7826                            if table_id__.is_some() {
7827                                return Err(serde::de::Error::duplicate_field("tableId"));
7828                            }
7829                            table_id__ = 
7830                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
7831                            ;
7832                        }
7833                        GeneratedField::TableVersionId => {
7834                            if table_version_id__.is_some() {
7835                                return Err(serde::de::Error::duplicate_field("tableVersionId"));
7836                            }
7837                            table_version_id__ = 
7838                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
7839                            ;
7840                        }
7841                        GeneratedField::OldExprs => {
7842                            if old_exprs__.is_some() {
7843                                return Err(serde::de::Error::duplicate_field("oldExprs"));
7844                            }
7845                            old_exprs__ = Some(map_.next_value()?);
7846                        }
7847                        GeneratedField::NewExprs => {
7848                            if new_exprs__.is_some() {
7849                                return Err(serde::de::Error::duplicate_field("newExprs"));
7850                            }
7851                            new_exprs__ = Some(map_.next_value()?);
7852                        }
7853                        GeneratedField::Returning => {
7854                            if returning__.is_some() {
7855                                return Err(serde::de::Error::duplicate_field("returning"));
7856                            }
7857                            returning__ = Some(map_.next_value()?);
7858                        }
7859                        GeneratedField::SessionId => {
7860                            if session_id__.is_some() {
7861                                return Err(serde::de::Error::duplicate_field("sessionId"));
7862                            }
7863                            session_id__ = 
7864                                Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
7865                            ;
7866                        }
7867                    }
7868                }
7869                Ok(UpdateNode {
7870                    table_id: table_id__.unwrap_or_default(),
7871                    table_version_id: table_version_id__.unwrap_or_default(),
7872                    old_exprs: old_exprs__.unwrap_or_default(),
7873                    new_exprs: new_exprs__.unwrap_or_default(),
7874                    returning: returning__.unwrap_or_default(),
7875                    session_id: session_id__.unwrap_or_default(),
7876                })
7877            }
7878        }
7879        deserializer.deserialize_struct("batch_plan.UpdateNode", FIELDS, GeneratedVisitor)
7880    }
7881}
7882impl serde::Serialize for ValuesNode {
7883    #[allow(deprecated)]
7884    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7885    where
7886        S: serde::Serializer,
7887    {
7888        use serde::ser::SerializeStruct;
7889        let mut len = 0;
7890        if !self.tuples.is_empty() {
7891            len += 1;
7892        }
7893        if !self.fields.is_empty() {
7894            len += 1;
7895        }
7896        let mut struct_ser = serializer.serialize_struct("batch_plan.ValuesNode", len)?;
7897        if !self.tuples.is_empty() {
7898            struct_ser.serialize_field("tuples", &self.tuples)?;
7899        }
7900        if !self.fields.is_empty() {
7901            struct_ser.serialize_field("fields", &self.fields)?;
7902        }
7903        struct_ser.end()
7904    }
7905}
7906impl<'de> serde::Deserialize<'de> for ValuesNode {
7907    #[allow(deprecated)]
7908    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7909    where
7910        D: serde::Deserializer<'de>,
7911    {
7912        const FIELDS: &[&str] = &[
7913            "tuples",
7914            "fields",
7915        ];
7916
7917        #[allow(clippy::enum_variant_names)]
7918        enum GeneratedField {
7919            Tuples,
7920            Fields,
7921        }
7922        impl<'de> serde::Deserialize<'de> for GeneratedField {
7923            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
7924            where
7925                D: serde::Deserializer<'de>,
7926            {
7927                struct GeneratedVisitor;
7928
7929                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
7930                    type Value = GeneratedField;
7931
7932                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7933                        write!(formatter, "expected one of: {:?}", &FIELDS)
7934                    }
7935
7936                    #[allow(unused_variables)]
7937                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
7938                    where
7939                        E: serde::de::Error,
7940                    {
7941                        match value {
7942                            "tuples" => Ok(GeneratedField::Tuples),
7943                            "fields" => Ok(GeneratedField::Fields),
7944                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
7945                        }
7946                    }
7947                }
7948                deserializer.deserialize_identifier(GeneratedVisitor)
7949            }
7950        }
7951        struct GeneratedVisitor;
7952        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
7953            type Value = ValuesNode;
7954
7955            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7956                formatter.write_str("struct batch_plan.ValuesNode")
7957            }
7958
7959            fn visit_map<V>(self, mut map_: V) -> std::result::Result<ValuesNode, V::Error>
7960                where
7961                    V: serde::de::MapAccess<'de>,
7962            {
7963                let mut tuples__ = None;
7964                let mut fields__ = None;
7965                while let Some(k) = map_.next_key()? {
7966                    match k {
7967                        GeneratedField::Tuples => {
7968                            if tuples__.is_some() {
7969                                return Err(serde::de::Error::duplicate_field("tuples"));
7970                            }
7971                            tuples__ = Some(map_.next_value()?);
7972                        }
7973                        GeneratedField::Fields => {
7974                            if fields__.is_some() {
7975                                return Err(serde::de::Error::duplicate_field("fields"));
7976                            }
7977                            fields__ = Some(map_.next_value()?);
7978                        }
7979                    }
7980                }
7981                Ok(ValuesNode {
7982                    tuples: tuples__.unwrap_or_default(),
7983                    fields: fields__.unwrap_or_default(),
7984                })
7985            }
7986        }
7987        deserializer.deserialize_struct("batch_plan.ValuesNode", FIELDS, GeneratedVisitor)
7988    }
7989}
7990impl serde::Serialize for values_node::ExprTuple {
7991    #[allow(deprecated)]
7992    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7993    where
7994        S: serde::Serializer,
7995    {
7996        use serde::ser::SerializeStruct;
7997        let mut len = 0;
7998        if !self.cells.is_empty() {
7999            len += 1;
8000        }
8001        let mut struct_ser = serializer.serialize_struct("batch_plan.ValuesNode.ExprTuple", len)?;
8002        if !self.cells.is_empty() {
8003            struct_ser.serialize_field("cells", &self.cells)?;
8004        }
8005        struct_ser.end()
8006    }
8007}
8008impl<'de> serde::Deserialize<'de> for values_node::ExprTuple {
8009    #[allow(deprecated)]
8010    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8011    where
8012        D: serde::Deserializer<'de>,
8013    {
8014        const FIELDS: &[&str] = &[
8015            "cells",
8016        ];
8017
8018        #[allow(clippy::enum_variant_names)]
8019        enum GeneratedField {
8020            Cells,
8021        }
8022        impl<'de> serde::Deserialize<'de> for GeneratedField {
8023            fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
8024            where
8025                D: serde::Deserializer<'de>,
8026            {
8027                struct GeneratedVisitor;
8028
8029                impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
8030                    type Value = GeneratedField;
8031
8032                    fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8033                        write!(formatter, "expected one of: {:?}", &FIELDS)
8034                    }
8035
8036                    #[allow(unused_variables)]
8037                    fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
8038                    where
8039                        E: serde::de::Error,
8040                    {
8041                        match value {
8042                            "cells" => Ok(GeneratedField::Cells),
8043                            _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
8044                        }
8045                    }
8046                }
8047                deserializer.deserialize_identifier(GeneratedVisitor)
8048            }
8049        }
8050        struct GeneratedVisitor;
8051        impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
8052            type Value = values_node::ExprTuple;
8053
8054            fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8055                formatter.write_str("struct batch_plan.ValuesNode.ExprTuple")
8056            }
8057
8058            fn visit_map<V>(self, mut map_: V) -> std::result::Result<values_node::ExprTuple, V::Error>
8059                where
8060                    V: serde::de::MapAccess<'de>,
8061            {
8062                let mut cells__ = None;
8063                while let Some(k) = map_.next_key()? {
8064                    match k {
8065                        GeneratedField::Cells => {
8066                            if cells__.is_some() {
8067                                return Err(serde::de::Error::duplicate_field("cells"));
8068                            }
8069                            cells__ = Some(map_.next_value()?);
8070                        }
8071                    }
8072                }
8073                Ok(values_node::ExprTuple {
8074                    cells: cells__.unwrap_or_default(),
8075                })
8076            }
8077        }
8078        deserializer.deserialize_struct("batch_plan.ValuesNode.ExprTuple", FIELDS, GeneratedVisitor)
8079    }
8080}