1use crate::plan_common::*;
2impl serde::Serialize for AdditionalCollectionName {
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 len = 0;
10 let struct_ser = serializer.serialize_struct("plan_common.AdditionalCollectionName", len)?;
11 struct_ser.end()
12 }
13}
14impl<'de> serde::Deserialize<'de> for AdditionalCollectionName {
15 #[allow(deprecated)]
16 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17 where
18 D: serde::Deserializer<'de>,
19 {
20 const FIELDS: &[&str] = &[
21 ];
22
23 #[allow(clippy::enum_variant_names)]
24 enum GeneratedField {
25 }
26 impl<'de> serde::Deserialize<'de> for GeneratedField {
27 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
28 where
29 D: serde::Deserializer<'de>,
30 {
31 struct GeneratedVisitor;
32
33 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
34 type Value = GeneratedField;
35
36 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
37 write!(formatter, "expected one of: {:?}", &FIELDS)
38 }
39
40 #[allow(unused_variables)]
41 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
42 where
43 E: serde::de::Error,
44 {
45 Err(serde::de::Error::unknown_field(value, FIELDS))
46 }
47 }
48 deserializer.deserialize_identifier(GeneratedVisitor)
49 }
50 }
51 struct GeneratedVisitor;
52 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
53 type Value = AdditionalCollectionName;
54
55 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
56 formatter.write_str("struct plan_common.AdditionalCollectionName")
57 }
58
59 fn visit_map<V>(self, mut map_: V) -> std::result::Result<AdditionalCollectionName, V::Error>
60 where
61 V: serde::de::MapAccess<'de>,
62 {
63 while map_.next_key::<GeneratedField>()?.is_some() {
64 let _ = map_.next_value::<serde::de::IgnoredAny>()?;
65 }
66 Ok(AdditionalCollectionName {
67 })
68 }
69 }
70 deserializer.deserialize_struct("plan_common.AdditionalCollectionName", FIELDS, GeneratedVisitor)
71 }
72}
73impl serde::Serialize for AdditionalColumn {
74 #[allow(deprecated)]
75 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
76 where
77 S: serde::Serializer,
78 {
79 use serde::ser::SerializeStruct;
80 let mut len = 0;
81 if self.column_type.is_some() {
82 len += 1;
83 }
84 let mut struct_ser = serializer.serialize_struct("plan_common.AdditionalColumn", len)?;
85 if let Some(v) = self.column_type.as_ref() {
86 match v {
87 additional_column::ColumnType::Key(v) => {
88 struct_ser.serialize_field("key", v)?;
89 }
90 additional_column::ColumnType::Timestamp(v) => {
91 struct_ser.serialize_field("timestamp", v)?;
92 }
93 additional_column::ColumnType::Partition(v) => {
94 struct_ser.serialize_field("partition", v)?;
95 }
96 additional_column::ColumnType::Offset(v) => {
97 struct_ser.serialize_field("offset", v)?;
98 }
99 additional_column::ColumnType::HeaderInner(v) => {
100 struct_ser.serialize_field("headerInner", v)?;
101 }
102 additional_column::ColumnType::Filename(v) => {
103 struct_ser.serialize_field("filename", v)?;
104 }
105 additional_column::ColumnType::Headers(v) => {
106 struct_ser.serialize_field("headers", v)?;
107 }
108 additional_column::ColumnType::DatabaseName(v) => {
109 struct_ser.serialize_field("databaseName", v)?;
110 }
111 additional_column::ColumnType::SchemaName(v) => {
112 struct_ser.serialize_field("schemaName", v)?;
113 }
114 additional_column::ColumnType::TableName(v) => {
115 struct_ser.serialize_field("tableName", v)?;
116 }
117 additional_column::ColumnType::CollectionName(v) => {
118 struct_ser.serialize_field("collectionName", v)?;
119 }
120 additional_column::ColumnType::Payload(v) => {
121 struct_ser.serialize_field("payload", v)?;
122 }
123 additional_column::ColumnType::Subject(v) => {
124 struct_ser.serialize_field("subject", v)?;
125 }
126 }
127 }
128 struct_ser.end()
129 }
130}
131impl<'de> serde::Deserialize<'de> for AdditionalColumn {
132 #[allow(deprecated)]
133 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
134 where
135 D: serde::Deserializer<'de>,
136 {
137 const FIELDS: &[&str] = &[
138 "key",
139 "timestamp",
140 "partition",
141 "offset",
142 "header_inner",
143 "headerInner",
144 "filename",
145 "headers",
146 "database_name",
147 "databaseName",
148 "schema_name",
149 "schemaName",
150 "table_name",
151 "tableName",
152 "collection_name",
153 "collectionName",
154 "payload",
155 "subject",
156 ];
157
158 #[allow(clippy::enum_variant_names)]
159 enum GeneratedField {
160 Key,
161 Timestamp,
162 Partition,
163 Offset,
164 HeaderInner,
165 Filename,
166 Headers,
167 DatabaseName,
168 SchemaName,
169 TableName,
170 CollectionName,
171 Payload,
172 Subject,
173 }
174 impl<'de> serde::Deserialize<'de> for GeneratedField {
175 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
176 where
177 D: serde::Deserializer<'de>,
178 {
179 struct GeneratedVisitor;
180
181 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
182 type Value = GeneratedField;
183
184 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
185 write!(formatter, "expected one of: {:?}", &FIELDS)
186 }
187
188 #[allow(unused_variables)]
189 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
190 where
191 E: serde::de::Error,
192 {
193 match value {
194 "key" => Ok(GeneratedField::Key),
195 "timestamp" => Ok(GeneratedField::Timestamp),
196 "partition" => Ok(GeneratedField::Partition),
197 "offset" => Ok(GeneratedField::Offset),
198 "headerInner" | "header_inner" => Ok(GeneratedField::HeaderInner),
199 "filename" => Ok(GeneratedField::Filename),
200 "headers" => Ok(GeneratedField::Headers),
201 "databaseName" | "database_name" => Ok(GeneratedField::DatabaseName),
202 "schemaName" | "schema_name" => Ok(GeneratedField::SchemaName),
203 "tableName" | "table_name" => Ok(GeneratedField::TableName),
204 "collectionName" | "collection_name" => Ok(GeneratedField::CollectionName),
205 "payload" => Ok(GeneratedField::Payload),
206 "subject" => Ok(GeneratedField::Subject),
207 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
208 }
209 }
210 }
211 deserializer.deserialize_identifier(GeneratedVisitor)
212 }
213 }
214 struct GeneratedVisitor;
215 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
216 type Value = AdditionalColumn;
217
218 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
219 formatter.write_str("struct plan_common.AdditionalColumn")
220 }
221
222 fn visit_map<V>(self, mut map_: V) -> std::result::Result<AdditionalColumn, V::Error>
223 where
224 V: serde::de::MapAccess<'de>,
225 {
226 let mut column_type__ = None;
227 while let Some(k) = map_.next_key()? {
228 match k {
229 GeneratedField::Key => {
230 if column_type__.is_some() {
231 return Err(serde::de::Error::duplicate_field("key"));
232 }
233 column_type__ = map_.next_value::<::std::option::Option<_>>()?.map(additional_column::ColumnType::Key)
234;
235 }
236 GeneratedField::Timestamp => {
237 if column_type__.is_some() {
238 return Err(serde::de::Error::duplicate_field("timestamp"));
239 }
240 column_type__ = map_.next_value::<::std::option::Option<_>>()?.map(additional_column::ColumnType::Timestamp)
241;
242 }
243 GeneratedField::Partition => {
244 if column_type__.is_some() {
245 return Err(serde::de::Error::duplicate_field("partition"));
246 }
247 column_type__ = map_.next_value::<::std::option::Option<_>>()?.map(additional_column::ColumnType::Partition)
248;
249 }
250 GeneratedField::Offset => {
251 if column_type__.is_some() {
252 return Err(serde::de::Error::duplicate_field("offset"));
253 }
254 column_type__ = map_.next_value::<::std::option::Option<_>>()?.map(additional_column::ColumnType::Offset)
255;
256 }
257 GeneratedField::HeaderInner => {
258 if column_type__.is_some() {
259 return Err(serde::de::Error::duplicate_field("headerInner"));
260 }
261 column_type__ = map_.next_value::<::std::option::Option<_>>()?.map(additional_column::ColumnType::HeaderInner)
262;
263 }
264 GeneratedField::Filename => {
265 if column_type__.is_some() {
266 return Err(serde::de::Error::duplicate_field("filename"));
267 }
268 column_type__ = map_.next_value::<::std::option::Option<_>>()?.map(additional_column::ColumnType::Filename)
269;
270 }
271 GeneratedField::Headers => {
272 if column_type__.is_some() {
273 return Err(serde::de::Error::duplicate_field("headers"));
274 }
275 column_type__ = map_.next_value::<::std::option::Option<_>>()?.map(additional_column::ColumnType::Headers)
276;
277 }
278 GeneratedField::DatabaseName => {
279 if column_type__.is_some() {
280 return Err(serde::de::Error::duplicate_field("databaseName"));
281 }
282 column_type__ = map_.next_value::<::std::option::Option<_>>()?.map(additional_column::ColumnType::DatabaseName)
283;
284 }
285 GeneratedField::SchemaName => {
286 if column_type__.is_some() {
287 return Err(serde::de::Error::duplicate_field("schemaName"));
288 }
289 column_type__ = map_.next_value::<::std::option::Option<_>>()?.map(additional_column::ColumnType::SchemaName)
290;
291 }
292 GeneratedField::TableName => {
293 if column_type__.is_some() {
294 return Err(serde::de::Error::duplicate_field("tableName"));
295 }
296 column_type__ = map_.next_value::<::std::option::Option<_>>()?.map(additional_column::ColumnType::TableName)
297;
298 }
299 GeneratedField::CollectionName => {
300 if column_type__.is_some() {
301 return Err(serde::de::Error::duplicate_field("collectionName"));
302 }
303 column_type__ = map_.next_value::<::std::option::Option<_>>()?.map(additional_column::ColumnType::CollectionName)
304;
305 }
306 GeneratedField::Payload => {
307 if column_type__.is_some() {
308 return Err(serde::de::Error::duplicate_field("payload"));
309 }
310 column_type__ = map_.next_value::<::std::option::Option<_>>()?.map(additional_column::ColumnType::Payload)
311;
312 }
313 GeneratedField::Subject => {
314 if column_type__.is_some() {
315 return Err(serde::de::Error::duplicate_field("subject"));
316 }
317 column_type__ = map_.next_value::<::std::option::Option<_>>()?.map(additional_column::ColumnType::Subject)
318;
319 }
320 }
321 }
322 Ok(AdditionalColumn {
323 column_type: column_type__,
324 })
325 }
326 }
327 deserializer.deserialize_struct("plan_common.AdditionalColumn", FIELDS, GeneratedVisitor)
328 }
329}
330impl serde::Serialize for AdditionalColumnFilename {
331 #[allow(deprecated)]
332 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
333 where
334 S: serde::Serializer,
335 {
336 use serde::ser::SerializeStruct;
337 let len = 0;
338 let struct_ser = serializer.serialize_struct("plan_common.AdditionalColumnFilename", len)?;
339 struct_ser.end()
340 }
341}
342impl<'de> serde::Deserialize<'de> for AdditionalColumnFilename {
343 #[allow(deprecated)]
344 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
345 where
346 D: serde::Deserializer<'de>,
347 {
348 const FIELDS: &[&str] = &[
349 ];
350
351 #[allow(clippy::enum_variant_names)]
352 enum GeneratedField {
353 }
354 impl<'de> serde::Deserialize<'de> for GeneratedField {
355 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
356 where
357 D: serde::Deserializer<'de>,
358 {
359 struct GeneratedVisitor;
360
361 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
362 type Value = GeneratedField;
363
364 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
365 write!(formatter, "expected one of: {:?}", &FIELDS)
366 }
367
368 #[allow(unused_variables)]
369 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
370 where
371 E: serde::de::Error,
372 {
373 Err(serde::de::Error::unknown_field(value, FIELDS))
374 }
375 }
376 deserializer.deserialize_identifier(GeneratedVisitor)
377 }
378 }
379 struct GeneratedVisitor;
380 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
381 type Value = AdditionalColumnFilename;
382
383 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
384 formatter.write_str("struct plan_common.AdditionalColumnFilename")
385 }
386
387 fn visit_map<V>(self, mut map_: V) -> std::result::Result<AdditionalColumnFilename, V::Error>
388 where
389 V: serde::de::MapAccess<'de>,
390 {
391 while map_.next_key::<GeneratedField>()?.is_some() {
392 let _ = map_.next_value::<serde::de::IgnoredAny>()?;
393 }
394 Ok(AdditionalColumnFilename {
395 })
396 }
397 }
398 deserializer.deserialize_struct("plan_common.AdditionalColumnFilename", FIELDS, GeneratedVisitor)
399 }
400}
401impl serde::Serialize for AdditionalColumnHeader {
402 #[allow(deprecated)]
403 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
404 where
405 S: serde::Serializer,
406 {
407 use serde::ser::SerializeStruct;
408 let mut len = 0;
409 if !self.inner_field.is_empty() {
410 len += 1;
411 }
412 if self.data_type.is_some() {
413 len += 1;
414 }
415 let mut struct_ser = serializer.serialize_struct("plan_common.AdditionalColumnHeader", len)?;
416 if !self.inner_field.is_empty() {
417 struct_ser.serialize_field("innerField", &self.inner_field)?;
418 }
419 if let Some(v) = self.data_type.as_ref() {
420 struct_ser.serialize_field("dataType", v)?;
421 }
422 struct_ser.end()
423 }
424}
425impl<'de> serde::Deserialize<'de> for AdditionalColumnHeader {
426 #[allow(deprecated)]
427 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
428 where
429 D: serde::Deserializer<'de>,
430 {
431 const FIELDS: &[&str] = &[
432 "inner_field",
433 "innerField",
434 "data_type",
435 "dataType",
436 ];
437
438 #[allow(clippy::enum_variant_names)]
439 enum GeneratedField {
440 InnerField,
441 DataType,
442 }
443 impl<'de> serde::Deserialize<'de> for GeneratedField {
444 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
445 where
446 D: serde::Deserializer<'de>,
447 {
448 struct GeneratedVisitor;
449
450 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
451 type Value = GeneratedField;
452
453 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
454 write!(formatter, "expected one of: {:?}", &FIELDS)
455 }
456
457 #[allow(unused_variables)]
458 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
459 where
460 E: serde::de::Error,
461 {
462 match value {
463 "innerField" | "inner_field" => Ok(GeneratedField::InnerField),
464 "dataType" | "data_type" => Ok(GeneratedField::DataType),
465 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
466 }
467 }
468 }
469 deserializer.deserialize_identifier(GeneratedVisitor)
470 }
471 }
472 struct GeneratedVisitor;
473 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
474 type Value = AdditionalColumnHeader;
475
476 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
477 formatter.write_str("struct plan_common.AdditionalColumnHeader")
478 }
479
480 fn visit_map<V>(self, mut map_: V) -> std::result::Result<AdditionalColumnHeader, V::Error>
481 where
482 V: serde::de::MapAccess<'de>,
483 {
484 let mut inner_field__ = None;
485 let mut data_type__ = None;
486 while let Some(k) = map_.next_key()? {
487 match k {
488 GeneratedField::InnerField => {
489 if inner_field__.is_some() {
490 return Err(serde::de::Error::duplicate_field("innerField"));
491 }
492 inner_field__ = Some(map_.next_value()?);
493 }
494 GeneratedField::DataType => {
495 if data_type__.is_some() {
496 return Err(serde::de::Error::duplicate_field("dataType"));
497 }
498 data_type__ = map_.next_value()?;
499 }
500 }
501 }
502 Ok(AdditionalColumnHeader {
503 inner_field: inner_field__.unwrap_or_default(),
504 data_type: data_type__,
505 })
506 }
507 }
508 deserializer.deserialize_struct("plan_common.AdditionalColumnHeader", FIELDS, GeneratedVisitor)
509 }
510}
511impl serde::Serialize for AdditionalColumnHeaders {
512 #[allow(deprecated)]
513 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
514 where
515 S: serde::Serializer,
516 {
517 use serde::ser::SerializeStruct;
518 let len = 0;
519 let struct_ser = serializer.serialize_struct("plan_common.AdditionalColumnHeaders", len)?;
520 struct_ser.end()
521 }
522}
523impl<'de> serde::Deserialize<'de> for AdditionalColumnHeaders {
524 #[allow(deprecated)]
525 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
526 where
527 D: serde::Deserializer<'de>,
528 {
529 const FIELDS: &[&str] = &[
530 ];
531
532 #[allow(clippy::enum_variant_names)]
533 enum GeneratedField {
534 }
535 impl<'de> serde::Deserialize<'de> for GeneratedField {
536 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
537 where
538 D: serde::Deserializer<'de>,
539 {
540 struct GeneratedVisitor;
541
542 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
543 type Value = GeneratedField;
544
545 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
546 write!(formatter, "expected one of: {:?}", &FIELDS)
547 }
548
549 #[allow(unused_variables)]
550 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
551 where
552 E: serde::de::Error,
553 {
554 Err(serde::de::Error::unknown_field(value, FIELDS))
555 }
556 }
557 deserializer.deserialize_identifier(GeneratedVisitor)
558 }
559 }
560 struct GeneratedVisitor;
561 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
562 type Value = AdditionalColumnHeaders;
563
564 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
565 formatter.write_str("struct plan_common.AdditionalColumnHeaders")
566 }
567
568 fn visit_map<V>(self, mut map_: V) -> std::result::Result<AdditionalColumnHeaders, V::Error>
569 where
570 V: serde::de::MapAccess<'de>,
571 {
572 while map_.next_key::<GeneratedField>()?.is_some() {
573 let _ = map_.next_value::<serde::de::IgnoredAny>()?;
574 }
575 Ok(AdditionalColumnHeaders {
576 })
577 }
578 }
579 deserializer.deserialize_struct("plan_common.AdditionalColumnHeaders", FIELDS, GeneratedVisitor)
580 }
581}
582impl serde::Serialize for AdditionalColumnKey {
583 #[allow(deprecated)]
584 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
585 where
586 S: serde::Serializer,
587 {
588 use serde::ser::SerializeStruct;
589 let len = 0;
590 let struct_ser = serializer.serialize_struct("plan_common.AdditionalColumnKey", len)?;
591 struct_ser.end()
592 }
593}
594impl<'de> serde::Deserialize<'de> for AdditionalColumnKey {
595 #[allow(deprecated)]
596 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
597 where
598 D: serde::Deserializer<'de>,
599 {
600 const FIELDS: &[&str] = &[
601 ];
602
603 #[allow(clippy::enum_variant_names)]
604 enum GeneratedField {
605 }
606 impl<'de> serde::Deserialize<'de> for GeneratedField {
607 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
608 where
609 D: serde::Deserializer<'de>,
610 {
611 struct GeneratedVisitor;
612
613 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
614 type Value = GeneratedField;
615
616 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
617 write!(formatter, "expected one of: {:?}", &FIELDS)
618 }
619
620 #[allow(unused_variables)]
621 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
622 where
623 E: serde::de::Error,
624 {
625 Err(serde::de::Error::unknown_field(value, FIELDS))
626 }
627 }
628 deserializer.deserialize_identifier(GeneratedVisitor)
629 }
630 }
631 struct GeneratedVisitor;
632 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
633 type Value = AdditionalColumnKey;
634
635 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
636 formatter.write_str("struct plan_common.AdditionalColumnKey")
637 }
638
639 fn visit_map<V>(self, mut map_: V) -> std::result::Result<AdditionalColumnKey, V::Error>
640 where
641 V: serde::de::MapAccess<'de>,
642 {
643 while map_.next_key::<GeneratedField>()?.is_some() {
644 let _ = map_.next_value::<serde::de::IgnoredAny>()?;
645 }
646 Ok(AdditionalColumnKey {
647 })
648 }
649 }
650 deserializer.deserialize_struct("plan_common.AdditionalColumnKey", FIELDS, GeneratedVisitor)
651 }
652}
653impl serde::Serialize for AdditionalColumnOffset {
654 #[allow(deprecated)]
655 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
656 where
657 S: serde::Serializer,
658 {
659 use serde::ser::SerializeStruct;
660 let len = 0;
661 let struct_ser = serializer.serialize_struct("plan_common.AdditionalColumnOffset", len)?;
662 struct_ser.end()
663 }
664}
665impl<'de> serde::Deserialize<'de> for AdditionalColumnOffset {
666 #[allow(deprecated)]
667 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
668 where
669 D: serde::Deserializer<'de>,
670 {
671 const FIELDS: &[&str] = &[
672 ];
673
674 #[allow(clippy::enum_variant_names)]
675 enum GeneratedField {
676 }
677 impl<'de> serde::Deserialize<'de> for GeneratedField {
678 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
679 where
680 D: serde::Deserializer<'de>,
681 {
682 struct GeneratedVisitor;
683
684 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
685 type Value = GeneratedField;
686
687 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
688 write!(formatter, "expected one of: {:?}", &FIELDS)
689 }
690
691 #[allow(unused_variables)]
692 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
693 where
694 E: serde::de::Error,
695 {
696 Err(serde::de::Error::unknown_field(value, FIELDS))
697 }
698 }
699 deserializer.deserialize_identifier(GeneratedVisitor)
700 }
701 }
702 struct GeneratedVisitor;
703 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
704 type Value = AdditionalColumnOffset;
705
706 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
707 formatter.write_str("struct plan_common.AdditionalColumnOffset")
708 }
709
710 fn visit_map<V>(self, mut map_: V) -> std::result::Result<AdditionalColumnOffset, V::Error>
711 where
712 V: serde::de::MapAccess<'de>,
713 {
714 while map_.next_key::<GeneratedField>()?.is_some() {
715 let _ = map_.next_value::<serde::de::IgnoredAny>()?;
716 }
717 Ok(AdditionalColumnOffset {
718 })
719 }
720 }
721 deserializer.deserialize_struct("plan_common.AdditionalColumnOffset", FIELDS, GeneratedVisitor)
722 }
723}
724impl serde::Serialize for AdditionalColumnPartition {
725 #[allow(deprecated)]
726 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
727 where
728 S: serde::Serializer,
729 {
730 use serde::ser::SerializeStruct;
731 let len = 0;
732 let struct_ser = serializer.serialize_struct("plan_common.AdditionalColumnPartition", len)?;
733 struct_ser.end()
734 }
735}
736impl<'de> serde::Deserialize<'de> for AdditionalColumnPartition {
737 #[allow(deprecated)]
738 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
739 where
740 D: serde::Deserializer<'de>,
741 {
742 const FIELDS: &[&str] = &[
743 ];
744
745 #[allow(clippy::enum_variant_names)]
746 enum GeneratedField {
747 }
748 impl<'de> serde::Deserialize<'de> for GeneratedField {
749 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
750 where
751 D: serde::Deserializer<'de>,
752 {
753 struct GeneratedVisitor;
754
755 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
756 type Value = GeneratedField;
757
758 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
759 write!(formatter, "expected one of: {:?}", &FIELDS)
760 }
761
762 #[allow(unused_variables)]
763 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
764 where
765 E: serde::de::Error,
766 {
767 Err(serde::de::Error::unknown_field(value, FIELDS))
768 }
769 }
770 deserializer.deserialize_identifier(GeneratedVisitor)
771 }
772 }
773 struct GeneratedVisitor;
774 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
775 type Value = AdditionalColumnPartition;
776
777 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
778 formatter.write_str("struct plan_common.AdditionalColumnPartition")
779 }
780
781 fn visit_map<V>(self, mut map_: V) -> std::result::Result<AdditionalColumnPartition, V::Error>
782 where
783 V: serde::de::MapAccess<'de>,
784 {
785 while map_.next_key::<GeneratedField>()?.is_some() {
786 let _ = map_.next_value::<serde::de::IgnoredAny>()?;
787 }
788 Ok(AdditionalColumnPartition {
789 })
790 }
791 }
792 deserializer.deserialize_struct("plan_common.AdditionalColumnPartition", FIELDS, GeneratedVisitor)
793 }
794}
795impl serde::Serialize for AdditionalColumnPayload {
796 #[allow(deprecated)]
797 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
798 where
799 S: serde::Serializer,
800 {
801 use serde::ser::SerializeStruct;
802 let len = 0;
803 let struct_ser = serializer.serialize_struct("plan_common.AdditionalColumnPayload", len)?;
804 struct_ser.end()
805 }
806}
807impl<'de> serde::Deserialize<'de> for AdditionalColumnPayload {
808 #[allow(deprecated)]
809 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
810 where
811 D: serde::Deserializer<'de>,
812 {
813 const FIELDS: &[&str] = &[
814 ];
815
816 #[allow(clippy::enum_variant_names)]
817 enum GeneratedField {
818 }
819 impl<'de> serde::Deserialize<'de> for GeneratedField {
820 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
821 where
822 D: serde::Deserializer<'de>,
823 {
824 struct GeneratedVisitor;
825
826 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
827 type Value = GeneratedField;
828
829 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
830 write!(formatter, "expected one of: {:?}", &FIELDS)
831 }
832
833 #[allow(unused_variables)]
834 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
835 where
836 E: serde::de::Error,
837 {
838 Err(serde::de::Error::unknown_field(value, FIELDS))
839 }
840 }
841 deserializer.deserialize_identifier(GeneratedVisitor)
842 }
843 }
844 struct GeneratedVisitor;
845 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
846 type Value = AdditionalColumnPayload;
847
848 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
849 formatter.write_str("struct plan_common.AdditionalColumnPayload")
850 }
851
852 fn visit_map<V>(self, mut map_: V) -> std::result::Result<AdditionalColumnPayload, V::Error>
853 where
854 V: serde::de::MapAccess<'de>,
855 {
856 while map_.next_key::<GeneratedField>()?.is_some() {
857 let _ = map_.next_value::<serde::de::IgnoredAny>()?;
858 }
859 Ok(AdditionalColumnPayload {
860 })
861 }
862 }
863 deserializer.deserialize_struct("plan_common.AdditionalColumnPayload", FIELDS, GeneratedVisitor)
864 }
865}
866impl serde::Serialize for AdditionalColumnTimestamp {
867 #[allow(deprecated)]
868 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
869 where
870 S: serde::Serializer,
871 {
872 use serde::ser::SerializeStruct;
873 let len = 0;
874 let struct_ser = serializer.serialize_struct("plan_common.AdditionalColumnTimestamp", len)?;
875 struct_ser.end()
876 }
877}
878impl<'de> serde::Deserialize<'de> for AdditionalColumnTimestamp {
879 #[allow(deprecated)]
880 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
881 where
882 D: serde::Deserializer<'de>,
883 {
884 const FIELDS: &[&str] = &[
885 ];
886
887 #[allow(clippy::enum_variant_names)]
888 enum GeneratedField {
889 }
890 impl<'de> serde::Deserialize<'de> for GeneratedField {
891 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
892 where
893 D: serde::Deserializer<'de>,
894 {
895 struct GeneratedVisitor;
896
897 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
898 type Value = GeneratedField;
899
900 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
901 write!(formatter, "expected one of: {:?}", &FIELDS)
902 }
903
904 #[allow(unused_variables)]
905 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
906 where
907 E: serde::de::Error,
908 {
909 Err(serde::de::Error::unknown_field(value, FIELDS))
910 }
911 }
912 deserializer.deserialize_identifier(GeneratedVisitor)
913 }
914 }
915 struct GeneratedVisitor;
916 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
917 type Value = AdditionalColumnTimestamp;
918
919 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
920 formatter.write_str("struct plan_common.AdditionalColumnTimestamp")
921 }
922
923 fn visit_map<V>(self, mut map_: V) -> std::result::Result<AdditionalColumnTimestamp, V::Error>
924 where
925 V: serde::de::MapAccess<'de>,
926 {
927 while map_.next_key::<GeneratedField>()?.is_some() {
928 let _ = map_.next_value::<serde::de::IgnoredAny>()?;
929 }
930 Ok(AdditionalColumnTimestamp {
931 })
932 }
933 }
934 deserializer.deserialize_struct("plan_common.AdditionalColumnTimestamp", FIELDS, GeneratedVisitor)
935 }
936}
937impl serde::Serialize for AdditionalColumnType {
938 #[allow(deprecated)]
939 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
940 where
941 S: serde::Serializer,
942 {
943 let variant = match self {
944 Self::Unspecified => "ADDITIONAL_COLUMN_TYPE_UNSPECIFIED",
945 Self::Key => "ADDITIONAL_COLUMN_TYPE_KEY",
946 Self::Timestamp => "ADDITIONAL_COLUMN_TYPE_TIMESTAMP",
947 Self::Partition => "ADDITIONAL_COLUMN_TYPE_PARTITION",
948 Self::Offset => "ADDITIONAL_COLUMN_TYPE_OFFSET",
949 Self::Header => "ADDITIONAL_COLUMN_TYPE_HEADER",
950 Self::Filename => "ADDITIONAL_COLUMN_TYPE_FILENAME",
951 Self::Normal => "ADDITIONAL_COLUMN_TYPE_NORMAL",
952 Self::Payload => "ADDITIONAL_COLUMN_TYPE_PAYLOAD",
953 };
954 serializer.serialize_str(variant)
955 }
956}
957impl<'de> serde::Deserialize<'de> for AdditionalColumnType {
958 #[allow(deprecated)]
959 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
960 where
961 D: serde::Deserializer<'de>,
962 {
963 const FIELDS: &[&str] = &[
964 "ADDITIONAL_COLUMN_TYPE_UNSPECIFIED",
965 "ADDITIONAL_COLUMN_TYPE_KEY",
966 "ADDITIONAL_COLUMN_TYPE_TIMESTAMP",
967 "ADDITIONAL_COLUMN_TYPE_PARTITION",
968 "ADDITIONAL_COLUMN_TYPE_OFFSET",
969 "ADDITIONAL_COLUMN_TYPE_HEADER",
970 "ADDITIONAL_COLUMN_TYPE_FILENAME",
971 "ADDITIONAL_COLUMN_TYPE_NORMAL",
972 "ADDITIONAL_COLUMN_TYPE_PAYLOAD",
973 ];
974
975 struct GeneratedVisitor;
976
977 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
978 type Value = AdditionalColumnType;
979
980 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
981 write!(formatter, "expected one of: {:?}", &FIELDS)
982 }
983
984 fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
985 where
986 E: serde::de::Error,
987 {
988 i32::try_from(v)
989 .ok()
990 .and_then(|x| x.try_into().ok())
991 .ok_or_else(|| {
992 serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
993 })
994 }
995
996 fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
997 where
998 E: serde::de::Error,
999 {
1000 i32::try_from(v)
1001 .ok()
1002 .and_then(|x| x.try_into().ok())
1003 .ok_or_else(|| {
1004 serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
1005 })
1006 }
1007
1008 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1009 where
1010 E: serde::de::Error,
1011 {
1012 match value {
1013 "ADDITIONAL_COLUMN_TYPE_UNSPECIFIED" => Ok(AdditionalColumnType::Unspecified),
1014 "ADDITIONAL_COLUMN_TYPE_KEY" => Ok(AdditionalColumnType::Key),
1015 "ADDITIONAL_COLUMN_TYPE_TIMESTAMP" => Ok(AdditionalColumnType::Timestamp),
1016 "ADDITIONAL_COLUMN_TYPE_PARTITION" => Ok(AdditionalColumnType::Partition),
1017 "ADDITIONAL_COLUMN_TYPE_OFFSET" => Ok(AdditionalColumnType::Offset),
1018 "ADDITIONAL_COLUMN_TYPE_HEADER" => Ok(AdditionalColumnType::Header),
1019 "ADDITIONAL_COLUMN_TYPE_FILENAME" => Ok(AdditionalColumnType::Filename),
1020 "ADDITIONAL_COLUMN_TYPE_NORMAL" => Ok(AdditionalColumnType::Normal),
1021 "ADDITIONAL_COLUMN_TYPE_PAYLOAD" => Ok(AdditionalColumnType::Payload),
1022 _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
1023 }
1024 }
1025 }
1026 deserializer.deserialize_any(GeneratedVisitor)
1027 }
1028}
1029impl serde::Serialize for AdditionalDatabaseName {
1030 #[allow(deprecated)]
1031 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1032 where
1033 S: serde::Serializer,
1034 {
1035 use serde::ser::SerializeStruct;
1036 let len = 0;
1037 let struct_ser = serializer.serialize_struct("plan_common.AdditionalDatabaseName", len)?;
1038 struct_ser.end()
1039 }
1040}
1041impl<'de> serde::Deserialize<'de> for AdditionalDatabaseName {
1042 #[allow(deprecated)]
1043 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1044 where
1045 D: serde::Deserializer<'de>,
1046 {
1047 const FIELDS: &[&str] = &[
1048 ];
1049
1050 #[allow(clippy::enum_variant_names)]
1051 enum GeneratedField {
1052 }
1053 impl<'de> serde::Deserialize<'de> for GeneratedField {
1054 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1055 where
1056 D: serde::Deserializer<'de>,
1057 {
1058 struct GeneratedVisitor;
1059
1060 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1061 type Value = GeneratedField;
1062
1063 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1064 write!(formatter, "expected one of: {:?}", &FIELDS)
1065 }
1066
1067 #[allow(unused_variables)]
1068 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1069 where
1070 E: serde::de::Error,
1071 {
1072 Err(serde::de::Error::unknown_field(value, FIELDS))
1073 }
1074 }
1075 deserializer.deserialize_identifier(GeneratedVisitor)
1076 }
1077 }
1078 struct GeneratedVisitor;
1079 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1080 type Value = AdditionalDatabaseName;
1081
1082 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1083 formatter.write_str("struct plan_common.AdditionalDatabaseName")
1084 }
1085
1086 fn visit_map<V>(self, mut map_: V) -> std::result::Result<AdditionalDatabaseName, V::Error>
1087 where
1088 V: serde::de::MapAccess<'de>,
1089 {
1090 while map_.next_key::<GeneratedField>()?.is_some() {
1091 let _ = map_.next_value::<serde::de::IgnoredAny>()?;
1092 }
1093 Ok(AdditionalDatabaseName {
1094 })
1095 }
1096 }
1097 deserializer.deserialize_struct("plan_common.AdditionalDatabaseName", FIELDS, GeneratedVisitor)
1098 }
1099}
1100impl serde::Serialize for AdditionalSchemaName {
1101 #[allow(deprecated)]
1102 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1103 where
1104 S: serde::Serializer,
1105 {
1106 use serde::ser::SerializeStruct;
1107 let len = 0;
1108 let struct_ser = serializer.serialize_struct("plan_common.AdditionalSchemaName", len)?;
1109 struct_ser.end()
1110 }
1111}
1112impl<'de> serde::Deserialize<'de> for AdditionalSchemaName {
1113 #[allow(deprecated)]
1114 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1115 where
1116 D: serde::Deserializer<'de>,
1117 {
1118 const FIELDS: &[&str] = &[
1119 ];
1120
1121 #[allow(clippy::enum_variant_names)]
1122 enum GeneratedField {
1123 }
1124 impl<'de> serde::Deserialize<'de> for GeneratedField {
1125 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1126 where
1127 D: serde::Deserializer<'de>,
1128 {
1129 struct GeneratedVisitor;
1130
1131 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1132 type Value = GeneratedField;
1133
1134 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1135 write!(formatter, "expected one of: {:?}", &FIELDS)
1136 }
1137
1138 #[allow(unused_variables)]
1139 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1140 where
1141 E: serde::de::Error,
1142 {
1143 Err(serde::de::Error::unknown_field(value, FIELDS))
1144 }
1145 }
1146 deserializer.deserialize_identifier(GeneratedVisitor)
1147 }
1148 }
1149 struct GeneratedVisitor;
1150 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1151 type Value = AdditionalSchemaName;
1152
1153 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1154 formatter.write_str("struct plan_common.AdditionalSchemaName")
1155 }
1156
1157 fn visit_map<V>(self, mut map_: V) -> std::result::Result<AdditionalSchemaName, V::Error>
1158 where
1159 V: serde::de::MapAccess<'de>,
1160 {
1161 while map_.next_key::<GeneratedField>()?.is_some() {
1162 let _ = map_.next_value::<serde::de::IgnoredAny>()?;
1163 }
1164 Ok(AdditionalSchemaName {
1165 })
1166 }
1167 }
1168 deserializer.deserialize_struct("plan_common.AdditionalSchemaName", FIELDS, GeneratedVisitor)
1169 }
1170}
1171impl serde::Serialize for AdditionalSubject {
1172 #[allow(deprecated)]
1173 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1174 where
1175 S: serde::Serializer,
1176 {
1177 use serde::ser::SerializeStruct;
1178 let len = 0;
1179 let struct_ser = serializer.serialize_struct("plan_common.AdditionalSubject", len)?;
1180 struct_ser.end()
1181 }
1182}
1183impl<'de> serde::Deserialize<'de> for AdditionalSubject {
1184 #[allow(deprecated)]
1185 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1186 where
1187 D: serde::Deserializer<'de>,
1188 {
1189 const FIELDS: &[&str] = &[
1190 ];
1191
1192 #[allow(clippy::enum_variant_names)]
1193 enum GeneratedField {
1194 }
1195 impl<'de> serde::Deserialize<'de> for GeneratedField {
1196 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1197 where
1198 D: serde::Deserializer<'de>,
1199 {
1200 struct GeneratedVisitor;
1201
1202 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1203 type Value = GeneratedField;
1204
1205 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1206 write!(formatter, "expected one of: {:?}", &FIELDS)
1207 }
1208
1209 #[allow(unused_variables)]
1210 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1211 where
1212 E: serde::de::Error,
1213 {
1214 Err(serde::de::Error::unknown_field(value, FIELDS))
1215 }
1216 }
1217 deserializer.deserialize_identifier(GeneratedVisitor)
1218 }
1219 }
1220 struct GeneratedVisitor;
1221 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1222 type Value = AdditionalSubject;
1223
1224 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1225 formatter.write_str("struct plan_common.AdditionalSubject")
1226 }
1227
1228 fn visit_map<V>(self, mut map_: V) -> std::result::Result<AdditionalSubject, V::Error>
1229 where
1230 V: serde::de::MapAccess<'de>,
1231 {
1232 while map_.next_key::<GeneratedField>()?.is_some() {
1233 let _ = map_.next_value::<serde::de::IgnoredAny>()?;
1234 }
1235 Ok(AdditionalSubject {
1236 })
1237 }
1238 }
1239 deserializer.deserialize_struct("plan_common.AdditionalSubject", FIELDS, GeneratedVisitor)
1240 }
1241}
1242impl serde::Serialize for AdditionalTableName {
1243 #[allow(deprecated)]
1244 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1245 where
1246 S: serde::Serializer,
1247 {
1248 use serde::ser::SerializeStruct;
1249 let len = 0;
1250 let struct_ser = serializer.serialize_struct("plan_common.AdditionalTableName", len)?;
1251 struct_ser.end()
1252 }
1253}
1254impl<'de> serde::Deserialize<'de> for AdditionalTableName {
1255 #[allow(deprecated)]
1256 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1257 where
1258 D: serde::Deserializer<'de>,
1259 {
1260 const FIELDS: &[&str] = &[
1261 ];
1262
1263 #[allow(clippy::enum_variant_names)]
1264 enum GeneratedField {
1265 }
1266 impl<'de> serde::Deserialize<'de> for GeneratedField {
1267 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1268 where
1269 D: serde::Deserializer<'de>,
1270 {
1271 struct GeneratedVisitor;
1272
1273 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1274 type Value = GeneratedField;
1275
1276 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1277 write!(formatter, "expected one of: {:?}", &FIELDS)
1278 }
1279
1280 #[allow(unused_variables)]
1281 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1282 where
1283 E: serde::de::Error,
1284 {
1285 Err(serde::de::Error::unknown_field(value, FIELDS))
1286 }
1287 }
1288 deserializer.deserialize_identifier(GeneratedVisitor)
1289 }
1290 }
1291 struct GeneratedVisitor;
1292 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1293 type Value = AdditionalTableName;
1294
1295 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1296 formatter.write_str("struct plan_common.AdditionalTableName")
1297 }
1298
1299 fn visit_map<V>(self, mut map_: V) -> std::result::Result<AdditionalTableName, V::Error>
1300 where
1301 V: serde::de::MapAccess<'de>,
1302 {
1303 while map_.next_key::<GeneratedField>()?.is_some() {
1304 let _ = map_.next_value::<serde::de::IgnoredAny>()?;
1305 }
1306 Ok(AdditionalTableName {
1307 })
1308 }
1309 }
1310 deserializer.deserialize_struct("plan_common.AdditionalTableName", FIELDS, GeneratedVisitor)
1311 }
1312}
1313impl serde::Serialize for AsOf {
1314 #[allow(deprecated)]
1315 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1316 where
1317 S: serde::Serializer,
1318 {
1319 use serde::ser::SerializeStruct;
1320 let mut len = 0;
1321 if self.as_of_type.is_some() {
1322 len += 1;
1323 }
1324 let mut struct_ser = serializer.serialize_struct("plan_common.AsOf", len)?;
1325 if let Some(v) = self.as_of_type.as_ref() {
1326 match v {
1327 as_of::AsOfType::ProcessTime(v) => {
1328 struct_ser.serialize_field("processTime", v)?;
1329 }
1330 as_of::AsOfType::Timestamp(v) => {
1331 struct_ser.serialize_field("timestamp", v)?;
1332 }
1333 as_of::AsOfType::Version(v) => {
1334 struct_ser.serialize_field("version", v)?;
1335 }
1336 }
1337 }
1338 struct_ser.end()
1339 }
1340}
1341impl<'de> serde::Deserialize<'de> for AsOf {
1342 #[allow(deprecated)]
1343 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1344 where
1345 D: serde::Deserializer<'de>,
1346 {
1347 const FIELDS: &[&str] = &[
1348 "process_time",
1349 "processTime",
1350 "timestamp",
1351 "version",
1352 ];
1353
1354 #[allow(clippy::enum_variant_names)]
1355 enum GeneratedField {
1356 ProcessTime,
1357 Timestamp,
1358 Version,
1359 }
1360 impl<'de> serde::Deserialize<'de> for GeneratedField {
1361 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1362 where
1363 D: serde::Deserializer<'de>,
1364 {
1365 struct GeneratedVisitor;
1366
1367 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1368 type Value = GeneratedField;
1369
1370 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1371 write!(formatter, "expected one of: {:?}", &FIELDS)
1372 }
1373
1374 #[allow(unused_variables)]
1375 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1376 where
1377 E: serde::de::Error,
1378 {
1379 match value {
1380 "processTime" | "process_time" => Ok(GeneratedField::ProcessTime),
1381 "timestamp" => Ok(GeneratedField::Timestamp),
1382 "version" => Ok(GeneratedField::Version),
1383 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1384 }
1385 }
1386 }
1387 deserializer.deserialize_identifier(GeneratedVisitor)
1388 }
1389 }
1390 struct GeneratedVisitor;
1391 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1392 type Value = AsOf;
1393
1394 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1395 formatter.write_str("struct plan_common.AsOf")
1396 }
1397
1398 fn visit_map<V>(self, mut map_: V) -> std::result::Result<AsOf, V::Error>
1399 where
1400 V: serde::de::MapAccess<'de>,
1401 {
1402 let mut as_of_type__ = None;
1403 while let Some(k) = map_.next_key()? {
1404 match k {
1405 GeneratedField::ProcessTime => {
1406 if as_of_type__.is_some() {
1407 return Err(serde::de::Error::duplicate_field("processTime"));
1408 }
1409 as_of_type__ = map_.next_value::<::std::option::Option<_>>()?.map(as_of::AsOfType::ProcessTime)
1410;
1411 }
1412 GeneratedField::Timestamp => {
1413 if as_of_type__.is_some() {
1414 return Err(serde::de::Error::duplicate_field("timestamp"));
1415 }
1416 as_of_type__ = map_.next_value::<::std::option::Option<_>>()?.map(as_of::AsOfType::Timestamp)
1417;
1418 }
1419 GeneratedField::Version => {
1420 if as_of_type__.is_some() {
1421 return Err(serde::de::Error::duplicate_field("version"));
1422 }
1423 as_of_type__ = map_.next_value::<::std::option::Option<_>>()?.map(as_of::AsOfType::Version)
1424;
1425 }
1426 }
1427 }
1428 Ok(AsOf {
1429 as_of_type: as_of_type__,
1430 })
1431 }
1432 }
1433 deserializer.deserialize_struct("plan_common.AsOf", FIELDS, GeneratedVisitor)
1434 }
1435}
1436impl serde::Serialize for as_of::ProcessTime {
1437 #[allow(deprecated)]
1438 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1439 where
1440 S: serde::Serializer,
1441 {
1442 use serde::ser::SerializeStruct;
1443 let len = 0;
1444 let struct_ser = serializer.serialize_struct("plan_common.AsOf.ProcessTime", len)?;
1445 struct_ser.end()
1446 }
1447}
1448impl<'de> serde::Deserialize<'de> for as_of::ProcessTime {
1449 #[allow(deprecated)]
1450 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1451 where
1452 D: serde::Deserializer<'de>,
1453 {
1454 const FIELDS: &[&str] = &[
1455 ];
1456
1457 #[allow(clippy::enum_variant_names)]
1458 enum GeneratedField {
1459 }
1460 impl<'de> serde::Deserialize<'de> for GeneratedField {
1461 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1462 where
1463 D: serde::Deserializer<'de>,
1464 {
1465 struct GeneratedVisitor;
1466
1467 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1468 type Value = GeneratedField;
1469
1470 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1471 write!(formatter, "expected one of: {:?}", &FIELDS)
1472 }
1473
1474 #[allow(unused_variables)]
1475 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1476 where
1477 E: serde::de::Error,
1478 {
1479 Err(serde::de::Error::unknown_field(value, FIELDS))
1480 }
1481 }
1482 deserializer.deserialize_identifier(GeneratedVisitor)
1483 }
1484 }
1485 struct GeneratedVisitor;
1486 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1487 type Value = as_of::ProcessTime;
1488
1489 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1490 formatter.write_str("struct plan_common.AsOf.ProcessTime")
1491 }
1492
1493 fn visit_map<V>(self, mut map_: V) -> std::result::Result<as_of::ProcessTime, V::Error>
1494 where
1495 V: serde::de::MapAccess<'de>,
1496 {
1497 while map_.next_key::<GeneratedField>()?.is_some() {
1498 let _ = map_.next_value::<serde::de::IgnoredAny>()?;
1499 }
1500 Ok(as_of::ProcessTime {
1501 })
1502 }
1503 }
1504 deserializer.deserialize_struct("plan_common.AsOf.ProcessTime", FIELDS, GeneratedVisitor)
1505 }
1506}
1507impl serde::Serialize for as_of::Timestamp {
1508 #[allow(deprecated)]
1509 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1510 where
1511 S: serde::Serializer,
1512 {
1513 use serde::ser::SerializeStruct;
1514 let mut len = 0;
1515 if self.timestamp != 0 {
1516 len += 1;
1517 }
1518 let mut struct_ser = serializer.serialize_struct("plan_common.AsOf.Timestamp", len)?;
1519 if self.timestamp != 0 {
1520 #[allow(clippy::needless_borrow)]
1521 #[allow(clippy::needless_borrows_for_generic_args)]
1522 struct_ser.serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?;
1523 }
1524 struct_ser.end()
1525 }
1526}
1527impl<'de> serde::Deserialize<'de> for as_of::Timestamp {
1528 #[allow(deprecated)]
1529 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1530 where
1531 D: serde::Deserializer<'de>,
1532 {
1533 const FIELDS: &[&str] = &[
1534 "timestamp",
1535 ];
1536
1537 #[allow(clippy::enum_variant_names)]
1538 enum GeneratedField {
1539 Timestamp,
1540 }
1541 impl<'de> serde::Deserialize<'de> for GeneratedField {
1542 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1543 where
1544 D: serde::Deserializer<'de>,
1545 {
1546 struct GeneratedVisitor;
1547
1548 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1549 type Value = GeneratedField;
1550
1551 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1552 write!(formatter, "expected one of: {:?}", &FIELDS)
1553 }
1554
1555 #[allow(unused_variables)]
1556 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1557 where
1558 E: serde::de::Error,
1559 {
1560 match value {
1561 "timestamp" => Ok(GeneratedField::Timestamp),
1562 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1563 }
1564 }
1565 }
1566 deserializer.deserialize_identifier(GeneratedVisitor)
1567 }
1568 }
1569 struct GeneratedVisitor;
1570 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1571 type Value = as_of::Timestamp;
1572
1573 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1574 formatter.write_str("struct plan_common.AsOf.Timestamp")
1575 }
1576
1577 fn visit_map<V>(self, mut map_: V) -> std::result::Result<as_of::Timestamp, V::Error>
1578 where
1579 V: serde::de::MapAccess<'de>,
1580 {
1581 let mut timestamp__ = None;
1582 while let Some(k) = map_.next_key()? {
1583 match k {
1584 GeneratedField::Timestamp => {
1585 if timestamp__.is_some() {
1586 return Err(serde::de::Error::duplicate_field("timestamp"));
1587 }
1588 timestamp__ =
1589 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1590 ;
1591 }
1592 }
1593 }
1594 Ok(as_of::Timestamp {
1595 timestamp: timestamp__.unwrap_or_default(),
1596 })
1597 }
1598 }
1599 deserializer.deserialize_struct("plan_common.AsOf.Timestamp", FIELDS, GeneratedVisitor)
1600 }
1601}
1602impl serde::Serialize for as_of::Version {
1603 #[allow(deprecated)]
1604 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1605 where
1606 S: serde::Serializer,
1607 {
1608 use serde::ser::SerializeStruct;
1609 let mut len = 0;
1610 if self.version != 0 {
1611 len += 1;
1612 }
1613 let mut struct_ser = serializer.serialize_struct("plan_common.AsOf.Version", len)?;
1614 if self.version != 0 {
1615 #[allow(clippy::needless_borrow)]
1616 #[allow(clippy::needless_borrows_for_generic_args)]
1617 struct_ser.serialize_field("version", ToString::to_string(&self.version).as_str())?;
1618 }
1619 struct_ser.end()
1620 }
1621}
1622impl<'de> serde::Deserialize<'de> for as_of::Version {
1623 #[allow(deprecated)]
1624 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1625 where
1626 D: serde::Deserializer<'de>,
1627 {
1628 const FIELDS: &[&str] = &[
1629 "version",
1630 ];
1631
1632 #[allow(clippy::enum_variant_names)]
1633 enum GeneratedField {
1634 Version,
1635 }
1636 impl<'de> serde::Deserialize<'de> for GeneratedField {
1637 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1638 where
1639 D: serde::Deserializer<'de>,
1640 {
1641 struct GeneratedVisitor;
1642
1643 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1644 type Value = GeneratedField;
1645
1646 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1647 write!(formatter, "expected one of: {:?}", &FIELDS)
1648 }
1649
1650 #[allow(unused_variables)]
1651 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1652 where
1653 E: serde::de::Error,
1654 {
1655 match value {
1656 "version" => Ok(GeneratedField::Version),
1657 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1658 }
1659 }
1660 }
1661 deserializer.deserialize_identifier(GeneratedVisitor)
1662 }
1663 }
1664 struct GeneratedVisitor;
1665 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1666 type Value = as_of::Version;
1667
1668 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1669 formatter.write_str("struct plan_common.AsOf.Version")
1670 }
1671
1672 fn visit_map<V>(self, mut map_: V) -> std::result::Result<as_of::Version, V::Error>
1673 where
1674 V: serde::de::MapAccess<'de>,
1675 {
1676 let mut version__ = None;
1677 while let Some(k) = map_.next_key()? {
1678 match k {
1679 GeneratedField::Version => {
1680 if version__.is_some() {
1681 return Err(serde::de::Error::duplicate_field("version"));
1682 }
1683 version__ =
1684 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1685 ;
1686 }
1687 }
1688 }
1689 Ok(as_of::Version {
1690 version: version__.unwrap_or_default(),
1691 })
1692 }
1693 }
1694 deserializer.deserialize_struct("plan_common.AsOf.Version", FIELDS, GeneratedVisitor)
1695 }
1696}
1697impl serde::Serialize for AsOfJoinDesc {
1698 #[allow(deprecated)]
1699 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1700 where
1701 S: serde::Serializer,
1702 {
1703 use serde::ser::SerializeStruct;
1704 let mut len = 0;
1705 if self.right_idx != 0 {
1706 len += 1;
1707 }
1708 if self.left_idx != 0 {
1709 len += 1;
1710 }
1711 if self.inequality_type != 0 {
1712 len += 1;
1713 }
1714 let mut struct_ser = serializer.serialize_struct("plan_common.AsOfJoinDesc", len)?;
1715 if self.right_idx != 0 {
1716 struct_ser.serialize_field("rightIdx", &self.right_idx)?;
1717 }
1718 if self.left_idx != 0 {
1719 struct_ser.serialize_field("leftIdx", &self.left_idx)?;
1720 }
1721 if self.inequality_type != 0 {
1722 let v = AsOfJoinInequalityType::try_from(self.inequality_type)
1723 .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.inequality_type)))?;
1724 struct_ser.serialize_field("inequalityType", &v)?;
1725 }
1726 struct_ser.end()
1727 }
1728}
1729impl<'de> serde::Deserialize<'de> for AsOfJoinDesc {
1730 #[allow(deprecated)]
1731 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1732 where
1733 D: serde::Deserializer<'de>,
1734 {
1735 const FIELDS: &[&str] = &[
1736 "right_idx",
1737 "rightIdx",
1738 "left_idx",
1739 "leftIdx",
1740 "inequality_type",
1741 "inequalityType",
1742 ];
1743
1744 #[allow(clippy::enum_variant_names)]
1745 enum GeneratedField {
1746 RightIdx,
1747 LeftIdx,
1748 InequalityType,
1749 }
1750 impl<'de> serde::Deserialize<'de> for GeneratedField {
1751 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
1752 where
1753 D: serde::Deserializer<'de>,
1754 {
1755 struct GeneratedVisitor;
1756
1757 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1758 type Value = GeneratedField;
1759
1760 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1761 write!(formatter, "expected one of: {:?}", &FIELDS)
1762 }
1763
1764 #[allow(unused_variables)]
1765 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
1766 where
1767 E: serde::de::Error,
1768 {
1769 match value {
1770 "rightIdx" | "right_idx" => Ok(GeneratedField::RightIdx),
1771 "leftIdx" | "left_idx" => Ok(GeneratedField::LeftIdx),
1772 "inequalityType" | "inequality_type" => Ok(GeneratedField::InequalityType),
1773 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
1774 }
1775 }
1776 }
1777 deserializer.deserialize_identifier(GeneratedVisitor)
1778 }
1779 }
1780 struct GeneratedVisitor;
1781 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1782 type Value = AsOfJoinDesc;
1783
1784 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1785 formatter.write_str("struct plan_common.AsOfJoinDesc")
1786 }
1787
1788 fn visit_map<V>(self, mut map_: V) -> std::result::Result<AsOfJoinDesc, V::Error>
1789 where
1790 V: serde::de::MapAccess<'de>,
1791 {
1792 let mut right_idx__ = None;
1793 let mut left_idx__ = None;
1794 let mut inequality_type__ = None;
1795 while let Some(k) = map_.next_key()? {
1796 match k {
1797 GeneratedField::RightIdx => {
1798 if right_idx__.is_some() {
1799 return Err(serde::de::Error::duplicate_field("rightIdx"));
1800 }
1801 right_idx__ =
1802 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1803 ;
1804 }
1805 GeneratedField::LeftIdx => {
1806 if left_idx__.is_some() {
1807 return Err(serde::de::Error::duplicate_field("leftIdx"));
1808 }
1809 left_idx__ =
1810 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
1811 ;
1812 }
1813 GeneratedField::InequalityType => {
1814 if inequality_type__.is_some() {
1815 return Err(serde::de::Error::duplicate_field("inequalityType"));
1816 }
1817 inequality_type__ = Some(map_.next_value::<AsOfJoinInequalityType>()? as i32);
1818 }
1819 }
1820 }
1821 Ok(AsOfJoinDesc {
1822 right_idx: right_idx__.unwrap_or_default(),
1823 left_idx: left_idx__.unwrap_or_default(),
1824 inequality_type: inequality_type__.unwrap_or_default(),
1825 })
1826 }
1827 }
1828 deserializer.deserialize_struct("plan_common.AsOfJoinDesc", FIELDS, GeneratedVisitor)
1829 }
1830}
1831impl serde::Serialize for AsOfJoinInequalityType {
1832 #[allow(deprecated)]
1833 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1834 where
1835 S: serde::Serializer,
1836 {
1837 let variant = match self {
1838 Self::AsOfInequalityTypeUnspecified => "AS_OF_INEQUALITY_TYPE_UNSPECIFIED",
1839 Self::AsOfInequalityTypeGt => "AS_OF_INEQUALITY_TYPE_GT",
1840 Self::AsOfInequalityTypeGe => "AS_OF_INEQUALITY_TYPE_GE",
1841 Self::AsOfInequalityTypeLt => "AS_OF_INEQUALITY_TYPE_LT",
1842 Self::AsOfInequalityTypeLe => "AS_OF_INEQUALITY_TYPE_LE",
1843 };
1844 serializer.serialize_str(variant)
1845 }
1846}
1847impl<'de> serde::Deserialize<'de> for AsOfJoinInequalityType {
1848 #[allow(deprecated)]
1849 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1850 where
1851 D: serde::Deserializer<'de>,
1852 {
1853 const FIELDS: &[&str] = &[
1854 "AS_OF_INEQUALITY_TYPE_UNSPECIFIED",
1855 "AS_OF_INEQUALITY_TYPE_GT",
1856 "AS_OF_INEQUALITY_TYPE_GE",
1857 "AS_OF_INEQUALITY_TYPE_LT",
1858 "AS_OF_INEQUALITY_TYPE_LE",
1859 ];
1860
1861 struct GeneratedVisitor;
1862
1863 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1864 type Value = AsOfJoinInequalityType;
1865
1866 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1867 write!(formatter, "expected one of: {:?}", &FIELDS)
1868 }
1869
1870 fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
1871 where
1872 E: serde::de::Error,
1873 {
1874 i32::try_from(v)
1875 .ok()
1876 .and_then(|x| x.try_into().ok())
1877 .ok_or_else(|| {
1878 serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
1879 })
1880 }
1881
1882 fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
1883 where
1884 E: serde::de::Error,
1885 {
1886 i32::try_from(v)
1887 .ok()
1888 .and_then(|x| x.try_into().ok())
1889 .ok_or_else(|| {
1890 serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
1891 })
1892 }
1893
1894 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1895 where
1896 E: serde::de::Error,
1897 {
1898 match value {
1899 "AS_OF_INEQUALITY_TYPE_UNSPECIFIED" => Ok(AsOfJoinInequalityType::AsOfInequalityTypeUnspecified),
1900 "AS_OF_INEQUALITY_TYPE_GT" => Ok(AsOfJoinInequalityType::AsOfInequalityTypeGt),
1901 "AS_OF_INEQUALITY_TYPE_GE" => Ok(AsOfJoinInequalityType::AsOfInequalityTypeGe),
1902 "AS_OF_INEQUALITY_TYPE_LT" => Ok(AsOfJoinInequalityType::AsOfInequalityTypeLt),
1903 "AS_OF_INEQUALITY_TYPE_LE" => Ok(AsOfJoinInequalityType::AsOfInequalityTypeLe),
1904 _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
1905 }
1906 }
1907 }
1908 deserializer.deserialize_any(GeneratedVisitor)
1909 }
1910}
1911impl serde::Serialize for AsOfJoinType {
1912 #[allow(deprecated)]
1913 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1914 where
1915 S: serde::Serializer,
1916 {
1917 let variant = match self {
1918 Self::Unspecified => "AS_OF_JOIN_TYPE_UNSPECIFIED",
1919 Self::Inner => "AS_OF_JOIN_TYPE_INNER",
1920 Self::LeftOuter => "AS_OF_JOIN_TYPE_LEFT_OUTER",
1921 };
1922 serializer.serialize_str(variant)
1923 }
1924}
1925impl<'de> serde::Deserialize<'de> for AsOfJoinType {
1926 #[allow(deprecated)]
1927 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1928 where
1929 D: serde::Deserializer<'de>,
1930 {
1931 const FIELDS: &[&str] = &[
1932 "AS_OF_JOIN_TYPE_UNSPECIFIED",
1933 "AS_OF_JOIN_TYPE_INNER",
1934 "AS_OF_JOIN_TYPE_LEFT_OUTER",
1935 ];
1936
1937 struct GeneratedVisitor;
1938
1939 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
1940 type Value = AsOfJoinType;
1941
1942 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1943 write!(formatter, "expected one of: {:?}", &FIELDS)
1944 }
1945
1946 fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
1947 where
1948 E: serde::de::Error,
1949 {
1950 i32::try_from(v)
1951 .ok()
1952 .and_then(|x| x.try_into().ok())
1953 .ok_or_else(|| {
1954 serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
1955 })
1956 }
1957
1958 fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
1959 where
1960 E: serde::de::Error,
1961 {
1962 i32::try_from(v)
1963 .ok()
1964 .and_then(|x| x.try_into().ok())
1965 .ok_or_else(|| {
1966 serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
1967 })
1968 }
1969
1970 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1971 where
1972 E: serde::de::Error,
1973 {
1974 match value {
1975 "AS_OF_JOIN_TYPE_UNSPECIFIED" => Ok(AsOfJoinType::Unspecified),
1976 "AS_OF_JOIN_TYPE_INNER" => Ok(AsOfJoinType::Inner),
1977 "AS_OF_JOIN_TYPE_LEFT_OUTER" => Ok(AsOfJoinType::LeftOuter),
1978 _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
1979 }
1980 }
1981 }
1982 deserializer.deserialize_any(GeneratedVisitor)
1983 }
1984}
1985impl serde::Serialize for Cardinality {
1986 #[allow(deprecated)]
1987 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1988 where
1989 S: serde::Serializer,
1990 {
1991 use serde::ser::SerializeStruct;
1992 let mut len = 0;
1993 if self.lo != 0 {
1994 len += 1;
1995 }
1996 if self.hi.is_some() {
1997 len += 1;
1998 }
1999 let mut struct_ser = serializer.serialize_struct("plan_common.Cardinality", len)?;
2000 if self.lo != 0 {
2001 #[allow(clippy::needless_borrow)]
2002 #[allow(clippy::needless_borrows_for_generic_args)]
2003 struct_ser.serialize_field("lo", ToString::to_string(&self.lo).as_str())?;
2004 }
2005 if let Some(v) = self.hi.as_ref() {
2006 #[allow(clippy::needless_borrow)]
2007 #[allow(clippy::needless_borrows_for_generic_args)]
2008 struct_ser.serialize_field("hi", ToString::to_string(&v).as_str())?;
2009 }
2010 struct_ser.end()
2011 }
2012}
2013impl<'de> serde::Deserialize<'de> for Cardinality {
2014 #[allow(deprecated)]
2015 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2016 where
2017 D: serde::Deserializer<'de>,
2018 {
2019 const FIELDS: &[&str] = &[
2020 "lo",
2021 "hi",
2022 ];
2023
2024 #[allow(clippy::enum_variant_names)]
2025 enum GeneratedField {
2026 Lo,
2027 Hi,
2028 }
2029 impl<'de> serde::Deserialize<'de> for GeneratedField {
2030 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
2031 where
2032 D: serde::Deserializer<'de>,
2033 {
2034 struct GeneratedVisitor;
2035
2036 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2037 type Value = GeneratedField;
2038
2039 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2040 write!(formatter, "expected one of: {:?}", &FIELDS)
2041 }
2042
2043 #[allow(unused_variables)]
2044 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
2045 where
2046 E: serde::de::Error,
2047 {
2048 match value {
2049 "lo" => Ok(GeneratedField::Lo),
2050 "hi" => Ok(GeneratedField::Hi),
2051 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
2052 }
2053 }
2054 }
2055 deserializer.deserialize_identifier(GeneratedVisitor)
2056 }
2057 }
2058 struct GeneratedVisitor;
2059 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2060 type Value = Cardinality;
2061
2062 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2063 formatter.write_str("struct plan_common.Cardinality")
2064 }
2065
2066 fn visit_map<V>(self, mut map_: V) -> std::result::Result<Cardinality, V::Error>
2067 where
2068 V: serde::de::MapAccess<'de>,
2069 {
2070 let mut lo__ = None;
2071 let mut hi__ = None;
2072 while let Some(k) = map_.next_key()? {
2073 match k {
2074 GeneratedField::Lo => {
2075 if lo__.is_some() {
2076 return Err(serde::de::Error::duplicate_field("lo"));
2077 }
2078 lo__ =
2079 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
2080 ;
2081 }
2082 GeneratedField::Hi => {
2083 if hi__.is_some() {
2084 return Err(serde::de::Error::duplicate_field("hi"));
2085 }
2086 hi__ =
2087 map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
2088 ;
2089 }
2090 }
2091 }
2092 Ok(Cardinality {
2093 lo: lo__.unwrap_or_default(),
2094 hi: hi__,
2095 })
2096 }
2097 }
2098 deserializer.deserialize_struct("plan_common.Cardinality", FIELDS, GeneratedVisitor)
2099 }
2100}
2101impl serde::Serialize for ColumnCatalog {
2102 #[allow(deprecated)]
2103 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2104 where
2105 S: serde::Serializer,
2106 {
2107 use serde::ser::SerializeStruct;
2108 let mut len = 0;
2109 if self.column_desc.is_some() {
2110 len += 1;
2111 }
2112 if self.is_hidden {
2113 len += 1;
2114 }
2115 let mut struct_ser = serializer.serialize_struct("plan_common.ColumnCatalog", len)?;
2116 if let Some(v) = self.column_desc.as_ref() {
2117 struct_ser.serialize_field("columnDesc", v)?;
2118 }
2119 if self.is_hidden {
2120 struct_ser.serialize_field("isHidden", &self.is_hidden)?;
2121 }
2122 struct_ser.end()
2123 }
2124}
2125impl<'de> serde::Deserialize<'de> for ColumnCatalog {
2126 #[allow(deprecated)]
2127 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2128 where
2129 D: serde::Deserializer<'de>,
2130 {
2131 const FIELDS: &[&str] = &[
2132 "column_desc",
2133 "columnDesc",
2134 "is_hidden",
2135 "isHidden",
2136 ];
2137
2138 #[allow(clippy::enum_variant_names)]
2139 enum GeneratedField {
2140 ColumnDesc,
2141 IsHidden,
2142 }
2143 impl<'de> serde::Deserialize<'de> for GeneratedField {
2144 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
2145 where
2146 D: serde::Deserializer<'de>,
2147 {
2148 struct GeneratedVisitor;
2149
2150 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2151 type Value = GeneratedField;
2152
2153 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2154 write!(formatter, "expected one of: {:?}", &FIELDS)
2155 }
2156
2157 #[allow(unused_variables)]
2158 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
2159 where
2160 E: serde::de::Error,
2161 {
2162 match value {
2163 "columnDesc" | "column_desc" => Ok(GeneratedField::ColumnDesc),
2164 "isHidden" | "is_hidden" => Ok(GeneratedField::IsHidden),
2165 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
2166 }
2167 }
2168 }
2169 deserializer.deserialize_identifier(GeneratedVisitor)
2170 }
2171 }
2172 struct GeneratedVisitor;
2173 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2174 type Value = ColumnCatalog;
2175
2176 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2177 formatter.write_str("struct plan_common.ColumnCatalog")
2178 }
2179
2180 fn visit_map<V>(self, mut map_: V) -> std::result::Result<ColumnCatalog, V::Error>
2181 where
2182 V: serde::de::MapAccess<'de>,
2183 {
2184 let mut column_desc__ = None;
2185 let mut is_hidden__ = None;
2186 while let Some(k) = map_.next_key()? {
2187 match k {
2188 GeneratedField::ColumnDesc => {
2189 if column_desc__.is_some() {
2190 return Err(serde::de::Error::duplicate_field("columnDesc"));
2191 }
2192 column_desc__ = map_.next_value()?;
2193 }
2194 GeneratedField::IsHidden => {
2195 if is_hidden__.is_some() {
2196 return Err(serde::de::Error::duplicate_field("isHidden"));
2197 }
2198 is_hidden__ = Some(map_.next_value()?);
2199 }
2200 }
2201 }
2202 Ok(ColumnCatalog {
2203 column_desc: column_desc__,
2204 is_hidden: is_hidden__.unwrap_or_default(),
2205 })
2206 }
2207 }
2208 deserializer.deserialize_struct("plan_common.ColumnCatalog", FIELDS, GeneratedVisitor)
2209 }
2210}
2211impl serde::Serialize for ColumnDesc {
2212 #[allow(deprecated)]
2213 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2214 where
2215 S: serde::Serializer,
2216 {
2217 use serde::ser::SerializeStruct;
2218 let mut len = 0;
2219 if self.column_type.is_some() {
2220 len += 1;
2221 }
2222 if self.column_id != 0 {
2223 len += 1;
2224 }
2225 if !self.name.is_empty() {
2226 len += 1;
2227 }
2228 if self.description.is_some() {
2229 len += 1;
2230 }
2231 if self.additional_column_type != 0 {
2232 len += 1;
2233 }
2234 if self.version != 0 {
2235 len += 1;
2236 }
2237 if self.additional_column.is_some() {
2238 len += 1;
2239 }
2240 if self.nullable {
2241 len += 1;
2242 }
2243 if self.generated_or_default_column.is_some() {
2244 len += 1;
2245 }
2246 let mut struct_ser = serializer.serialize_struct("plan_common.ColumnDesc", len)?;
2247 if let Some(v) = self.column_type.as_ref() {
2248 struct_ser.serialize_field("columnType", v)?;
2249 }
2250 if self.column_id != 0 {
2251 struct_ser.serialize_field("columnId", &self.column_id)?;
2252 }
2253 if !self.name.is_empty() {
2254 struct_ser.serialize_field("name", &self.name)?;
2255 }
2256 if let Some(v) = self.description.as_ref() {
2257 struct_ser.serialize_field("description", v)?;
2258 }
2259 if self.additional_column_type != 0 {
2260 let v = AdditionalColumnType::try_from(self.additional_column_type)
2261 .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.additional_column_type)))?;
2262 struct_ser.serialize_field("additionalColumnType", &v)?;
2263 }
2264 if self.version != 0 {
2265 let v = ColumnDescVersion::try_from(self.version)
2266 .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.version)))?;
2267 struct_ser.serialize_field("version", &v)?;
2268 }
2269 if let Some(v) = self.additional_column.as_ref() {
2270 struct_ser.serialize_field("additionalColumn", v)?;
2271 }
2272 if self.nullable {
2273 struct_ser.serialize_field("nullable", &self.nullable)?;
2274 }
2275 if let Some(v) = self.generated_or_default_column.as_ref() {
2276 match v {
2277 column_desc::GeneratedOrDefaultColumn::GeneratedColumn(v) => {
2278 struct_ser.serialize_field("generatedColumn", v)?;
2279 }
2280 column_desc::GeneratedOrDefaultColumn::DefaultColumn(v) => {
2281 struct_ser.serialize_field("defaultColumn", v)?;
2282 }
2283 }
2284 }
2285 struct_ser.end()
2286 }
2287}
2288impl<'de> serde::Deserialize<'de> for ColumnDesc {
2289 #[allow(deprecated)]
2290 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2291 where
2292 D: serde::Deserializer<'de>,
2293 {
2294 const FIELDS: &[&str] = &[
2295 "column_type",
2296 "columnType",
2297 "column_id",
2298 "columnId",
2299 "name",
2300 "description",
2301 "additional_column_type",
2302 "additionalColumnType",
2303 "version",
2304 "additional_column",
2305 "additionalColumn",
2306 "nullable",
2307 "generated_column",
2308 "generatedColumn",
2309 "default_column",
2310 "defaultColumn",
2311 ];
2312
2313 #[allow(clippy::enum_variant_names)]
2314 enum GeneratedField {
2315 ColumnType,
2316 ColumnId,
2317 Name,
2318 Description,
2319 AdditionalColumnType,
2320 Version,
2321 AdditionalColumn,
2322 Nullable,
2323 GeneratedColumn,
2324 DefaultColumn,
2325 }
2326 impl<'de> serde::Deserialize<'de> for GeneratedField {
2327 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
2328 where
2329 D: serde::Deserializer<'de>,
2330 {
2331 struct GeneratedVisitor;
2332
2333 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2334 type Value = GeneratedField;
2335
2336 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2337 write!(formatter, "expected one of: {:?}", &FIELDS)
2338 }
2339
2340 #[allow(unused_variables)]
2341 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
2342 where
2343 E: serde::de::Error,
2344 {
2345 match value {
2346 "columnType" | "column_type" => Ok(GeneratedField::ColumnType),
2347 "columnId" | "column_id" => Ok(GeneratedField::ColumnId),
2348 "name" => Ok(GeneratedField::Name),
2349 "description" => Ok(GeneratedField::Description),
2350 "additionalColumnType" | "additional_column_type" => Ok(GeneratedField::AdditionalColumnType),
2351 "version" => Ok(GeneratedField::Version),
2352 "additionalColumn" | "additional_column" => Ok(GeneratedField::AdditionalColumn),
2353 "nullable" => Ok(GeneratedField::Nullable),
2354 "generatedColumn" | "generated_column" => Ok(GeneratedField::GeneratedColumn),
2355 "defaultColumn" | "default_column" => Ok(GeneratedField::DefaultColumn),
2356 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
2357 }
2358 }
2359 }
2360 deserializer.deserialize_identifier(GeneratedVisitor)
2361 }
2362 }
2363 struct GeneratedVisitor;
2364 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2365 type Value = ColumnDesc;
2366
2367 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2368 formatter.write_str("struct plan_common.ColumnDesc")
2369 }
2370
2371 fn visit_map<V>(self, mut map_: V) -> std::result::Result<ColumnDesc, V::Error>
2372 where
2373 V: serde::de::MapAccess<'de>,
2374 {
2375 let mut column_type__ = None;
2376 let mut column_id__ = None;
2377 let mut name__ = None;
2378 let mut description__ = None;
2379 let mut additional_column_type__ = None;
2380 let mut version__ = None;
2381 let mut additional_column__ = None;
2382 let mut nullable__ = None;
2383 let mut generated_or_default_column__ = None;
2384 while let Some(k) = map_.next_key()? {
2385 match k {
2386 GeneratedField::ColumnType => {
2387 if column_type__.is_some() {
2388 return Err(serde::de::Error::duplicate_field("columnType"));
2389 }
2390 column_type__ = map_.next_value()?;
2391 }
2392 GeneratedField::ColumnId => {
2393 if column_id__.is_some() {
2394 return Err(serde::de::Error::duplicate_field("columnId"));
2395 }
2396 column_id__ =
2397 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
2398 ;
2399 }
2400 GeneratedField::Name => {
2401 if name__.is_some() {
2402 return Err(serde::de::Error::duplicate_field("name"));
2403 }
2404 name__ = Some(map_.next_value()?);
2405 }
2406 GeneratedField::Description => {
2407 if description__.is_some() {
2408 return Err(serde::de::Error::duplicate_field("description"));
2409 }
2410 description__ = map_.next_value()?;
2411 }
2412 GeneratedField::AdditionalColumnType => {
2413 if additional_column_type__.is_some() {
2414 return Err(serde::de::Error::duplicate_field("additionalColumnType"));
2415 }
2416 additional_column_type__ = Some(map_.next_value::<AdditionalColumnType>()? as i32);
2417 }
2418 GeneratedField::Version => {
2419 if version__.is_some() {
2420 return Err(serde::de::Error::duplicate_field("version"));
2421 }
2422 version__ = Some(map_.next_value::<ColumnDescVersion>()? as i32);
2423 }
2424 GeneratedField::AdditionalColumn => {
2425 if additional_column__.is_some() {
2426 return Err(serde::de::Error::duplicate_field("additionalColumn"));
2427 }
2428 additional_column__ = map_.next_value()?;
2429 }
2430 GeneratedField::Nullable => {
2431 if nullable__.is_some() {
2432 return Err(serde::de::Error::duplicate_field("nullable"));
2433 }
2434 nullable__ = Some(map_.next_value()?);
2435 }
2436 GeneratedField::GeneratedColumn => {
2437 if generated_or_default_column__.is_some() {
2438 return Err(serde::de::Error::duplicate_field("generatedColumn"));
2439 }
2440 generated_or_default_column__ = map_.next_value::<::std::option::Option<_>>()?.map(column_desc::GeneratedOrDefaultColumn::GeneratedColumn)
2441;
2442 }
2443 GeneratedField::DefaultColumn => {
2444 if generated_or_default_column__.is_some() {
2445 return Err(serde::de::Error::duplicate_field("defaultColumn"));
2446 }
2447 generated_or_default_column__ = map_.next_value::<::std::option::Option<_>>()?.map(column_desc::GeneratedOrDefaultColumn::DefaultColumn)
2448;
2449 }
2450 }
2451 }
2452 Ok(ColumnDesc {
2453 column_type: column_type__,
2454 column_id: column_id__.unwrap_or_default(),
2455 name: name__.unwrap_or_default(),
2456 description: description__,
2457 additional_column_type: additional_column_type__.unwrap_or_default(),
2458 version: version__.unwrap_or_default(),
2459 additional_column: additional_column__,
2460 nullable: nullable__.unwrap_or_default(),
2461 generated_or_default_column: generated_or_default_column__,
2462 })
2463 }
2464 }
2465 deserializer.deserialize_struct("plan_common.ColumnDesc", FIELDS, GeneratedVisitor)
2466 }
2467}
2468impl serde::Serialize for ColumnDescVersion {
2469 #[allow(deprecated)]
2470 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2471 where
2472 S: serde::Serializer,
2473 {
2474 let variant = match self {
2475 Self::Unspecified => "COLUMN_DESC_VERSION_UNSPECIFIED",
2476 Self::Pr13707 => "COLUMN_DESC_VERSION_PR_13707",
2477 };
2478 serializer.serialize_str(variant)
2479 }
2480}
2481impl<'de> serde::Deserialize<'de> for ColumnDescVersion {
2482 #[allow(deprecated)]
2483 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2484 where
2485 D: serde::Deserializer<'de>,
2486 {
2487 const FIELDS: &[&str] = &[
2488 "COLUMN_DESC_VERSION_UNSPECIFIED",
2489 "COLUMN_DESC_VERSION_PR_13707",
2490 ];
2491
2492 struct GeneratedVisitor;
2493
2494 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2495 type Value = ColumnDescVersion;
2496
2497 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2498 write!(formatter, "expected one of: {:?}", &FIELDS)
2499 }
2500
2501 fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
2502 where
2503 E: serde::de::Error,
2504 {
2505 i32::try_from(v)
2506 .ok()
2507 .and_then(|x| x.try_into().ok())
2508 .ok_or_else(|| {
2509 serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
2510 })
2511 }
2512
2513 fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
2514 where
2515 E: serde::de::Error,
2516 {
2517 i32::try_from(v)
2518 .ok()
2519 .and_then(|x| x.try_into().ok())
2520 .ok_or_else(|| {
2521 serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
2522 })
2523 }
2524
2525 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2526 where
2527 E: serde::de::Error,
2528 {
2529 match value {
2530 "COLUMN_DESC_VERSION_UNSPECIFIED" => Ok(ColumnDescVersion::Unspecified),
2531 "COLUMN_DESC_VERSION_PR_13707" => Ok(ColumnDescVersion::Pr13707),
2532 _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
2533 }
2534 }
2535 }
2536 deserializer.deserialize_any(GeneratedVisitor)
2537 }
2538}
2539impl serde::Serialize for DefaultColumnDesc {
2540 #[allow(deprecated)]
2541 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2542 where
2543 S: serde::Serializer,
2544 {
2545 use serde::ser::SerializeStruct;
2546 let mut len = 0;
2547 if self.expr.is_some() {
2548 len += 1;
2549 }
2550 if self.snapshot_value.is_some() {
2551 len += 1;
2552 }
2553 let mut struct_ser = serializer.serialize_struct("plan_common.DefaultColumnDesc", len)?;
2554 if let Some(v) = self.expr.as_ref() {
2555 struct_ser.serialize_field("expr", v)?;
2556 }
2557 if let Some(v) = self.snapshot_value.as_ref() {
2558 struct_ser.serialize_field("snapshotValue", v)?;
2559 }
2560 struct_ser.end()
2561 }
2562}
2563impl<'de> serde::Deserialize<'de> for DefaultColumnDesc {
2564 #[allow(deprecated)]
2565 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2566 where
2567 D: serde::Deserializer<'de>,
2568 {
2569 const FIELDS: &[&str] = &[
2570 "expr",
2571 "snapshot_value",
2572 "snapshotValue",
2573 ];
2574
2575 #[allow(clippy::enum_variant_names)]
2576 enum GeneratedField {
2577 Expr,
2578 SnapshotValue,
2579 }
2580 impl<'de> serde::Deserialize<'de> for GeneratedField {
2581 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
2582 where
2583 D: serde::Deserializer<'de>,
2584 {
2585 struct GeneratedVisitor;
2586
2587 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2588 type Value = GeneratedField;
2589
2590 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2591 write!(formatter, "expected one of: {:?}", &FIELDS)
2592 }
2593
2594 #[allow(unused_variables)]
2595 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
2596 where
2597 E: serde::de::Error,
2598 {
2599 match value {
2600 "expr" => Ok(GeneratedField::Expr),
2601 "snapshotValue" | "snapshot_value" => Ok(GeneratedField::SnapshotValue),
2602 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
2603 }
2604 }
2605 }
2606 deserializer.deserialize_identifier(GeneratedVisitor)
2607 }
2608 }
2609 struct GeneratedVisitor;
2610 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2611 type Value = DefaultColumnDesc;
2612
2613 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2614 formatter.write_str("struct plan_common.DefaultColumnDesc")
2615 }
2616
2617 fn visit_map<V>(self, mut map_: V) -> std::result::Result<DefaultColumnDesc, V::Error>
2618 where
2619 V: serde::de::MapAccess<'de>,
2620 {
2621 let mut expr__ = None;
2622 let mut snapshot_value__ = None;
2623 while let Some(k) = map_.next_key()? {
2624 match k {
2625 GeneratedField::Expr => {
2626 if expr__.is_some() {
2627 return Err(serde::de::Error::duplicate_field("expr"));
2628 }
2629 expr__ = map_.next_value()?;
2630 }
2631 GeneratedField::SnapshotValue => {
2632 if snapshot_value__.is_some() {
2633 return Err(serde::de::Error::duplicate_field("snapshotValue"));
2634 }
2635 snapshot_value__ = map_.next_value()?;
2636 }
2637 }
2638 }
2639 Ok(DefaultColumnDesc {
2640 expr: expr__,
2641 snapshot_value: snapshot_value__,
2642 })
2643 }
2644 }
2645 deserializer.deserialize_struct("plan_common.DefaultColumnDesc", FIELDS, GeneratedVisitor)
2646 }
2647}
2648impl serde::Serialize for DefaultColumns {
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.default_columns.is_empty() {
2657 len += 1;
2658 }
2659 let mut struct_ser = serializer.serialize_struct("plan_common.DefaultColumns", len)?;
2660 if !self.default_columns.is_empty() {
2661 struct_ser.serialize_field("defaultColumns", &self.default_columns)?;
2662 }
2663 struct_ser.end()
2664 }
2665}
2666impl<'de> serde::Deserialize<'de> for DefaultColumns {
2667 #[allow(deprecated)]
2668 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2669 where
2670 D: serde::Deserializer<'de>,
2671 {
2672 const FIELDS: &[&str] = &[
2673 "default_columns",
2674 "defaultColumns",
2675 ];
2676
2677 #[allow(clippy::enum_variant_names)]
2678 enum GeneratedField {
2679 DefaultColumns,
2680 }
2681 impl<'de> serde::Deserialize<'de> for GeneratedField {
2682 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
2683 where
2684 D: serde::Deserializer<'de>,
2685 {
2686 struct GeneratedVisitor;
2687
2688 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2689 type Value = GeneratedField;
2690
2691 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2692 write!(formatter, "expected one of: {:?}", &FIELDS)
2693 }
2694
2695 #[allow(unused_variables)]
2696 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
2697 where
2698 E: serde::de::Error,
2699 {
2700 match value {
2701 "defaultColumns" | "default_columns" => Ok(GeneratedField::DefaultColumns),
2702 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
2703 }
2704 }
2705 }
2706 deserializer.deserialize_identifier(GeneratedVisitor)
2707 }
2708 }
2709 struct GeneratedVisitor;
2710 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2711 type Value = DefaultColumns;
2712
2713 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2714 formatter.write_str("struct plan_common.DefaultColumns")
2715 }
2716
2717 fn visit_map<V>(self, mut map_: V) -> std::result::Result<DefaultColumns, V::Error>
2718 where
2719 V: serde::de::MapAccess<'de>,
2720 {
2721 let mut default_columns__ = None;
2722 while let Some(k) = map_.next_key()? {
2723 match k {
2724 GeneratedField::DefaultColumns => {
2725 if default_columns__.is_some() {
2726 return Err(serde::de::Error::duplicate_field("defaultColumns"));
2727 }
2728 default_columns__ = Some(map_.next_value()?);
2729 }
2730 }
2731 }
2732 Ok(DefaultColumns {
2733 default_columns: default_columns__.unwrap_or_default(),
2734 })
2735 }
2736 }
2737 deserializer.deserialize_struct("plan_common.DefaultColumns", FIELDS, GeneratedVisitor)
2738 }
2739}
2740impl serde::Serialize for EncodeType {
2741 #[allow(deprecated)]
2742 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2743 where
2744 S: serde::Serializer,
2745 {
2746 let variant = match self {
2747 Self::Unspecified => "ENCODE_TYPE_UNSPECIFIED",
2748 Self::Native => "ENCODE_TYPE_NATIVE",
2749 Self::Avro => "ENCODE_TYPE_AVRO",
2750 Self::Csv => "ENCODE_TYPE_CSV",
2751 Self::Protobuf => "ENCODE_TYPE_PROTOBUF",
2752 Self::Json => "ENCODE_TYPE_JSON",
2753 Self::Bytes => "ENCODE_TYPE_BYTES",
2754 Self::Template => "ENCODE_TYPE_TEMPLATE",
2755 Self::None => "ENCODE_TYPE_NONE",
2756 Self::Text => "ENCODE_TYPE_TEXT",
2757 Self::Parquet => "ENCODE_TYPE_PARQUET",
2758 };
2759 serializer.serialize_str(variant)
2760 }
2761}
2762impl<'de> serde::Deserialize<'de> for EncodeType {
2763 #[allow(deprecated)]
2764 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2765 where
2766 D: serde::Deserializer<'de>,
2767 {
2768 const FIELDS: &[&str] = &[
2769 "ENCODE_TYPE_UNSPECIFIED",
2770 "ENCODE_TYPE_NATIVE",
2771 "ENCODE_TYPE_AVRO",
2772 "ENCODE_TYPE_CSV",
2773 "ENCODE_TYPE_PROTOBUF",
2774 "ENCODE_TYPE_JSON",
2775 "ENCODE_TYPE_BYTES",
2776 "ENCODE_TYPE_TEMPLATE",
2777 "ENCODE_TYPE_NONE",
2778 "ENCODE_TYPE_TEXT",
2779 "ENCODE_TYPE_PARQUET",
2780 ];
2781
2782 struct GeneratedVisitor;
2783
2784 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2785 type Value = EncodeType;
2786
2787 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2788 write!(formatter, "expected one of: {:?}", &FIELDS)
2789 }
2790
2791 fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
2792 where
2793 E: serde::de::Error,
2794 {
2795 i32::try_from(v)
2796 .ok()
2797 .and_then(|x| x.try_into().ok())
2798 .ok_or_else(|| {
2799 serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
2800 })
2801 }
2802
2803 fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
2804 where
2805 E: serde::de::Error,
2806 {
2807 i32::try_from(v)
2808 .ok()
2809 .and_then(|x| x.try_into().ok())
2810 .ok_or_else(|| {
2811 serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
2812 })
2813 }
2814
2815 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2816 where
2817 E: serde::de::Error,
2818 {
2819 match value {
2820 "ENCODE_TYPE_UNSPECIFIED" => Ok(EncodeType::Unspecified),
2821 "ENCODE_TYPE_NATIVE" => Ok(EncodeType::Native),
2822 "ENCODE_TYPE_AVRO" => Ok(EncodeType::Avro),
2823 "ENCODE_TYPE_CSV" => Ok(EncodeType::Csv),
2824 "ENCODE_TYPE_PROTOBUF" => Ok(EncodeType::Protobuf),
2825 "ENCODE_TYPE_JSON" => Ok(EncodeType::Json),
2826 "ENCODE_TYPE_BYTES" => Ok(EncodeType::Bytes),
2827 "ENCODE_TYPE_TEMPLATE" => Ok(EncodeType::Template),
2828 "ENCODE_TYPE_NONE" => Ok(EncodeType::None),
2829 "ENCODE_TYPE_TEXT" => Ok(EncodeType::Text),
2830 "ENCODE_TYPE_PARQUET" => Ok(EncodeType::Parquet),
2831 _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
2832 }
2833 }
2834 }
2835 deserializer.deserialize_any(GeneratedVisitor)
2836 }
2837}
2838impl serde::Serialize for ExprContext {
2839 #[allow(deprecated)]
2840 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2841 where
2842 S: serde::Serializer,
2843 {
2844 use serde::ser::SerializeStruct;
2845 let mut len = 0;
2846 if !self.time_zone.is_empty() {
2847 len += 1;
2848 }
2849 if self.strict_mode {
2850 len += 1;
2851 }
2852 let mut struct_ser = serializer.serialize_struct("plan_common.ExprContext", len)?;
2853 if !self.time_zone.is_empty() {
2854 struct_ser.serialize_field("timeZone", &self.time_zone)?;
2855 }
2856 if self.strict_mode {
2857 struct_ser.serialize_field("strictMode", &self.strict_mode)?;
2858 }
2859 struct_ser.end()
2860 }
2861}
2862impl<'de> serde::Deserialize<'de> for ExprContext {
2863 #[allow(deprecated)]
2864 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2865 where
2866 D: serde::Deserializer<'de>,
2867 {
2868 const FIELDS: &[&str] = &[
2869 "time_zone",
2870 "timeZone",
2871 "strict_mode",
2872 "strictMode",
2873 ];
2874
2875 #[allow(clippy::enum_variant_names)]
2876 enum GeneratedField {
2877 TimeZone,
2878 StrictMode,
2879 }
2880 impl<'de> serde::Deserialize<'de> for GeneratedField {
2881 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
2882 where
2883 D: serde::Deserializer<'de>,
2884 {
2885 struct GeneratedVisitor;
2886
2887 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2888 type Value = GeneratedField;
2889
2890 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2891 write!(formatter, "expected one of: {:?}", &FIELDS)
2892 }
2893
2894 #[allow(unused_variables)]
2895 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
2896 where
2897 E: serde::de::Error,
2898 {
2899 match value {
2900 "timeZone" | "time_zone" => Ok(GeneratedField::TimeZone),
2901 "strictMode" | "strict_mode" => Ok(GeneratedField::StrictMode),
2902 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
2903 }
2904 }
2905 }
2906 deserializer.deserialize_identifier(GeneratedVisitor)
2907 }
2908 }
2909 struct GeneratedVisitor;
2910 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
2911 type Value = ExprContext;
2912
2913 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2914 formatter.write_str("struct plan_common.ExprContext")
2915 }
2916
2917 fn visit_map<V>(self, mut map_: V) -> std::result::Result<ExprContext, V::Error>
2918 where
2919 V: serde::de::MapAccess<'de>,
2920 {
2921 let mut time_zone__ = None;
2922 let mut strict_mode__ = None;
2923 while let Some(k) = map_.next_key()? {
2924 match k {
2925 GeneratedField::TimeZone => {
2926 if time_zone__.is_some() {
2927 return Err(serde::de::Error::duplicate_field("timeZone"));
2928 }
2929 time_zone__ = Some(map_.next_value()?);
2930 }
2931 GeneratedField::StrictMode => {
2932 if strict_mode__.is_some() {
2933 return Err(serde::de::Error::duplicate_field("strictMode"));
2934 }
2935 strict_mode__ = Some(map_.next_value()?);
2936 }
2937 }
2938 }
2939 Ok(ExprContext {
2940 time_zone: time_zone__.unwrap_or_default(),
2941 strict_mode: strict_mode__.unwrap_or_default(),
2942 })
2943 }
2944 }
2945 deserializer.deserialize_struct("plan_common.ExprContext", FIELDS, GeneratedVisitor)
2946 }
2947}
2948impl serde::Serialize for ExternalTableDesc {
2949 #[allow(deprecated)]
2950 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2951 where
2952 S: serde::Serializer,
2953 {
2954 use serde::ser::SerializeStruct;
2955 let mut len = 0;
2956 if self.table_id != 0 {
2957 len += 1;
2958 }
2959 if !self.columns.is_empty() {
2960 len += 1;
2961 }
2962 if !self.pk.is_empty() {
2963 len += 1;
2964 }
2965 if !self.table_name.is_empty() {
2966 len += 1;
2967 }
2968 if !self.stream_key.is_empty() {
2969 len += 1;
2970 }
2971 if !self.connect_properties.is_empty() {
2972 len += 1;
2973 }
2974 if self.source_id != 0 {
2975 len += 1;
2976 }
2977 if !self.secret_refs.is_empty() {
2978 len += 1;
2979 }
2980 let mut struct_ser = serializer.serialize_struct("plan_common.ExternalTableDesc", len)?;
2981 if self.table_id != 0 {
2982 struct_ser.serialize_field("tableId", &self.table_id)?;
2983 }
2984 if !self.columns.is_empty() {
2985 struct_ser.serialize_field("columns", &self.columns)?;
2986 }
2987 if !self.pk.is_empty() {
2988 struct_ser.serialize_field("pk", &self.pk)?;
2989 }
2990 if !self.table_name.is_empty() {
2991 struct_ser.serialize_field("tableName", &self.table_name)?;
2992 }
2993 if !self.stream_key.is_empty() {
2994 struct_ser.serialize_field("streamKey", &self.stream_key)?;
2995 }
2996 if !self.connect_properties.is_empty() {
2997 struct_ser.serialize_field("connectProperties", &self.connect_properties)?;
2998 }
2999 if self.source_id != 0 {
3000 struct_ser.serialize_field("sourceId", &self.source_id)?;
3001 }
3002 if !self.secret_refs.is_empty() {
3003 struct_ser.serialize_field("secretRefs", &self.secret_refs)?;
3004 }
3005 struct_ser.end()
3006 }
3007}
3008impl<'de> serde::Deserialize<'de> for ExternalTableDesc {
3009 #[allow(deprecated)]
3010 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3011 where
3012 D: serde::Deserializer<'de>,
3013 {
3014 const FIELDS: &[&str] = &[
3015 "table_id",
3016 "tableId",
3017 "columns",
3018 "pk",
3019 "table_name",
3020 "tableName",
3021 "stream_key",
3022 "streamKey",
3023 "connect_properties",
3024 "connectProperties",
3025 "source_id",
3026 "sourceId",
3027 "secret_refs",
3028 "secretRefs",
3029 ];
3030
3031 #[allow(clippy::enum_variant_names)]
3032 enum GeneratedField {
3033 TableId,
3034 Columns,
3035 Pk,
3036 TableName,
3037 StreamKey,
3038 ConnectProperties,
3039 SourceId,
3040 SecretRefs,
3041 }
3042 impl<'de> serde::Deserialize<'de> for GeneratedField {
3043 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
3044 where
3045 D: serde::Deserializer<'de>,
3046 {
3047 struct GeneratedVisitor;
3048
3049 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3050 type Value = GeneratedField;
3051
3052 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3053 write!(formatter, "expected one of: {:?}", &FIELDS)
3054 }
3055
3056 #[allow(unused_variables)]
3057 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
3058 where
3059 E: serde::de::Error,
3060 {
3061 match value {
3062 "tableId" | "table_id" => Ok(GeneratedField::TableId),
3063 "columns" => Ok(GeneratedField::Columns),
3064 "pk" => Ok(GeneratedField::Pk),
3065 "tableName" | "table_name" => Ok(GeneratedField::TableName),
3066 "streamKey" | "stream_key" => Ok(GeneratedField::StreamKey),
3067 "connectProperties" | "connect_properties" => Ok(GeneratedField::ConnectProperties),
3068 "sourceId" | "source_id" => Ok(GeneratedField::SourceId),
3069 "secretRefs" | "secret_refs" => Ok(GeneratedField::SecretRefs),
3070 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
3071 }
3072 }
3073 }
3074 deserializer.deserialize_identifier(GeneratedVisitor)
3075 }
3076 }
3077 struct GeneratedVisitor;
3078 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3079 type Value = ExternalTableDesc;
3080
3081 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3082 formatter.write_str("struct plan_common.ExternalTableDesc")
3083 }
3084
3085 fn visit_map<V>(self, mut map_: V) -> std::result::Result<ExternalTableDesc, V::Error>
3086 where
3087 V: serde::de::MapAccess<'de>,
3088 {
3089 let mut table_id__ = None;
3090 let mut columns__ = None;
3091 let mut pk__ = None;
3092 let mut table_name__ = None;
3093 let mut stream_key__ = None;
3094 let mut connect_properties__ = None;
3095 let mut source_id__ = None;
3096 let mut secret_refs__ = None;
3097 while let Some(k) = map_.next_key()? {
3098 match k {
3099 GeneratedField::TableId => {
3100 if table_id__.is_some() {
3101 return Err(serde::de::Error::duplicate_field("tableId"));
3102 }
3103 table_id__ =
3104 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
3105 ;
3106 }
3107 GeneratedField::Columns => {
3108 if columns__.is_some() {
3109 return Err(serde::de::Error::duplicate_field("columns"));
3110 }
3111 columns__ = Some(map_.next_value()?);
3112 }
3113 GeneratedField::Pk => {
3114 if pk__.is_some() {
3115 return Err(serde::de::Error::duplicate_field("pk"));
3116 }
3117 pk__ = Some(map_.next_value()?);
3118 }
3119 GeneratedField::TableName => {
3120 if table_name__.is_some() {
3121 return Err(serde::de::Error::duplicate_field("tableName"));
3122 }
3123 table_name__ = Some(map_.next_value()?);
3124 }
3125 GeneratedField::StreamKey => {
3126 if stream_key__.is_some() {
3127 return Err(serde::de::Error::duplicate_field("streamKey"));
3128 }
3129 stream_key__ =
3130 Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
3131 .into_iter().map(|x| x.0).collect())
3132 ;
3133 }
3134 GeneratedField::ConnectProperties => {
3135 if connect_properties__.is_some() {
3136 return Err(serde::de::Error::duplicate_field("connectProperties"));
3137 }
3138 connect_properties__ = Some(
3139 map_.next_value::<std::collections::BTreeMap<_, _>>()?
3140 );
3141 }
3142 GeneratedField::SourceId => {
3143 if source_id__.is_some() {
3144 return Err(serde::de::Error::duplicate_field("sourceId"));
3145 }
3146 source_id__ =
3147 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
3148 ;
3149 }
3150 GeneratedField::SecretRefs => {
3151 if secret_refs__.is_some() {
3152 return Err(serde::de::Error::duplicate_field("secretRefs"));
3153 }
3154 secret_refs__ = Some(
3155 map_.next_value::<std::collections::BTreeMap<_, _>>()?
3156 );
3157 }
3158 }
3159 }
3160 Ok(ExternalTableDesc {
3161 table_id: table_id__.unwrap_or_default(),
3162 columns: columns__.unwrap_or_default(),
3163 pk: pk__.unwrap_or_default(),
3164 table_name: table_name__.unwrap_or_default(),
3165 stream_key: stream_key__.unwrap_or_default(),
3166 connect_properties: connect_properties__.unwrap_or_default(),
3167 source_id: source_id__.unwrap_or_default(),
3168 secret_refs: secret_refs__.unwrap_or_default(),
3169 })
3170 }
3171 }
3172 deserializer.deserialize_struct("plan_common.ExternalTableDesc", FIELDS, GeneratedVisitor)
3173 }
3174}
3175impl serde::Serialize for Field {
3176 #[allow(deprecated)]
3177 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3178 where
3179 S: serde::Serializer,
3180 {
3181 use serde::ser::SerializeStruct;
3182 let mut len = 0;
3183 if self.data_type.is_some() {
3184 len += 1;
3185 }
3186 if !self.name.is_empty() {
3187 len += 1;
3188 }
3189 let mut struct_ser = serializer.serialize_struct("plan_common.Field", len)?;
3190 if let Some(v) = self.data_type.as_ref() {
3191 struct_ser.serialize_field("dataType", v)?;
3192 }
3193 if !self.name.is_empty() {
3194 struct_ser.serialize_field("name", &self.name)?;
3195 }
3196 struct_ser.end()
3197 }
3198}
3199impl<'de> serde::Deserialize<'de> for Field {
3200 #[allow(deprecated)]
3201 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3202 where
3203 D: serde::Deserializer<'de>,
3204 {
3205 const FIELDS: &[&str] = &[
3206 "data_type",
3207 "dataType",
3208 "name",
3209 ];
3210
3211 #[allow(clippy::enum_variant_names)]
3212 enum GeneratedField {
3213 DataType,
3214 Name,
3215 }
3216 impl<'de> serde::Deserialize<'de> for GeneratedField {
3217 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
3218 where
3219 D: serde::Deserializer<'de>,
3220 {
3221 struct GeneratedVisitor;
3222
3223 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3224 type Value = GeneratedField;
3225
3226 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3227 write!(formatter, "expected one of: {:?}", &FIELDS)
3228 }
3229
3230 #[allow(unused_variables)]
3231 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
3232 where
3233 E: serde::de::Error,
3234 {
3235 match value {
3236 "dataType" | "data_type" => Ok(GeneratedField::DataType),
3237 "name" => Ok(GeneratedField::Name),
3238 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
3239 }
3240 }
3241 }
3242 deserializer.deserialize_identifier(GeneratedVisitor)
3243 }
3244 }
3245 struct GeneratedVisitor;
3246 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3247 type Value = Field;
3248
3249 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3250 formatter.write_str("struct plan_common.Field")
3251 }
3252
3253 fn visit_map<V>(self, mut map_: V) -> std::result::Result<Field, V::Error>
3254 where
3255 V: serde::de::MapAccess<'de>,
3256 {
3257 let mut data_type__ = None;
3258 let mut name__ = None;
3259 while let Some(k) = map_.next_key()? {
3260 match k {
3261 GeneratedField::DataType => {
3262 if data_type__.is_some() {
3263 return Err(serde::de::Error::duplicate_field("dataType"));
3264 }
3265 data_type__ = map_.next_value()?;
3266 }
3267 GeneratedField::Name => {
3268 if name__.is_some() {
3269 return Err(serde::de::Error::duplicate_field("name"));
3270 }
3271 name__ = Some(map_.next_value()?);
3272 }
3273 }
3274 }
3275 Ok(Field {
3276 data_type: data_type__,
3277 name: name__.unwrap_or_default(),
3278 })
3279 }
3280 }
3281 deserializer.deserialize_struct("plan_common.Field", FIELDS, GeneratedVisitor)
3282 }
3283}
3284impl serde::Serialize for FormatType {
3285 #[allow(deprecated)]
3286 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3287 where
3288 S: serde::Serializer,
3289 {
3290 let variant = match self {
3291 Self::Unspecified => "FORMAT_TYPE_UNSPECIFIED",
3292 Self::Native => "FORMAT_TYPE_NATIVE",
3293 Self::Debezium => "FORMAT_TYPE_DEBEZIUM",
3294 Self::DebeziumMongo => "FORMAT_TYPE_DEBEZIUM_MONGO",
3295 Self::Maxwell => "FORMAT_TYPE_MAXWELL",
3296 Self::Canal => "FORMAT_TYPE_CANAL",
3297 Self::Upsert => "FORMAT_TYPE_UPSERT",
3298 Self::Plain => "FORMAT_TYPE_PLAIN",
3299 Self::None => "FORMAT_TYPE_NONE",
3300 };
3301 serializer.serialize_str(variant)
3302 }
3303}
3304impl<'de> serde::Deserialize<'de> for FormatType {
3305 #[allow(deprecated)]
3306 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3307 where
3308 D: serde::Deserializer<'de>,
3309 {
3310 const FIELDS: &[&str] = &[
3311 "FORMAT_TYPE_UNSPECIFIED",
3312 "FORMAT_TYPE_NATIVE",
3313 "FORMAT_TYPE_DEBEZIUM",
3314 "FORMAT_TYPE_DEBEZIUM_MONGO",
3315 "FORMAT_TYPE_MAXWELL",
3316 "FORMAT_TYPE_CANAL",
3317 "FORMAT_TYPE_UPSERT",
3318 "FORMAT_TYPE_PLAIN",
3319 "FORMAT_TYPE_NONE",
3320 ];
3321
3322 struct GeneratedVisitor;
3323
3324 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3325 type Value = FormatType;
3326
3327 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3328 write!(formatter, "expected one of: {:?}", &FIELDS)
3329 }
3330
3331 fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
3332 where
3333 E: serde::de::Error,
3334 {
3335 i32::try_from(v)
3336 .ok()
3337 .and_then(|x| x.try_into().ok())
3338 .ok_or_else(|| {
3339 serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
3340 })
3341 }
3342
3343 fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
3344 where
3345 E: serde::de::Error,
3346 {
3347 i32::try_from(v)
3348 .ok()
3349 .and_then(|x| x.try_into().ok())
3350 .ok_or_else(|| {
3351 serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
3352 })
3353 }
3354
3355 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3356 where
3357 E: serde::de::Error,
3358 {
3359 match value {
3360 "FORMAT_TYPE_UNSPECIFIED" => Ok(FormatType::Unspecified),
3361 "FORMAT_TYPE_NATIVE" => Ok(FormatType::Native),
3362 "FORMAT_TYPE_DEBEZIUM" => Ok(FormatType::Debezium),
3363 "FORMAT_TYPE_DEBEZIUM_MONGO" => Ok(FormatType::DebeziumMongo),
3364 "FORMAT_TYPE_MAXWELL" => Ok(FormatType::Maxwell),
3365 "FORMAT_TYPE_CANAL" => Ok(FormatType::Canal),
3366 "FORMAT_TYPE_UPSERT" => Ok(FormatType::Upsert),
3367 "FORMAT_TYPE_PLAIN" => Ok(FormatType::Plain),
3368 "FORMAT_TYPE_NONE" => Ok(FormatType::None),
3369 _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
3370 }
3371 }
3372 }
3373 deserializer.deserialize_any(GeneratedVisitor)
3374 }
3375}
3376impl serde::Serialize for GeneratedColumnDesc {
3377 #[allow(deprecated)]
3378 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3379 where
3380 S: serde::Serializer,
3381 {
3382 use serde::ser::SerializeStruct;
3383 let mut len = 0;
3384 if self.expr.is_some() {
3385 len += 1;
3386 }
3387 let mut struct_ser = serializer.serialize_struct("plan_common.GeneratedColumnDesc", len)?;
3388 if let Some(v) = self.expr.as_ref() {
3389 struct_ser.serialize_field("expr", v)?;
3390 }
3391 struct_ser.end()
3392 }
3393}
3394impl<'de> serde::Deserialize<'de> for GeneratedColumnDesc {
3395 #[allow(deprecated)]
3396 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3397 where
3398 D: serde::Deserializer<'de>,
3399 {
3400 const FIELDS: &[&str] = &[
3401 "expr",
3402 ];
3403
3404 #[allow(clippy::enum_variant_names)]
3405 enum GeneratedField {
3406 Expr,
3407 }
3408 impl<'de> serde::Deserialize<'de> for GeneratedField {
3409 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
3410 where
3411 D: serde::Deserializer<'de>,
3412 {
3413 struct GeneratedVisitor;
3414
3415 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3416 type Value = GeneratedField;
3417
3418 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3419 write!(formatter, "expected one of: {:?}", &FIELDS)
3420 }
3421
3422 #[allow(unused_variables)]
3423 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
3424 where
3425 E: serde::de::Error,
3426 {
3427 match value {
3428 "expr" => Ok(GeneratedField::Expr),
3429 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
3430 }
3431 }
3432 }
3433 deserializer.deserialize_identifier(GeneratedVisitor)
3434 }
3435 }
3436 struct GeneratedVisitor;
3437 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3438 type Value = GeneratedColumnDesc;
3439
3440 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3441 formatter.write_str("struct plan_common.GeneratedColumnDesc")
3442 }
3443
3444 fn visit_map<V>(self, mut map_: V) -> std::result::Result<GeneratedColumnDesc, V::Error>
3445 where
3446 V: serde::de::MapAccess<'de>,
3447 {
3448 let mut expr__ = None;
3449 while let Some(k) = map_.next_key()? {
3450 match k {
3451 GeneratedField::Expr => {
3452 if expr__.is_some() {
3453 return Err(serde::de::Error::duplicate_field("expr"));
3454 }
3455 expr__ = map_.next_value()?;
3456 }
3457 }
3458 }
3459 Ok(GeneratedColumnDesc {
3460 expr: expr__,
3461 })
3462 }
3463 }
3464 deserializer.deserialize_struct("plan_common.GeneratedColumnDesc", FIELDS, GeneratedVisitor)
3465 }
3466}
3467impl serde::Serialize for IndexAndExpr {
3468 #[allow(deprecated)]
3469 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3470 where
3471 S: serde::Serializer,
3472 {
3473 use serde::ser::SerializeStruct;
3474 let mut len = 0;
3475 if self.index != 0 {
3476 len += 1;
3477 }
3478 if self.expr.is_some() {
3479 len += 1;
3480 }
3481 let mut struct_ser = serializer.serialize_struct("plan_common.IndexAndExpr", len)?;
3482 if self.index != 0 {
3483 struct_ser.serialize_field("index", &self.index)?;
3484 }
3485 if let Some(v) = self.expr.as_ref() {
3486 struct_ser.serialize_field("expr", v)?;
3487 }
3488 struct_ser.end()
3489 }
3490}
3491impl<'de> serde::Deserialize<'de> for IndexAndExpr {
3492 #[allow(deprecated)]
3493 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3494 where
3495 D: serde::Deserializer<'de>,
3496 {
3497 const FIELDS: &[&str] = &[
3498 "index",
3499 "expr",
3500 ];
3501
3502 #[allow(clippy::enum_variant_names)]
3503 enum GeneratedField {
3504 Index,
3505 Expr,
3506 }
3507 impl<'de> serde::Deserialize<'de> for GeneratedField {
3508 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
3509 where
3510 D: serde::Deserializer<'de>,
3511 {
3512 struct GeneratedVisitor;
3513
3514 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3515 type Value = GeneratedField;
3516
3517 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3518 write!(formatter, "expected one of: {:?}", &FIELDS)
3519 }
3520
3521 #[allow(unused_variables)]
3522 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
3523 where
3524 E: serde::de::Error,
3525 {
3526 match value {
3527 "index" => Ok(GeneratedField::Index),
3528 "expr" => Ok(GeneratedField::Expr),
3529 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
3530 }
3531 }
3532 }
3533 deserializer.deserialize_identifier(GeneratedVisitor)
3534 }
3535 }
3536 struct GeneratedVisitor;
3537 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3538 type Value = IndexAndExpr;
3539
3540 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3541 formatter.write_str("struct plan_common.IndexAndExpr")
3542 }
3543
3544 fn visit_map<V>(self, mut map_: V) -> std::result::Result<IndexAndExpr, V::Error>
3545 where
3546 V: serde::de::MapAccess<'de>,
3547 {
3548 let mut index__ = None;
3549 let mut expr__ = None;
3550 while let Some(k) = map_.next_key()? {
3551 match k {
3552 GeneratedField::Index => {
3553 if index__.is_some() {
3554 return Err(serde::de::Error::duplicate_field("index"));
3555 }
3556 index__ =
3557 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
3558 ;
3559 }
3560 GeneratedField::Expr => {
3561 if expr__.is_some() {
3562 return Err(serde::de::Error::duplicate_field("expr"));
3563 }
3564 expr__ = map_.next_value()?;
3565 }
3566 }
3567 }
3568 Ok(IndexAndExpr {
3569 index: index__.unwrap_or_default(),
3570 expr: expr__,
3571 })
3572 }
3573 }
3574 deserializer.deserialize_struct("plan_common.IndexAndExpr", FIELDS, GeneratedVisitor)
3575 }
3576}
3577impl serde::Serialize for JoinType {
3578 #[allow(deprecated)]
3579 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3580 where
3581 S: serde::Serializer,
3582 {
3583 let variant = match self {
3584 Self::Unspecified => "JOIN_TYPE_UNSPECIFIED",
3585 Self::Inner => "JOIN_TYPE_INNER",
3586 Self::LeftOuter => "JOIN_TYPE_LEFT_OUTER",
3587 Self::RightOuter => "JOIN_TYPE_RIGHT_OUTER",
3588 Self::FullOuter => "JOIN_TYPE_FULL_OUTER",
3589 Self::LeftSemi => "JOIN_TYPE_LEFT_SEMI",
3590 Self::LeftAnti => "JOIN_TYPE_LEFT_ANTI",
3591 Self::RightSemi => "JOIN_TYPE_RIGHT_SEMI",
3592 Self::RightAnti => "JOIN_TYPE_RIGHT_ANTI",
3593 Self::AsofInner => "JOIN_TYPE_ASOF_INNER",
3594 Self::AsofLeftOuter => "JOIN_TYPE_ASOF_LEFT_OUTER",
3595 };
3596 serializer.serialize_str(variant)
3597 }
3598}
3599impl<'de> serde::Deserialize<'de> for JoinType {
3600 #[allow(deprecated)]
3601 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3602 where
3603 D: serde::Deserializer<'de>,
3604 {
3605 const FIELDS: &[&str] = &[
3606 "JOIN_TYPE_UNSPECIFIED",
3607 "JOIN_TYPE_INNER",
3608 "JOIN_TYPE_LEFT_OUTER",
3609 "JOIN_TYPE_RIGHT_OUTER",
3610 "JOIN_TYPE_FULL_OUTER",
3611 "JOIN_TYPE_LEFT_SEMI",
3612 "JOIN_TYPE_LEFT_ANTI",
3613 "JOIN_TYPE_RIGHT_SEMI",
3614 "JOIN_TYPE_RIGHT_ANTI",
3615 "JOIN_TYPE_ASOF_INNER",
3616 "JOIN_TYPE_ASOF_LEFT_OUTER",
3617 ];
3618
3619 struct GeneratedVisitor;
3620
3621 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3622 type Value = JoinType;
3623
3624 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3625 write!(formatter, "expected one of: {:?}", &FIELDS)
3626 }
3627
3628 fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
3629 where
3630 E: serde::de::Error,
3631 {
3632 i32::try_from(v)
3633 .ok()
3634 .and_then(|x| x.try_into().ok())
3635 .ok_or_else(|| {
3636 serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
3637 })
3638 }
3639
3640 fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
3641 where
3642 E: serde::de::Error,
3643 {
3644 i32::try_from(v)
3645 .ok()
3646 .and_then(|x| x.try_into().ok())
3647 .ok_or_else(|| {
3648 serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
3649 })
3650 }
3651
3652 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3653 where
3654 E: serde::de::Error,
3655 {
3656 match value {
3657 "JOIN_TYPE_UNSPECIFIED" => Ok(JoinType::Unspecified),
3658 "JOIN_TYPE_INNER" => Ok(JoinType::Inner),
3659 "JOIN_TYPE_LEFT_OUTER" => Ok(JoinType::LeftOuter),
3660 "JOIN_TYPE_RIGHT_OUTER" => Ok(JoinType::RightOuter),
3661 "JOIN_TYPE_FULL_OUTER" => Ok(JoinType::FullOuter),
3662 "JOIN_TYPE_LEFT_SEMI" => Ok(JoinType::LeftSemi),
3663 "JOIN_TYPE_LEFT_ANTI" => Ok(JoinType::LeftAnti),
3664 "JOIN_TYPE_RIGHT_SEMI" => Ok(JoinType::RightSemi),
3665 "JOIN_TYPE_RIGHT_ANTI" => Ok(JoinType::RightAnti),
3666 "JOIN_TYPE_ASOF_INNER" => Ok(JoinType::AsofInner),
3667 "JOIN_TYPE_ASOF_LEFT_OUTER" => Ok(JoinType::AsofLeftOuter),
3668 _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
3669 }
3670 }
3671 }
3672 deserializer.deserialize_any(GeneratedVisitor)
3673 }
3674}
3675impl serde::Serialize for RowFormatType {
3676 #[allow(deprecated)]
3677 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3678 where
3679 S: serde::Serializer,
3680 {
3681 let variant = match self {
3682 Self::RowUnspecified => "ROW_UNSPECIFIED",
3683 Self::Json => "JSON",
3684 Self::Protobuf => "PROTOBUF",
3685 Self::DebeziumJson => "DEBEZIUM_JSON",
3686 Self::Avro => "AVRO",
3687 Self::Maxwell => "MAXWELL",
3688 Self::CanalJson => "CANAL_JSON",
3689 Self::Csv => "CSV",
3690 Self::Native => "NATIVE",
3691 Self::DebeziumAvro => "DEBEZIUM_AVRO",
3692 Self::UpsertJson => "UPSERT_JSON",
3693 Self::UpsertAvro => "UPSERT_AVRO",
3694 Self::DebeziumMongoJson => "DEBEZIUM_MONGO_JSON",
3695 Self::Bytes => "BYTES",
3696 };
3697 serializer.serialize_str(variant)
3698 }
3699}
3700impl<'de> serde::Deserialize<'de> for RowFormatType {
3701 #[allow(deprecated)]
3702 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3703 where
3704 D: serde::Deserializer<'de>,
3705 {
3706 const FIELDS: &[&str] = &[
3707 "ROW_UNSPECIFIED",
3708 "JSON",
3709 "PROTOBUF",
3710 "DEBEZIUM_JSON",
3711 "AVRO",
3712 "MAXWELL",
3713 "CANAL_JSON",
3714 "CSV",
3715 "NATIVE",
3716 "DEBEZIUM_AVRO",
3717 "UPSERT_JSON",
3718 "UPSERT_AVRO",
3719 "DEBEZIUM_MONGO_JSON",
3720 "BYTES",
3721 ];
3722
3723 struct GeneratedVisitor;
3724
3725 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3726 type Value = RowFormatType;
3727
3728 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3729 write!(formatter, "expected one of: {:?}", &FIELDS)
3730 }
3731
3732 fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
3733 where
3734 E: serde::de::Error,
3735 {
3736 i32::try_from(v)
3737 .ok()
3738 .and_then(|x| x.try_into().ok())
3739 .ok_or_else(|| {
3740 serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
3741 })
3742 }
3743
3744 fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
3745 where
3746 E: serde::de::Error,
3747 {
3748 i32::try_from(v)
3749 .ok()
3750 .and_then(|x| x.try_into().ok())
3751 .ok_or_else(|| {
3752 serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
3753 })
3754 }
3755
3756 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3757 where
3758 E: serde::de::Error,
3759 {
3760 match value {
3761 "ROW_UNSPECIFIED" => Ok(RowFormatType::RowUnspecified),
3762 "JSON" => Ok(RowFormatType::Json),
3763 "PROTOBUF" => Ok(RowFormatType::Protobuf),
3764 "DEBEZIUM_JSON" => Ok(RowFormatType::DebeziumJson),
3765 "AVRO" => Ok(RowFormatType::Avro),
3766 "MAXWELL" => Ok(RowFormatType::Maxwell),
3767 "CANAL_JSON" => Ok(RowFormatType::CanalJson),
3768 "CSV" => Ok(RowFormatType::Csv),
3769 "NATIVE" => Ok(RowFormatType::Native),
3770 "DEBEZIUM_AVRO" => Ok(RowFormatType::DebeziumAvro),
3771 "UPSERT_JSON" => Ok(RowFormatType::UpsertJson),
3772 "UPSERT_AVRO" => Ok(RowFormatType::UpsertAvro),
3773 "DEBEZIUM_MONGO_JSON" => Ok(RowFormatType::DebeziumMongoJson),
3774 "BYTES" => Ok(RowFormatType::Bytes),
3775 _ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
3776 }
3777 }
3778 }
3779 deserializer.deserialize_any(GeneratedVisitor)
3780 }
3781}
3782impl serde::Serialize for StorageTableDesc {
3783 #[allow(deprecated)]
3784 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3785 where
3786 S: serde::Serializer,
3787 {
3788 use serde::ser::SerializeStruct;
3789 let mut len = 0;
3790 if self.table_id != 0 {
3791 len += 1;
3792 }
3793 if !self.columns.is_empty() {
3794 len += 1;
3795 }
3796 if !self.pk.is_empty() {
3797 len += 1;
3798 }
3799 if !self.dist_key_in_pk_indices.is_empty() {
3800 len += 1;
3801 }
3802 if !self.value_indices.is_empty() {
3803 len += 1;
3804 }
3805 if self.read_prefix_len_hint != 0 {
3806 len += 1;
3807 }
3808 if self.versioned {
3809 len += 1;
3810 }
3811 if !self.stream_key.is_empty() {
3812 len += 1;
3813 }
3814 if self.vnode_col_idx_in_pk.is_some() {
3815 len += 1;
3816 }
3817 if self.retention_seconds.is_some() {
3818 len += 1;
3819 }
3820 if self.maybe_vnode_count.is_some() {
3821 len += 1;
3822 }
3823 let mut struct_ser = serializer.serialize_struct("plan_common.StorageTableDesc", len)?;
3824 if self.table_id != 0 {
3825 struct_ser.serialize_field("tableId", &self.table_id)?;
3826 }
3827 if !self.columns.is_empty() {
3828 struct_ser.serialize_field("columns", &self.columns)?;
3829 }
3830 if !self.pk.is_empty() {
3831 struct_ser.serialize_field("pk", &self.pk)?;
3832 }
3833 if !self.dist_key_in_pk_indices.is_empty() {
3834 struct_ser.serialize_field("distKeyInPkIndices", &self.dist_key_in_pk_indices)?;
3835 }
3836 if !self.value_indices.is_empty() {
3837 struct_ser.serialize_field("valueIndices", &self.value_indices)?;
3838 }
3839 if self.read_prefix_len_hint != 0 {
3840 struct_ser.serialize_field("readPrefixLenHint", &self.read_prefix_len_hint)?;
3841 }
3842 if self.versioned {
3843 struct_ser.serialize_field("versioned", &self.versioned)?;
3844 }
3845 if !self.stream_key.is_empty() {
3846 struct_ser.serialize_field("streamKey", &self.stream_key)?;
3847 }
3848 if let Some(v) = self.vnode_col_idx_in_pk.as_ref() {
3849 struct_ser.serialize_field("vnodeColIdxInPk", v)?;
3850 }
3851 if let Some(v) = self.retention_seconds.as_ref() {
3852 struct_ser.serialize_field("retentionSeconds", v)?;
3853 }
3854 if let Some(v) = self.maybe_vnode_count.as_ref() {
3855 struct_ser.serialize_field("maybeVnodeCount", v)?;
3856 }
3857 struct_ser.end()
3858 }
3859}
3860impl<'de> serde::Deserialize<'de> for StorageTableDesc {
3861 #[allow(deprecated)]
3862 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3863 where
3864 D: serde::Deserializer<'de>,
3865 {
3866 const FIELDS: &[&str] = &[
3867 "table_id",
3868 "tableId",
3869 "columns",
3870 "pk",
3871 "dist_key_in_pk_indices",
3872 "distKeyInPkIndices",
3873 "value_indices",
3874 "valueIndices",
3875 "read_prefix_len_hint",
3876 "readPrefixLenHint",
3877 "versioned",
3878 "stream_key",
3879 "streamKey",
3880 "vnode_col_idx_in_pk",
3881 "vnodeColIdxInPk",
3882 "retention_seconds",
3883 "retentionSeconds",
3884 "maybe_vnode_count",
3885 "maybeVnodeCount",
3886 ];
3887
3888 #[allow(clippy::enum_variant_names)]
3889 enum GeneratedField {
3890 TableId,
3891 Columns,
3892 Pk,
3893 DistKeyInPkIndices,
3894 ValueIndices,
3895 ReadPrefixLenHint,
3896 Versioned,
3897 StreamKey,
3898 VnodeColIdxInPk,
3899 RetentionSeconds,
3900 MaybeVnodeCount,
3901 }
3902 impl<'de> serde::Deserialize<'de> for GeneratedField {
3903 fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
3904 where
3905 D: serde::Deserializer<'de>,
3906 {
3907 struct GeneratedVisitor;
3908
3909 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3910 type Value = GeneratedField;
3911
3912 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3913 write!(formatter, "expected one of: {:?}", &FIELDS)
3914 }
3915
3916 #[allow(unused_variables)]
3917 fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
3918 where
3919 E: serde::de::Error,
3920 {
3921 match value {
3922 "tableId" | "table_id" => Ok(GeneratedField::TableId),
3923 "columns" => Ok(GeneratedField::Columns),
3924 "pk" => Ok(GeneratedField::Pk),
3925 "distKeyInPkIndices" | "dist_key_in_pk_indices" => Ok(GeneratedField::DistKeyInPkIndices),
3926 "valueIndices" | "value_indices" => Ok(GeneratedField::ValueIndices),
3927 "readPrefixLenHint" | "read_prefix_len_hint" => Ok(GeneratedField::ReadPrefixLenHint),
3928 "versioned" => Ok(GeneratedField::Versioned),
3929 "streamKey" | "stream_key" => Ok(GeneratedField::StreamKey),
3930 "vnodeColIdxInPk" | "vnode_col_idx_in_pk" => Ok(GeneratedField::VnodeColIdxInPk),
3931 "retentionSeconds" | "retention_seconds" => Ok(GeneratedField::RetentionSeconds),
3932 "maybeVnodeCount" | "maybe_vnode_count" => Ok(GeneratedField::MaybeVnodeCount),
3933 _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
3934 }
3935 }
3936 }
3937 deserializer.deserialize_identifier(GeneratedVisitor)
3938 }
3939 }
3940 struct GeneratedVisitor;
3941 impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
3942 type Value = StorageTableDesc;
3943
3944 fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3945 formatter.write_str("struct plan_common.StorageTableDesc")
3946 }
3947
3948 fn visit_map<V>(self, mut map_: V) -> std::result::Result<StorageTableDesc, V::Error>
3949 where
3950 V: serde::de::MapAccess<'de>,
3951 {
3952 let mut table_id__ = None;
3953 let mut columns__ = None;
3954 let mut pk__ = None;
3955 let mut dist_key_in_pk_indices__ = None;
3956 let mut value_indices__ = None;
3957 let mut read_prefix_len_hint__ = None;
3958 let mut versioned__ = None;
3959 let mut stream_key__ = None;
3960 let mut vnode_col_idx_in_pk__ = None;
3961 let mut retention_seconds__ = None;
3962 let mut maybe_vnode_count__ = None;
3963 while let Some(k) = map_.next_key()? {
3964 match k {
3965 GeneratedField::TableId => {
3966 if table_id__.is_some() {
3967 return Err(serde::de::Error::duplicate_field("tableId"));
3968 }
3969 table_id__ =
3970 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
3971 ;
3972 }
3973 GeneratedField::Columns => {
3974 if columns__.is_some() {
3975 return Err(serde::de::Error::duplicate_field("columns"));
3976 }
3977 columns__ = Some(map_.next_value()?);
3978 }
3979 GeneratedField::Pk => {
3980 if pk__.is_some() {
3981 return Err(serde::de::Error::duplicate_field("pk"));
3982 }
3983 pk__ = Some(map_.next_value()?);
3984 }
3985 GeneratedField::DistKeyInPkIndices => {
3986 if dist_key_in_pk_indices__.is_some() {
3987 return Err(serde::de::Error::duplicate_field("distKeyInPkIndices"));
3988 }
3989 dist_key_in_pk_indices__ =
3990 Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
3991 .into_iter().map(|x| x.0).collect())
3992 ;
3993 }
3994 GeneratedField::ValueIndices => {
3995 if value_indices__.is_some() {
3996 return Err(serde::de::Error::duplicate_field("valueIndices"));
3997 }
3998 value_indices__ =
3999 Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
4000 .into_iter().map(|x| x.0).collect())
4001 ;
4002 }
4003 GeneratedField::ReadPrefixLenHint => {
4004 if read_prefix_len_hint__.is_some() {
4005 return Err(serde::de::Error::duplicate_field("readPrefixLenHint"));
4006 }
4007 read_prefix_len_hint__ =
4008 Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
4009 ;
4010 }
4011 GeneratedField::Versioned => {
4012 if versioned__.is_some() {
4013 return Err(serde::de::Error::duplicate_field("versioned"));
4014 }
4015 versioned__ = Some(map_.next_value()?);
4016 }
4017 GeneratedField::StreamKey => {
4018 if stream_key__.is_some() {
4019 return Err(serde::de::Error::duplicate_field("streamKey"));
4020 }
4021 stream_key__ =
4022 Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
4023 .into_iter().map(|x| x.0).collect())
4024 ;
4025 }
4026 GeneratedField::VnodeColIdxInPk => {
4027 if vnode_col_idx_in_pk__.is_some() {
4028 return Err(serde::de::Error::duplicate_field("vnodeColIdxInPk"));
4029 }
4030 vnode_col_idx_in_pk__ =
4031 map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
4032 ;
4033 }
4034 GeneratedField::RetentionSeconds => {
4035 if retention_seconds__.is_some() {
4036 return Err(serde::de::Error::duplicate_field("retentionSeconds"));
4037 }
4038 retention_seconds__ =
4039 map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
4040 ;
4041 }
4042 GeneratedField::MaybeVnodeCount => {
4043 if maybe_vnode_count__.is_some() {
4044 return Err(serde::de::Error::duplicate_field("maybeVnodeCount"));
4045 }
4046 maybe_vnode_count__ =
4047 map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
4048 ;
4049 }
4050 }
4051 }
4052 Ok(StorageTableDesc {
4053 table_id: table_id__.unwrap_or_default(),
4054 columns: columns__.unwrap_or_default(),
4055 pk: pk__.unwrap_or_default(),
4056 dist_key_in_pk_indices: dist_key_in_pk_indices__.unwrap_or_default(),
4057 value_indices: value_indices__.unwrap_or_default(),
4058 read_prefix_len_hint: read_prefix_len_hint__.unwrap_or_default(),
4059 versioned: versioned__.unwrap_or_default(),
4060 stream_key: stream_key__.unwrap_or_default(),
4061 vnode_col_idx_in_pk: vnode_col_idx_in_pk__,
4062 retention_seconds: retention_seconds__,
4063 maybe_vnode_count: maybe_vnode_count__,
4064 })
4065 }
4066 }
4067 deserializer.deserialize_struct("plan_common.StorageTableDesc", FIELDS, GeneratedVisitor)
4068 }
4069}