use crate::stream_plan::*;
impl serde::Serialize for ActorMapping {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.original_indices.is_empty() {
len += 1;
}
if !self.data.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.ActorMapping", len)?;
if !self.original_indices.is_empty() {
struct_ser.serialize_field("originalIndices", &self.original_indices)?;
}
if !self.data.is_empty() {
struct_ser.serialize_field("data", &self.data)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ActorMapping {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"original_indices",
"originalIndices",
"data",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
OriginalIndices,
Data,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"originalIndices" | "original_indices" => Ok(GeneratedField::OriginalIndices),
"data" => Ok(GeneratedField::Data),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ActorMapping;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.ActorMapping")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ActorMapping, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut original_indices__ = None;
let mut data__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::OriginalIndices => {
if original_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("originalIndices"));
}
original_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::Data => {
if data__.is_some() {
return Err(serde::de::Error::duplicate_field("data"));
}
data__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(ActorMapping {
original_indices: original_indices__.unwrap_or_default(),
data: data__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.ActorMapping", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for AddMutation {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.actor_dispatchers.is_empty() {
len += 1;
}
if !self.added_actors.is_empty() {
len += 1;
}
if !self.actor_splits.is_empty() {
len += 1;
}
if self.pause {
len += 1;
}
if !self.subscriptions_to_add.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.AddMutation", len)?;
if !self.actor_dispatchers.is_empty() {
struct_ser.serialize_field("actorDispatchers", &self.actor_dispatchers)?;
}
if !self.added_actors.is_empty() {
struct_ser.serialize_field("addedActors", &self.added_actors)?;
}
if !self.actor_splits.is_empty() {
struct_ser.serialize_field("actorSplits", &self.actor_splits)?;
}
if self.pause {
struct_ser.serialize_field("pause", &self.pause)?;
}
if !self.subscriptions_to_add.is_empty() {
struct_ser.serialize_field("subscriptionsToAdd", &self.subscriptions_to_add)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for AddMutation {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"actor_dispatchers",
"actorDispatchers",
"added_actors",
"addedActors",
"actor_splits",
"actorSplits",
"pause",
"subscriptions_to_add",
"subscriptionsToAdd",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ActorDispatchers,
AddedActors,
ActorSplits,
Pause,
SubscriptionsToAdd,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"actorDispatchers" | "actor_dispatchers" => Ok(GeneratedField::ActorDispatchers),
"addedActors" | "added_actors" => Ok(GeneratedField::AddedActors),
"actorSplits" | "actor_splits" => Ok(GeneratedField::ActorSplits),
"pause" => Ok(GeneratedField::Pause),
"subscriptionsToAdd" | "subscriptions_to_add" => Ok(GeneratedField::SubscriptionsToAdd),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = AddMutation;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.AddMutation")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<AddMutation, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut actor_dispatchers__ = None;
let mut added_actors__ = None;
let mut actor_splits__ = None;
let mut pause__ = None;
let mut subscriptions_to_add__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ActorDispatchers => {
if actor_dispatchers__.is_some() {
return Err(serde::de::Error::duplicate_field("actorDispatchers"));
}
actor_dispatchers__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::AddedActors => {
if added_actors__.is_some() {
return Err(serde::de::Error::duplicate_field("addedActors"));
}
added_actors__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::ActorSplits => {
if actor_splits__.is_some() {
return Err(serde::de::Error::duplicate_field("actorSplits"));
}
actor_splits__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::Pause => {
if pause__.is_some() {
return Err(serde::de::Error::duplicate_field("pause"));
}
pause__ = Some(map_.next_value()?);
}
GeneratedField::SubscriptionsToAdd => {
if subscriptions_to_add__.is_some() {
return Err(serde::de::Error::duplicate_field("subscriptionsToAdd"));
}
subscriptions_to_add__ = Some(map_.next_value()?);
}
}
}
Ok(AddMutation {
actor_dispatchers: actor_dispatchers__.unwrap_or_default(),
added_actors: added_actors__.unwrap_or_default(),
actor_splits: actor_splits__.unwrap_or_default(),
pause: pause__.unwrap_or_default(),
subscriptions_to_add: subscriptions_to_add__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.AddMutation", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for AggCallState {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.inner.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.AggCallState", len)?;
if let Some(v) = self.inner.as_ref() {
match v {
agg_call_state::Inner::ValueState(v) => {
struct_ser.serialize_field("valueState", v)?;
}
agg_call_state::Inner::MaterializedInputState(v) => {
struct_ser.serialize_field("materializedInputState", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for AggCallState {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"value_state",
"valueState",
"materialized_input_state",
"materializedInputState",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ValueState,
MaterializedInputState,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"valueState" | "value_state" => Ok(GeneratedField::ValueState),
"materializedInputState" | "materialized_input_state" => Ok(GeneratedField::MaterializedInputState),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = AggCallState;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.AggCallState")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<AggCallState, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut inner__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ValueState => {
if inner__.is_some() {
return Err(serde::de::Error::duplicate_field("valueState"));
}
inner__ = map_.next_value::<::std::option::Option<_>>()?.map(agg_call_state::Inner::ValueState)
;
}
GeneratedField::MaterializedInputState => {
if inner__.is_some() {
return Err(serde::de::Error::duplicate_field("materializedInputState"));
}
inner__ = map_.next_value::<::std::option::Option<_>>()?.map(agg_call_state::Inner::MaterializedInputState)
;
}
}
}
Ok(AggCallState {
inner: inner__,
})
}
}
deserializer.deserialize_struct("stream_plan.AggCallState", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for agg_call_state::MaterializedInputState {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.table.is_some() {
len += 1;
}
if !self.included_upstream_indices.is_empty() {
len += 1;
}
if !self.table_value_indices.is_empty() {
len += 1;
}
if !self.order_columns.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.AggCallState.MaterializedInputState", len)?;
if let Some(v) = self.table.as_ref() {
struct_ser.serialize_field("table", v)?;
}
if !self.included_upstream_indices.is_empty() {
struct_ser.serialize_field("includedUpstreamIndices", &self.included_upstream_indices)?;
}
if !self.table_value_indices.is_empty() {
struct_ser.serialize_field("tableValueIndices", &self.table_value_indices)?;
}
if !self.order_columns.is_empty() {
struct_ser.serialize_field("orderColumns", &self.order_columns)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for agg_call_state::MaterializedInputState {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table",
"included_upstream_indices",
"includedUpstreamIndices",
"table_value_indices",
"tableValueIndices",
"order_columns",
"orderColumns",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Table,
IncludedUpstreamIndices,
TableValueIndices,
OrderColumns,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"table" => Ok(GeneratedField::Table),
"includedUpstreamIndices" | "included_upstream_indices" => Ok(GeneratedField::IncludedUpstreamIndices),
"tableValueIndices" | "table_value_indices" => Ok(GeneratedField::TableValueIndices),
"orderColumns" | "order_columns" => Ok(GeneratedField::OrderColumns),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = agg_call_state::MaterializedInputState;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.AggCallState.MaterializedInputState")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<agg_call_state::MaterializedInputState, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table__ = None;
let mut included_upstream_indices__ = None;
let mut table_value_indices__ = None;
let mut order_columns__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Table => {
if table__.is_some() {
return Err(serde::de::Error::duplicate_field("table"));
}
table__ = map_.next_value()?;
}
GeneratedField::IncludedUpstreamIndices => {
if included_upstream_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("includedUpstreamIndices"));
}
included_upstream_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::TableValueIndices => {
if table_value_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("tableValueIndices"));
}
table_value_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::OrderColumns => {
if order_columns__.is_some() {
return Err(serde::de::Error::duplicate_field("orderColumns"));
}
order_columns__ = Some(map_.next_value()?);
}
}
}
Ok(agg_call_state::MaterializedInputState {
table: table__,
included_upstream_indices: included_upstream_indices__.unwrap_or_default(),
table_value_indices: table_value_indices__.unwrap_or_default(),
order_columns: order_columns__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.AggCallState.MaterializedInputState", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for agg_call_state::ValueState {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("stream_plan.AggCallState.ValueState", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for agg_call_state::ValueState {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = agg_call_state::ValueState;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.AggCallState.ValueState")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<agg_call_state::ValueState, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(agg_call_state::ValueState {
})
}
}
deserializer.deserialize_struct("stream_plan.AggCallState.ValueState", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for AggNodeVersion {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
let variant = match self {
Self::Unspecified => "AGG_NODE_VERSION_UNSPECIFIED",
Self::Issue12140 => "AGG_NODE_VERSION_ISSUE_12140",
Self::Issue13465 => "AGG_NODE_VERSION_ISSUE_13465",
Self::Max => "AGG_NODE_VERSION_MAX",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for AggNodeVersion {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"AGG_NODE_VERSION_UNSPECIFIED",
"AGG_NODE_VERSION_ISSUE_12140",
"AGG_NODE_VERSION_ISSUE_13465",
"AGG_NODE_VERSION_MAX",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = AggNodeVersion;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
})
}
fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
})
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
match value {
"AGG_NODE_VERSION_UNSPECIFIED" => Ok(AggNodeVersion::Unspecified),
"AGG_NODE_VERSION_ISSUE_12140" => Ok(AggNodeVersion::Issue12140),
"AGG_NODE_VERSION_ISSUE_13465" => Ok(AggNodeVersion::Issue13465),
"AGG_NODE_VERSION_MAX" => Ok(AggNodeVersion::Max),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for ArrangeNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.table_info.is_some() {
len += 1;
}
if !self.distribution_key.is_empty() {
len += 1;
}
if self.table.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.ArrangeNode", len)?;
if let Some(v) = self.table_info.as_ref() {
struct_ser.serialize_field("tableInfo", v)?;
}
if !self.distribution_key.is_empty() {
struct_ser.serialize_field("distributionKey", &self.distribution_key)?;
}
if let Some(v) = self.table.as_ref() {
struct_ser.serialize_field("table", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ArrangeNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table_info",
"tableInfo",
"distribution_key",
"distributionKey",
"table",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableInfo,
DistributionKey,
Table,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"tableInfo" | "table_info" => Ok(GeneratedField::TableInfo),
"distributionKey" | "distribution_key" => Ok(GeneratedField::DistributionKey),
"table" => Ok(GeneratedField::Table),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ArrangeNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.ArrangeNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ArrangeNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_info__ = None;
let mut distribution_key__ = None;
let mut table__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TableInfo => {
if table_info__.is_some() {
return Err(serde::de::Error::duplicate_field("tableInfo"));
}
table_info__ = map_.next_value()?;
}
GeneratedField::DistributionKey => {
if distribution_key__.is_some() {
return Err(serde::de::Error::duplicate_field("distributionKey"));
}
distribution_key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::Table => {
if table__.is_some() {
return Err(serde::de::Error::duplicate_field("table"));
}
table__ = map_.next_value()?;
}
}
}
Ok(ArrangeNode {
table_info: table_info__,
distribution_key: distribution_key__.unwrap_or_default(),
table: table__,
})
}
}
deserializer.deserialize_struct("stream_plan.ArrangeNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ArrangementInfo {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.arrange_key_orders.is_empty() {
len += 1;
}
if !self.column_descs.is_empty() {
len += 1;
}
if self.table_desc.is_some() {
len += 1;
}
if !self.output_col_idx.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.ArrangementInfo", len)?;
if !self.arrange_key_orders.is_empty() {
struct_ser.serialize_field("arrangeKeyOrders", &self.arrange_key_orders)?;
}
if !self.column_descs.is_empty() {
struct_ser.serialize_field("columnDescs", &self.column_descs)?;
}
if let Some(v) = self.table_desc.as_ref() {
struct_ser.serialize_field("tableDesc", v)?;
}
if !self.output_col_idx.is_empty() {
struct_ser.serialize_field("outputColIdx", &self.output_col_idx)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ArrangementInfo {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"arrange_key_orders",
"arrangeKeyOrders",
"column_descs",
"columnDescs",
"table_desc",
"tableDesc",
"output_col_idx",
"outputColIdx",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ArrangeKeyOrders,
ColumnDescs,
TableDesc,
OutputColIdx,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"arrangeKeyOrders" | "arrange_key_orders" => Ok(GeneratedField::ArrangeKeyOrders),
"columnDescs" | "column_descs" => Ok(GeneratedField::ColumnDescs),
"tableDesc" | "table_desc" => Ok(GeneratedField::TableDesc),
"outputColIdx" | "output_col_idx" => Ok(GeneratedField::OutputColIdx),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ArrangementInfo;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.ArrangementInfo")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ArrangementInfo, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut arrange_key_orders__ = None;
let mut column_descs__ = None;
let mut table_desc__ = None;
let mut output_col_idx__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ArrangeKeyOrders => {
if arrange_key_orders__.is_some() {
return Err(serde::de::Error::duplicate_field("arrangeKeyOrders"));
}
arrange_key_orders__ = Some(map_.next_value()?);
}
GeneratedField::ColumnDescs => {
if column_descs__.is_some() {
return Err(serde::de::Error::duplicate_field("columnDescs"));
}
column_descs__ = Some(map_.next_value()?);
}
GeneratedField::TableDesc => {
if table_desc__.is_some() {
return Err(serde::de::Error::duplicate_field("tableDesc"));
}
table_desc__ = map_.next_value()?;
}
GeneratedField::OutputColIdx => {
if output_col_idx__.is_some() {
return Err(serde::de::Error::duplicate_field("outputColIdx"));
}
output_col_idx__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(ArrangementInfo {
arrange_key_orders: arrange_key_orders__.unwrap_or_default(),
column_descs: column_descs__.unwrap_or_default(),
table_desc: table_desc__,
output_col_idx: output_col_idx__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.ArrangementInfo", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for AsOfJoinNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.join_type != 0 {
len += 1;
}
if !self.left_key.is_empty() {
len += 1;
}
if !self.right_key.is_empty() {
len += 1;
}
if self.left_table.is_some() {
len += 1;
}
if self.right_table.is_some() {
len += 1;
}
if !self.output_indices.is_empty() {
len += 1;
}
if !self.left_deduped_input_pk_indices.is_empty() {
len += 1;
}
if !self.right_deduped_input_pk_indices.is_empty() {
len += 1;
}
if !self.null_safe.is_empty() {
len += 1;
}
if self.asof_desc.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.AsOfJoinNode", len)?;
if self.join_type != 0 {
let v = super::plan_common::AsOfJoinType::try_from(self.join_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.join_type)))?;
struct_ser.serialize_field("joinType", &v)?;
}
if !self.left_key.is_empty() {
struct_ser.serialize_field("leftKey", &self.left_key)?;
}
if !self.right_key.is_empty() {
struct_ser.serialize_field("rightKey", &self.right_key)?;
}
if let Some(v) = self.left_table.as_ref() {
struct_ser.serialize_field("leftTable", v)?;
}
if let Some(v) = self.right_table.as_ref() {
struct_ser.serialize_field("rightTable", v)?;
}
if !self.output_indices.is_empty() {
struct_ser.serialize_field("outputIndices", &self.output_indices)?;
}
if !self.left_deduped_input_pk_indices.is_empty() {
struct_ser.serialize_field("leftDedupedInputPkIndices", &self.left_deduped_input_pk_indices)?;
}
if !self.right_deduped_input_pk_indices.is_empty() {
struct_ser.serialize_field("rightDedupedInputPkIndices", &self.right_deduped_input_pk_indices)?;
}
if !self.null_safe.is_empty() {
struct_ser.serialize_field("nullSafe", &self.null_safe)?;
}
if let Some(v) = self.asof_desc.as_ref() {
struct_ser.serialize_field("asofDesc", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for AsOfJoinNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"join_type",
"joinType",
"left_key",
"leftKey",
"right_key",
"rightKey",
"left_table",
"leftTable",
"right_table",
"rightTable",
"output_indices",
"outputIndices",
"left_deduped_input_pk_indices",
"leftDedupedInputPkIndices",
"right_deduped_input_pk_indices",
"rightDedupedInputPkIndices",
"null_safe",
"nullSafe",
"asof_desc",
"asofDesc",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
JoinType,
LeftKey,
RightKey,
LeftTable,
RightTable,
OutputIndices,
LeftDedupedInputPkIndices,
RightDedupedInputPkIndices,
NullSafe,
AsofDesc,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"joinType" | "join_type" => Ok(GeneratedField::JoinType),
"leftKey" | "left_key" => Ok(GeneratedField::LeftKey),
"rightKey" | "right_key" => Ok(GeneratedField::RightKey),
"leftTable" | "left_table" => Ok(GeneratedField::LeftTable),
"rightTable" | "right_table" => Ok(GeneratedField::RightTable),
"outputIndices" | "output_indices" => Ok(GeneratedField::OutputIndices),
"leftDedupedInputPkIndices" | "left_deduped_input_pk_indices" => Ok(GeneratedField::LeftDedupedInputPkIndices),
"rightDedupedInputPkIndices" | "right_deduped_input_pk_indices" => Ok(GeneratedField::RightDedupedInputPkIndices),
"nullSafe" | "null_safe" => Ok(GeneratedField::NullSafe),
"asofDesc" | "asof_desc" => Ok(GeneratedField::AsofDesc),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = AsOfJoinNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.AsOfJoinNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<AsOfJoinNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut join_type__ = None;
let mut left_key__ = None;
let mut right_key__ = None;
let mut left_table__ = None;
let mut right_table__ = None;
let mut output_indices__ = None;
let mut left_deduped_input_pk_indices__ = None;
let mut right_deduped_input_pk_indices__ = None;
let mut null_safe__ = None;
let mut asof_desc__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::JoinType => {
if join_type__.is_some() {
return Err(serde::de::Error::duplicate_field("joinType"));
}
join_type__ = Some(map_.next_value::<super::plan_common::AsOfJoinType>()? as i32);
}
GeneratedField::LeftKey => {
if left_key__.is_some() {
return Err(serde::de::Error::duplicate_field("leftKey"));
}
left_key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::RightKey => {
if right_key__.is_some() {
return Err(serde::de::Error::duplicate_field("rightKey"));
}
right_key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::LeftTable => {
if left_table__.is_some() {
return Err(serde::de::Error::duplicate_field("leftTable"));
}
left_table__ = map_.next_value()?;
}
GeneratedField::RightTable => {
if right_table__.is_some() {
return Err(serde::de::Error::duplicate_field("rightTable"));
}
right_table__ = map_.next_value()?;
}
GeneratedField::OutputIndices => {
if output_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("outputIndices"));
}
output_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::LeftDedupedInputPkIndices => {
if left_deduped_input_pk_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("leftDedupedInputPkIndices"));
}
left_deduped_input_pk_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::RightDedupedInputPkIndices => {
if right_deduped_input_pk_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("rightDedupedInputPkIndices"));
}
right_deduped_input_pk_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::NullSafe => {
if null_safe__.is_some() {
return Err(serde::de::Error::duplicate_field("nullSafe"));
}
null_safe__ = Some(map_.next_value()?);
}
GeneratedField::AsofDesc => {
if asof_desc__.is_some() {
return Err(serde::de::Error::duplicate_field("asofDesc"));
}
asof_desc__ = map_.next_value()?;
}
}
}
Ok(AsOfJoinNode {
join_type: join_type__.unwrap_or_default(),
left_key: left_key__.unwrap_or_default(),
right_key: right_key__.unwrap_or_default(),
left_table: left_table__,
right_table: right_table__,
output_indices: output_indices__.unwrap_or_default(),
left_deduped_input_pk_indices: left_deduped_input_pk_indices__.unwrap_or_default(),
right_deduped_input_pk_indices: right_deduped_input_pk_indices__.unwrap_or_default(),
null_safe: null_safe__.unwrap_or_default(),
asof_desc: asof_desc__,
})
}
}
deserializer.deserialize_struct("stream_plan.AsOfJoinNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for Barrier {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.epoch.is_some() {
len += 1;
}
if self.mutation.is_some() {
len += 1;
}
if !self.tracing_context.is_empty() {
len += 1;
}
if self.kind != 0 {
len += 1;
}
if !self.passed_actors.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.Barrier", len)?;
if let Some(v) = self.epoch.as_ref() {
struct_ser.serialize_field("epoch", v)?;
}
if let Some(v) = self.mutation.as_ref() {
struct_ser.serialize_field("mutation", v)?;
}
if !self.tracing_context.is_empty() {
struct_ser.serialize_field("tracingContext", &self.tracing_context)?;
}
if self.kind != 0 {
let v = barrier::BarrierKind::try_from(self.kind)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.kind)))?;
struct_ser.serialize_field("kind", &v)?;
}
if !self.passed_actors.is_empty() {
struct_ser.serialize_field("passedActors", &self.passed_actors)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for Barrier {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"epoch",
"mutation",
"tracing_context",
"tracingContext",
"kind",
"passed_actors",
"passedActors",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Epoch,
Mutation,
TracingContext,
Kind,
PassedActors,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"epoch" => Ok(GeneratedField::Epoch),
"mutation" => Ok(GeneratedField::Mutation),
"tracingContext" | "tracing_context" => Ok(GeneratedField::TracingContext),
"kind" => Ok(GeneratedField::Kind),
"passedActors" | "passed_actors" => Ok(GeneratedField::PassedActors),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = Barrier;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.Barrier")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<Barrier, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut epoch__ = None;
let mut mutation__ = None;
let mut tracing_context__ = None;
let mut kind__ = None;
let mut passed_actors__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Epoch => {
if epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("epoch"));
}
epoch__ = map_.next_value()?;
}
GeneratedField::Mutation => {
if mutation__.is_some() {
return Err(serde::de::Error::duplicate_field("mutation"));
}
mutation__ = map_.next_value()?;
}
GeneratedField::TracingContext => {
if tracing_context__.is_some() {
return Err(serde::de::Error::duplicate_field("tracingContext"));
}
tracing_context__ = Some(
map_.next_value::<std::collections::HashMap<_, _>>()?
);
}
GeneratedField::Kind => {
if kind__.is_some() {
return Err(serde::de::Error::duplicate_field("kind"));
}
kind__ = Some(map_.next_value::<barrier::BarrierKind>()? as i32);
}
GeneratedField::PassedActors => {
if passed_actors__.is_some() {
return Err(serde::de::Error::duplicate_field("passedActors"));
}
passed_actors__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(Barrier {
epoch: epoch__,
mutation: mutation__,
tracing_context: tracing_context__.unwrap_or_default(),
kind: kind__.unwrap_or_default(),
passed_actors: passed_actors__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.Barrier", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for barrier::BarrierKind {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
let variant = match self {
Self::Unspecified => "BARRIER_KIND_UNSPECIFIED",
Self::Initial => "BARRIER_KIND_INITIAL",
Self::Barrier => "BARRIER_KIND_BARRIER",
Self::Checkpoint => "BARRIER_KIND_CHECKPOINT",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for barrier::BarrierKind {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"BARRIER_KIND_UNSPECIFIED",
"BARRIER_KIND_INITIAL",
"BARRIER_KIND_BARRIER",
"BARRIER_KIND_CHECKPOINT",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = barrier::BarrierKind;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
})
}
fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
})
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
match value {
"BARRIER_KIND_UNSPECIFIED" => Ok(barrier::BarrierKind::Unspecified),
"BARRIER_KIND_INITIAL" => Ok(barrier::BarrierKind::Initial),
"BARRIER_KIND_BARRIER" => Ok(barrier::BarrierKind::Barrier),
"BARRIER_KIND_CHECKPOINT" => Ok(barrier::BarrierKind::Checkpoint),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for BarrierMutation {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.mutation.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.BarrierMutation", len)?;
if let Some(v) = self.mutation.as_ref() {
match v {
barrier_mutation::Mutation::Add(v) => {
struct_ser.serialize_field("add", v)?;
}
barrier_mutation::Mutation::Stop(v) => {
struct_ser.serialize_field("stop", v)?;
}
barrier_mutation::Mutation::Update(v) => {
struct_ser.serialize_field("update", v)?;
}
barrier_mutation::Mutation::Splits(v) => {
struct_ser.serialize_field("splits", v)?;
}
barrier_mutation::Mutation::Pause(v) => {
struct_ser.serialize_field("pause", v)?;
}
barrier_mutation::Mutation::Resume(v) => {
struct_ser.serialize_field("resume", v)?;
}
barrier_mutation::Mutation::Throttle(v) => {
struct_ser.serialize_field("throttle", v)?;
}
barrier_mutation::Mutation::DropSubscriptions(v) => {
struct_ser.serialize_field("dropSubscriptions", v)?;
}
barrier_mutation::Mutation::Combined(v) => {
struct_ser.serialize_field("combined", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for BarrierMutation {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"add",
"stop",
"update",
"splits",
"pause",
"resume",
"throttle",
"drop_subscriptions",
"dropSubscriptions",
"combined",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Add,
Stop,
Update,
Splits,
Pause,
Resume,
Throttle,
DropSubscriptions,
Combined,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"add" => Ok(GeneratedField::Add),
"stop" => Ok(GeneratedField::Stop),
"update" => Ok(GeneratedField::Update),
"splits" => Ok(GeneratedField::Splits),
"pause" => Ok(GeneratedField::Pause),
"resume" => Ok(GeneratedField::Resume),
"throttle" => Ok(GeneratedField::Throttle),
"dropSubscriptions" | "drop_subscriptions" => Ok(GeneratedField::DropSubscriptions),
"combined" => Ok(GeneratedField::Combined),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = BarrierMutation;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.BarrierMutation")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<BarrierMutation, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut mutation__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Add => {
if mutation__.is_some() {
return Err(serde::de::Error::duplicate_field("add"));
}
mutation__ = map_.next_value::<::std::option::Option<_>>()?.map(barrier_mutation::Mutation::Add)
;
}
GeneratedField::Stop => {
if mutation__.is_some() {
return Err(serde::de::Error::duplicate_field("stop"));
}
mutation__ = map_.next_value::<::std::option::Option<_>>()?.map(barrier_mutation::Mutation::Stop)
;
}
GeneratedField::Update => {
if mutation__.is_some() {
return Err(serde::de::Error::duplicate_field("update"));
}
mutation__ = map_.next_value::<::std::option::Option<_>>()?.map(barrier_mutation::Mutation::Update)
;
}
GeneratedField::Splits => {
if mutation__.is_some() {
return Err(serde::de::Error::duplicate_field("splits"));
}
mutation__ = map_.next_value::<::std::option::Option<_>>()?.map(barrier_mutation::Mutation::Splits)
;
}
GeneratedField::Pause => {
if mutation__.is_some() {
return Err(serde::de::Error::duplicate_field("pause"));
}
mutation__ = map_.next_value::<::std::option::Option<_>>()?.map(barrier_mutation::Mutation::Pause)
;
}
GeneratedField::Resume => {
if mutation__.is_some() {
return Err(serde::de::Error::duplicate_field("resume"));
}
mutation__ = map_.next_value::<::std::option::Option<_>>()?.map(barrier_mutation::Mutation::Resume)
;
}
GeneratedField::Throttle => {
if mutation__.is_some() {
return Err(serde::de::Error::duplicate_field("throttle"));
}
mutation__ = map_.next_value::<::std::option::Option<_>>()?.map(barrier_mutation::Mutation::Throttle)
;
}
GeneratedField::DropSubscriptions => {
if mutation__.is_some() {
return Err(serde::de::Error::duplicate_field("dropSubscriptions"));
}
mutation__ = map_.next_value::<::std::option::Option<_>>()?.map(barrier_mutation::Mutation::DropSubscriptions)
;
}
GeneratedField::Combined => {
if mutation__.is_some() {
return Err(serde::de::Error::duplicate_field("combined"));
}
mutation__ = map_.next_value::<::std::option::Option<_>>()?.map(barrier_mutation::Mutation::Combined)
;
}
}
}
Ok(BarrierMutation {
mutation: mutation__,
})
}
}
deserializer.deserialize_struct("stream_plan.BarrierMutation", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for BarrierRecvNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("stream_plan.BarrierRecvNode", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for BarrierRecvNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = BarrierRecvNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.BarrierRecvNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<BarrierRecvNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(BarrierRecvNode {
})
}
}
deserializer.deserialize_struct("stream_plan.BarrierRecvNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for BatchPlanNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.table_desc.is_some() {
len += 1;
}
if !self.column_ids.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.BatchPlanNode", len)?;
if let Some(v) = self.table_desc.as_ref() {
struct_ser.serialize_field("tableDesc", v)?;
}
if !self.column_ids.is_empty() {
struct_ser.serialize_field("columnIds", &self.column_ids)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for BatchPlanNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table_desc",
"tableDesc",
"column_ids",
"columnIds",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableDesc,
ColumnIds,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"tableDesc" | "table_desc" => Ok(GeneratedField::TableDesc),
"columnIds" | "column_ids" => Ok(GeneratedField::ColumnIds),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = BatchPlanNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.BatchPlanNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<BatchPlanNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_desc__ = None;
let mut column_ids__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TableDesc => {
if table_desc__.is_some() {
return Err(serde::de::Error::duplicate_field("tableDesc"));
}
table_desc__ = map_.next_value()?;
}
GeneratedField::ColumnIds => {
if column_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("columnIds"));
}
column_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(BatchPlanNode {
table_desc: table_desc__,
column_ids: column_ids__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.BatchPlanNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CdcFilterNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.search_condition.is_some() {
len += 1;
}
if self.upstream_source_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.CdcFilterNode", len)?;
if let Some(v) = self.search_condition.as_ref() {
struct_ser.serialize_field("searchCondition", v)?;
}
if self.upstream_source_id != 0 {
struct_ser.serialize_field("upstreamSourceId", &self.upstream_source_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CdcFilterNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"search_condition",
"searchCondition",
"upstream_source_id",
"upstreamSourceId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SearchCondition,
UpstreamSourceId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"searchCondition" | "search_condition" => Ok(GeneratedField::SearchCondition),
"upstreamSourceId" | "upstream_source_id" => Ok(GeneratedField::UpstreamSourceId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CdcFilterNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.CdcFilterNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CdcFilterNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut search_condition__ = None;
let mut upstream_source_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::SearchCondition => {
if search_condition__.is_some() {
return Err(serde::de::Error::duplicate_field("searchCondition"));
}
search_condition__ = map_.next_value()?;
}
GeneratedField::UpstreamSourceId => {
if upstream_source_id__.is_some() {
return Err(serde::de::Error::duplicate_field("upstreamSourceId"));
}
upstream_source_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(CdcFilterNode {
search_condition: search_condition__,
upstream_source_id: upstream_source_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.CdcFilterNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ChangeLogNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.need_op {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.ChangeLogNode", len)?;
if self.need_op {
struct_ser.serialize_field("needOp", &self.need_op)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ChangeLogNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"need_op",
"needOp",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
NeedOp,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"needOp" | "need_op" => Ok(GeneratedField::NeedOp),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ChangeLogNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.ChangeLogNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ChangeLogNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut need_op__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::NeedOp => {
if need_op__.is_some() {
return Err(serde::de::Error::duplicate_field("needOp"));
}
need_op__ = Some(map_.next_value()?);
}
}
}
Ok(ChangeLogNode {
need_op: need_op__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.ChangeLogNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CombinedMutation {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.mutations.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.CombinedMutation", len)?;
if !self.mutations.is_empty() {
struct_ser.serialize_field("mutations", &self.mutations)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CombinedMutation {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"mutations",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Mutations,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"mutations" => Ok(GeneratedField::Mutations),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CombinedMutation;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.CombinedMutation")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CombinedMutation, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut mutations__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Mutations => {
if mutations__.is_some() {
return Err(serde::de::Error::duplicate_field("mutations"));
}
mutations__ = Some(map_.next_value()?);
}
}
}
Ok(CombinedMutation {
mutations: mutations__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.CombinedMutation", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DedupNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.state_table.is_some() {
len += 1;
}
if !self.dedup_column_indices.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.DedupNode", len)?;
if let Some(v) = self.state_table.as_ref() {
struct_ser.serialize_field("stateTable", v)?;
}
if !self.dedup_column_indices.is_empty() {
struct_ser.serialize_field("dedupColumnIndices", &self.dedup_column_indices)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DedupNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"state_table",
"stateTable",
"dedup_column_indices",
"dedupColumnIndices",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
StateTable,
DedupColumnIndices,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"stateTable" | "state_table" => Ok(GeneratedField::StateTable),
"dedupColumnIndices" | "dedup_column_indices" => Ok(GeneratedField::DedupColumnIndices),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DedupNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.DedupNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DedupNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut state_table__ = None;
let mut dedup_column_indices__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::StateTable => {
if state_table__.is_some() {
return Err(serde::de::Error::duplicate_field("stateTable"));
}
state_table__ = map_.next_value()?;
}
GeneratedField::DedupColumnIndices => {
if dedup_column_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("dedupColumnIndices"));
}
dedup_column_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(DedupNode {
state_table: state_table__,
dedup_column_indices: dedup_column_indices__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.DedupNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DeltaExpression {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.delta_type != 0 {
len += 1;
}
if self.delta.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.DeltaExpression", len)?;
if self.delta_type != 0 {
let v = super::expr::expr_node::Type::try_from(self.delta_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.delta_type)))?;
struct_ser.serialize_field("deltaType", &v)?;
}
if let Some(v) = self.delta.as_ref() {
struct_ser.serialize_field("delta", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DeltaExpression {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"delta_type",
"deltaType",
"delta",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
DeltaType,
Delta,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"deltaType" | "delta_type" => Ok(GeneratedField::DeltaType),
"delta" => Ok(GeneratedField::Delta),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DeltaExpression;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.DeltaExpression")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DeltaExpression, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut delta_type__ = None;
let mut delta__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::DeltaType => {
if delta_type__.is_some() {
return Err(serde::de::Error::duplicate_field("deltaType"));
}
delta_type__ = Some(map_.next_value::<super::expr::expr_node::Type>()? as i32);
}
GeneratedField::Delta => {
if delta__.is_some() {
return Err(serde::de::Error::duplicate_field("delta"));
}
delta__ = map_.next_value()?;
}
}
}
Ok(DeltaExpression {
delta_type: delta_type__.unwrap_or_default(),
delta: delta__,
})
}
}
deserializer.deserialize_struct("stream_plan.DeltaExpression", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DeltaIndexJoinNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.join_type != 0 {
len += 1;
}
if !self.left_key.is_empty() {
len += 1;
}
if !self.right_key.is_empty() {
len += 1;
}
if self.condition.is_some() {
len += 1;
}
if self.left_table_id != 0 {
len += 1;
}
if self.right_table_id != 0 {
len += 1;
}
if self.left_info.is_some() {
len += 1;
}
if self.right_info.is_some() {
len += 1;
}
if !self.output_indices.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.DeltaIndexJoinNode", len)?;
if self.join_type != 0 {
let v = super::plan_common::JoinType::try_from(self.join_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.join_type)))?;
struct_ser.serialize_field("joinType", &v)?;
}
if !self.left_key.is_empty() {
struct_ser.serialize_field("leftKey", &self.left_key)?;
}
if !self.right_key.is_empty() {
struct_ser.serialize_field("rightKey", &self.right_key)?;
}
if let Some(v) = self.condition.as_ref() {
struct_ser.serialize_field("condition", v)?;
}
if self.left_table_id != 0 {
struct_ser.serialize_field("leftTableId", &self.left_table_id)?;
}
if self.right_table_id != 0 {
struct_ser.serialize_field("rightTableId", &self.right_table_id)?;
}
if let Some(v) = self.left_info.as_ref() {
struct_ser.serialize_field("leftInfo", v)?;
}
if let Some(v) = self.right_info.as_ref() {
struct_ser.serialize_field("rightInfo", v)?;
}
if !self.output_indices.is_empty() {
struct_ser.serialize_field("outputIndices", &self.output_indices)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DeltaIndexJoinNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"join_type",
"joinType",
"left_key",
"leftKey",
"right_key",
"rightKey",
"condition",
"left_table_id",
"leftTableId",
"right_table_id",
"rightTableId",
"left_info",
"leftInfo",
"right_info",
"rightInfo",
"output_indices",
"outputIndices",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
JoinType,
LeftKey,
RightKey,
Condition,
LeftTableId,
RightTableId,
LeftInfo,
RightInfo,
OutputIndices,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"joinType" | "join_type" => Ok(GeneratedField::JoinType),
"leftKey" | "left_key" => Ok(GeneratedField::LeftKey),
"rightKey" | "right_key" => Ok(GeneratedField::RightKey),
"condition" => Ok(GeneratedField::Condition),
"leftTableId" | "left_table_id" => Ok(GeneratedField::LeftTableId),
"rightTableId" | "right_table_id" => Ok(GeneratedField::RightTableId),
"leftInfo" | "left_info" => Ok(GeneratedField::LeftInfo),
"rightInfo" | "right_info" => Ok(GeneratedField::RightInfo),
"outputIndices" | "output_indices" => Ok(GeneratedField::OutputIndices),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DeltaIndexJoinNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.DeltaIndexJoinNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DeltaIndexJoinNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut join_type__ = None;
let mut left_key__ = None;
let mut right_key__ = None;
let mut condition__ = None;
let mut left_table_id__ = None;
let mut right_table_id__ = None;
let mut left_info__ = None;
let mut right_info__ = None;
let mut output_indices__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::JoinType => {
if join_type__.is_some() {
return Err(serde::de::Error::duplicate_field("joinType"));
}
join_type__ = Some(map_.next_value::<super::plan_common::JoinType>()? as i32);
}
GeneratedField::LeftKey => {
if left_key__.is_some() {
return Err(serde::de::Error::duplicate_field("leftKey"));
}
left_key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::RightKey => {
if right_key__.is_some() {
return Err(serde::de::Error::duplicate_field("rightKey"));
}
right_key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::Condition => {
if condition__.is_some() {
return Err(serde::de::Error::duplicate_field("condition"));
}
condition__ = map_.next_value()?;
}
GeneratedField::LeftTableId => {
if left_table_id__.is_some() {
return Err(serde::de::Error::duplicate_field("leftTableId"));
}
left_table_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::RightTableId => {
if right_table_id__.is_some() {
return Err(serde::de::Error::duplicate_field("rightTableId"));
}
right_table_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::LeftInfo => {
if left_info__.is_some() {
return Err(serde::de::Error::duplicate_field("leftInfo"));
}
left_info__ = map_.next_value()?;
}
GeneratedField::RightInfo => {
if right_info__.is_some() {
return Err(serde::de::Error::duplicate_field("rightInfo"));
}
right_info__ = map_.next_value()?;
}
GeneratedField::OutputIndices => {
if output_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("outputIndices"));
}
output_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(DeltaIndexJoinNode {
join_type: join_type__.unwrap_or_default(),
left_key: left_key__.unwrap_or_default(),
right_key: right_key__.unwrap_or_default(),
condition: condition__,
left_table_id: left_table_id__.unwrap_or_default(),
right_table_id: right_table_id__.unwrap_or_default(),
left_info: left_info__,
right_info: right_info__,
output_indices: output_indices__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.DeltaIndexJoinNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DispatchStrategy {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.r#type != 0 {
len += 1;
}
if !self.dist_key_indices.is_empty() {
len += 1;
}
if !self.output_indices.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.DispatchStrategy", len)?;
if self.r#type != 0 {
let v = DispatcherType::try_from(self.r#type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.r#type)))?;
struct_ser.serialize_field("type", &v)?;
}
if !self.dist_key_indices.is_empty() {
struct_ser.serialize_field("distKeyIndices", &self.dist_key_indices)?;
}
if !self.output_indices.is_empty() {
struct_ser.serialize_field("outputIndices", &self.output_indices)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DispatchStrategy {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"type",
"dist_key_indices",
"distKeyIndices",
"output_indices",
"outputIndices",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Type,
DistKeyIndices,
OutputIndices,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"type" => Ok(GeneratedField::Type),
"distKeyIndices" | "dist_key_indices" => Ok(GeneratedField::DistKeyIndices),
"outputIndices" | "output_indices" => Ok(GeneratedField::OutputIndices),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DispatchStrategy;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.DispatchStrategy")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DispatchStrategy, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut r#type__ = None;
let mut dist_key_indices__ = None;
let mut output_indices__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Type => {
if r#type__.is_some() {
return Err(serde::de::Error::duplicate_field("type"));
}
r#type__ = Some(map_.next_value::<DispatcherType>()? as i32);
}
GeneratedField::DistKeyIndices => {
if dist_key_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("distKeyIndices"));
}
dist_key_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::OutputIndices => {
if output_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("outputIndices"));
}
output_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(DispatchStrategy {
r#type: r#type__.unwrap_or_default(),
dist_key_indices: dist_key_indices__.unwrap_or_default(),
output_indices: output_indices__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.DispatchStrategy", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for Dispatcher {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.r#type != 0 {
len += 1;
}
if !self.dist_key_indices.is_empty() {
len += 1;
}
if !self.output_indices.is_empty() {
len += 1;
}
if self.hash_mapping.is_some() {
len += 1;
}
if self.dispatcher_id != 0 {
len += 1;
}
if !self.downstream_actor_id.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.Dispatcher", len)?;
if self.r#type != 0 {
let v = DispatcherType::try_from(self.r#type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.r#type)))?;
struct_ser.serialize_field("type", &v)?;
}
if !self.dist_key_indices.is_empty() {
struct_ser.serialize_field("distKeyIndices", &self.dist_key_indices)?;
}
if !self.output_indices.is_empty() {
struct_ser.serialize_field("outputIndices", &self.output_indices)?;
}
if let Some(v) = self.hash_mapping.as_ref() {
struct_ser.serialize_field("hashMapping", v)?;
}
if self.dispatcher_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("dispatcherId", ToString::to_string(&self.dispatcher_id).as_str())?;
}
if !self.downstream_actor_id.is_empty() {
struct_ser.serialize_field("downstreamActorId", &self.downstream_actor_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for Dispatcher {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"type",
"dist_key_indices",
"distKeyIndices",
"output_indices",
"outputIndices",
"hash_mapping",
"hashMapping",
"dispatcher_id",
"dispatcherId",
"downstream_actor_id",
"downstreamActorId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Type,
DistKeyIndices,
OutputIndices,
HashMapping,
DispatcherId,
DownstreamActorId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"type" => Ok(GeneratedField::Type),
"distKeyIndices" | "dist_key_indices" => Ok(GeneratedField::DistKeyIndices),
"outputIndices" | "output_indices" => Ok(GeneratedField::OutputIndices),
"hashMapping" | "hash_mapping" => Ok(GeneratedField::HashMapping),
"dispatcherId" | "dispatcher_id" => Ok(GeneratedField::DispatcherId),
"downstreamActorId" | "downstream_actor_id" => Ok(GeneratedField::DownstreamActorId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = Dispatcher;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.Dispatcher")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<Dispatcher, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut r#type__ = None;
let mut dist_key_indices__ = None;
let mut output_indices__ = None;
let mut hash_mapping__ = None;
let mut dispatcher_id__ = None;
let mut downstream_actor_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Type => {
if r#type__.is_some() {
return Err(serde::de::Error::duplicate_field("type"));
}
r#type__ = Some(map_.next_value::<DispatcherType>()? as i32);
}
GeneratedField::DistKeyIndices => {
if dist_key_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("distKeyIndices"));
}
dist_key_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::OutputIndices => {
if output_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("outputIndices"));
}
output_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::HashMapping => {
if hash_mapping__.is_some() {
return Err(serde::de::Error::duplicate_field("hashMapping"));
}
hash_mapping__ = map_.next_value()?;
}
GeneratedField::DispatcherId => {
if dispatcher_id__.is_some() {
return Err(serde::de::Error::duplicate_field("dispatcherId"));
}
dispatcher_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::DownstreamActorId => {
if downstream_actor_id__.is_some() {
return Err(serde::de::Error::duplicate_field("downstreamActorId"));
}
downstream_actor_id__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(Dispatcher {
r#type: r#type__.unwrap_or_default(),
dist_key_indices: dist_key_indices__.unwrap_or_default(),
output_indices: output_indices__.unwrap_or_default(),
hash_mapping: hash_mapping__,
dispatcher_id: dispatcher_id__.unwrap_or_default(),
downstream_actor_id: downstream_actor_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.Dispatcher", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DispatcherType {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
let variant = match self {
Self::Unspecified => "DISPATCHER_TYPE_UNSPECIFIED",
Self::Hash => "DISPATCHER_TYPE_HASH",
Self::Broadcast => "DISPATCHER_TYPE_BROADCAST",
Self::Simple => "DISPATCHER_TYPE_SIMPLE",
Self::NoShuffle => "DISPATCHER_TYPE_NO_SHUFFLE",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for DispatcherType {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"DISPATCHER_TYPE_UNSPECIFIED",
"DISPATCHER_TYPE_HASH",
"DISPATCHER_TYPE_BROADCAST",
"DISPATCHER_TYPE_SIMPLE",
"DISPATCHER_TYPE_NO_SHUFFLE",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DispatcherType;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
})
}
fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
})
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
match value {
"DISPATCHER_TYPE_UNSPECIFIED" => Ok(DispatcherType::Unspecified),
"DISPATCHER_TYPE_HASH" => Ok(DispatcherType::Hash),
"DISPATCHER_TYPE_BROADCAST" => Ok(DispatcherType::Broadcast),
"DISPATCHER_TYPE_SIMPLE" => Ok(DispatcherType::Simple),
"DISPATCHER_TYPE_NO_SHUFFLE" => Ok(DispatcherType::NoShuffle),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for Dispatchers {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.dispatchers.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.Dispatchers", len)?;
if !self.dispatchers.is_empty() {
struct_ser.serialize_field("dispatchers", &self.dispatchers)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for Dispatchers {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"dispatchers",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Dispatchers,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"dispatchers" => Ok(GeneratedField::Dispatchers),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = Dispatchers;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.Dispatchers")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<Dispatchers, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut dispatchers__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Dispatchers => {
if dispatchers__.is_some() {
return Err(serde::de::Error::duplicate_field("dispatchers"));
}
dispatchers__ = Some(map_.next_value()?);
}
}
}
Ok(Dispatchers {
dispatchers: dispatchers__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.Dispatchers", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DmlNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.table_id != 0 {
len += 1;
}
if self.table_version_id != 0 {
len += 1;
}
if !self.column_descs.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.DmlNode", len)?;
if self.table_id != 0 {
struct_ser.serialize_field("tableId", &self.table_id)?;
}
if self.table_version_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("tableVersionId", ToString::to_string(&self.table_version_id).as_str())?;
}
if !self.column_descs.is_empty() {
struct_ser.serialize_field("columnDescs", &self.column_descs)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DmlNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table_id",
"tableId",
"table_version_id",
"tableVersionId",
"column_descs",
"columnDescs",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableId,
TableVersionId,
ColumnDescs,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"tableId" | "table_id" => Ok(GeneratedField::TableId),
"tableVersionId" | "table_version_id" => Ok(GeneratedField::TableVersionId),
"columnDescs" | "column_descs" => Ok(GeneratedField::ColumnDescs),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DmlNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.DmlNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DmlNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_id__ = None;
let mut table_version_id__ = None;
let mut column_descs__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TableId => {
if table_id__.is_some() {
return Err(serde::de::Error::duplicate_field("tableId"));
}
table_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TableVersionId => {
if table_version_id__.is_some() {
return Err(serde::de::Error::duplicate_field("tableVersionId"));
}
table_version_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::ColumnDescs => {
if column_descs__.is_some() {
return Err(serde::de::Error::duplicate_field("columnDescs"));
}
column_descs__ = Some(map_.next_value()?);
}
}
}
Ok(DmlNode {
table_id: table_id__.unwrap_or_default(),
table_version_id: table_version_id__.unwrap_or_default(),
column_descs: column_descs__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.DmlNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropSubscriptionsMutation {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.info.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.DropSubscriptionsMutation", len)?;
if !self.info.is_empty() {
struct_ser.serialize_field("info", &self.info)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropSubscriptionsMutation {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"info",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Info,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"info" => Ok(GeneratedField::Info),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DropSubscriptionsMutation;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.DropSubscriptionsMutation")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropSubscriptionsMutation, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut info__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Info => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("info"));
}
info__ = Some(map_.next_value()?);
}
}
}
Ok(DropSubscriptionsMutation {
info: info__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.DropSubscriptionsMutation", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DynamicFilterNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.left_key != 0 {
len += 1;
}
if self.condition.is_some() {
len += 1;
}
if self.left_table.is_some() {
len += 1;
}
if self.right_table.is_some() {
len += 1;
}
if self.condition_always_relax {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.DynamicFilterNode", len)?;
if self.left_key != 0 {
struct_ser.serialize_field("leftKey", &self.left_key)?;
}
if let Some(v) = self.condition.as_ref() {
struct_ser.serialize_field("condition", v)?;
}
if let Some(v) = self.left_table.as_ref() {
struct_ser.serialize_field("leftTable", v)?;
}
if let Some(v) = self.right_table.as_ref() {
struct_ser.serialize_field("rightTable", v)?;
}
if self.condition_always_relax {
struct_ser.serialize_field("conditionAlwaysRelax", &self.condition_always_relax)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DynamicFilterNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"left_key",
"leftKey",
"condition",
"left_table",
"leftTable",
"right_table",
"rightTable",
"condition_always_relax",
"conditionAlwaysRelax",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
LeftKey,
Condition,
LeftTable,
RightTable,
ConditionAlwaysRelax,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"leftKey" | "left_key" => Ok(GeneratedField::LeftKey),
"condition" => Ok(GeneratedField::Condition),
"leftTable" | "left_table" => Ok(GeneratedField::LeftTable),
"rightTable" | "right_table" => Ok(GeneratedField::RightTable),
"conditionAlwaysRelax" | "condition_always_relax" => Ok(GeneratedField::ConditionAlwaysRelax),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DynamicFilterNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.DynamicFilterNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DynamicFilterNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut left_key__ = None;
let mut condition__ = None;
let mut left_table__ = None;
let mut right_table__ = None;
let mut condition_always_relax__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::LeftKey => {
if left_key__.is_some() {
return Err(serde::de::Error::duplicate_field("leftKey"));
}
left_key__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Condition => {
if condition__.is_some() {
return Err(serde::de::Error::duplicate_field("condition"));
}
condition__ = map_.next_value()?;
}
GeneratedField::LeftTable => {
if left_table__.is_some() {
return Err(serde::de::Error::duplicate_field("leftTable"));
}
left_table__ = map_.next_value()?;
}
GeneratedField::RightTable => {
if right_table__.is_some() {
return Err(serde::de::Error::duplicate_field("rightTable"));
}
right_table__ = map_.next_value()?;
}
GeneratedField::ConditionAlwaysRelax => {
if condition_always_relax__.is_some() {
return Err(serde::de::Error::duplicate_field("conditionAlwaysRelax"));
}
condition_always_relax__ = Some(map_.next_value()?);
}
}
}
Ok(DynamicFilterNode {
left_key: left_key__.unwrap_or_default(),
condition: condition__,
left_table: left_table__,
right_table: right_table__,
condition_always_relax: condition_always_relax__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.DynamicFilterNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for EowcOverWindowNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.calls.is_empty() {
len += 1;
}
if !self.partition_by.is_empty() {
len += 1;
}
if !self.order_by.is_empty() {
len += 1;
}
if self.state_table.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.EowcOverWindowNode", len)?;
if !self.calls.is_empty() {
struct_ser.serialize_field("calls", &self.calls)?;
}
if !self.partition_by.is_empty() {
struct_ser.serialize_field("partitionBy", &self.partition_by)?;
}
if !self.order_by.is_empty() {
struct_ser.serialize_field("orderBy", &self.order_by)?;
}
if let Some(v) = self.state_table.as_ref() {
struct_ser.serialize_field("stateTable", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for EowcOverWindowNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"calls",
"partition_by",
"partitionBy",
"order_by",
"orderBy",
"state_table",
"stateTable",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Calls,
PartitionBy,
OrderBy,
StateTable,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"calls" => Ok(GeneratedField::Calls),
"partitionBy" | "partition_by" => Ok(GeneratedField::PartitionBy),
"orderBy" | "order_by" => Ok(GeneratedField::OrderBy),
"stateTable" | "state_table" => Ok(GeneratedField::StateTable),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = EowcOverWindowNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.EowcOverWindowNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<EowcOverWindowNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut calls__ = None;
let mut partition_by__ = None;
let mut order_by__ = None;
let mut state_table__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Calls => {
if calls__.is_some() {
return Err(serde::de::Error::duplicate_field("calls"));
}
calls__ = Some(map_.next_value()?);
}
GeneratedField::PartitionBy => {
if partition_by__.is_some() {
return Err(serde::de::Error::duplicate_field("partitionBy"));
}
partition_by__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::OrderBy => {
if order_by__.is_some() {
return Err(serde::de::Error::duplicate_field("orderBy"));
}
order_by__ = Some(map_.next_value()?);
}
GeneratedField::StateTable => {
if state_table__.is_some() {
return Err(serde::de::Error::duplicate_field("stateTable"));
}
state_table__ = map_.next_value()?;
}
}
}
Ok(EowcOverWindowNode {
calls: calls__.unwrap_or_default(),
partition_by: partition_by__.unwrap_or_default(),
order_by: order_by__.unwrap_or_default(),
state_table: state_table__,
})
}
}
deserializer.deserialize_struct("stream_plan.EowcOverWindowNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ExchangeNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.strategy.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.ExchangeNode", len)?;
if let Some(v) = self.strategy.as_ref() {
struct_ser.serialize_field("strategy", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ExchangeNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"strategy",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Strategy,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"strategy" => Ok(GeneratedField::Strategy),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ExchangeNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.ExchangeNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ExchangeNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut strategy__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Strategy => {
if strategy__.is_some() {
return Err(serde::de::Error::duplicate_field("strategy"));
}
strategy__ = map_.next_value()?;
}
}
}
Ok(ExchangeNode {
strategy: strategy__,
})
}
}
deserializer.deserialize_struct("stream_plan.ExchangeNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ExpandNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.column_subsets.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.ExpandNode", len)?;
if !self.column_subsets.is_empty() {
struct_ser.serialize_field("columnSubsets", &self.column_subsets)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ExpandNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"column_subsets",
"columnSubsets",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ColumnSubsets,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"columnSubsets" | "column_subsets" => Ok(GeneratedField::ColumnSubsets),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ExpandNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.ExpandNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ExpandNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut column_subsets__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ColumnSubsets => {
if column_subsets__.is_some() {
return Err(serde::de::Error::duplicate_field("columnSubsets"));
}
column_subsets__ = Some(map_.next_value()?);
}
}
}
Ok(ExpandNode {
column_subsets: column_subsets__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.ExpandNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for expand_node::Subset {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.column_indices.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.ExpandNode.Subset", len)?;
if !self.column_indices.is_empty() {
struct_ser.serialize_field("columnIndices", &self.column_indices)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for expand_node::Subset {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"column_indices",
"columnIndices",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ColumnIndices,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"columnIndices" | "column_indices" => Ok(GeneratedField::ColumnIndices),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = expand_node::Subset;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.ExpandNode.Subset")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<expand_node::Subset, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut column_indices__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ColumnIndices => {
if column_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("columnIndices"));
}
column_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(expand_node::Subset {
column_indices: column_indices__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.ExpandNode.Subset", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for FilterNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.search_condition.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.FilterNode", len)?;
if let Some(v) = self.search_condition.as_ref() {
struct_ser.serialize_field("searchCondition", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for FilterNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"search_condition",
"searchCondition",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SearchCondition,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"searchCondition" | "search_condition" => Ok(GeneratedField::SearchCondition),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = FilterNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.FilterNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<FilterNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut search_condition__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::SearchCondition => {
if search_condition__.is_some() {
return Err(serde::de::Error::duplicate_field("searchCondition"));
}
search_condition__ = map_.next_value()?;
}
}
}
Ok(FilterNode {
search_condition: search_condition__,
})
}
}
deserializer.deserialize_struct("stream_plan.FilterNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for FragmentTypeFlag {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
let variant = match self {
Self::FragmentUnspecified => "FRAGMENT_TYPE_FLAG_FRAGMENT_UNSPECIFIED",
Self::Source => "FRAGMENT_TYPE_FLAG_SOURCE",
Self::Mview => "FRAGMENT_TYPE_FLAG_MVIEW",
Self::Sink => "FRAGMENT_TYPE_FLAG_SINK",
Self::Now => "FRAGMENT_TYPE_FLAG_NOW",
Self::StreamScan => "FRAGMENT_TYPE_FLAG_STREAM_SCAN",
Self::BarrierRecv => "FRAGMENT_TYPE_FLAG_BARRIER_RECV",
Self::Values => "FRAGMENT_TYPE_FLAG_VALUES",
Self::Dml => "FRAGMENT_TYPE_FLAG_DML",
Self::CdcFilter => "FRAGMENT_TYPE_FLAG_CDC_FILTER",
Self::SourceScan => "FRAGMENT_TYPE_FLAG_SOURCE_SCAN",
Self::SnapshotBackfillStreamScan => "FRAGMENT_TYPE_FLAG_SNAPSHOT_BACKFILL_STREAM_SCAN",
Self::FsFetch => "FRAGMENT_TYPE_FLAG_FS_FETCH",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for FragmentTypeFlag {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"FRAGMENT_TYPE_FLAG_FRAGMENT_UNSPECIFIED",
"FRAGMENT_TYPE_FLAG_SOURCE",
"FRAGMENT_TYPE_FLAG_MVIEW",
"FRAGMENT_TYPE_FLAG_SINK",
"FRAGMENT_TYPE_FLAG_NOW",
"FRAGMENT_TYPE_FLAG_STREAM_SCAN",
"FRAGMENT_TYPE_FLAG_BARRIER_RECV",
"FRAGMENT_TYPE_FLAG_VALUES",
"FRAGMENT_TYPE_FLAG_DML",
"FRAGMENT_TYPE_FLAG_CDC_FILTER",
"FRAGMENT_TYPE_FLAG_SOURCE_SCAN",
"FRAGMENT_TYPE_FLAG_SNAPSHOT_BACKFILL_STREAM_SCAN",
"FRAGMENT_TYPE_FLAG_FS_FETCH",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = FragmentTypeFlag;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
})
}
fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
})
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
match value {
"FRAGMENT_TYPE_FLAG_FRAGMENT_UNSPECIFIED" => Ok(FragmentTypeFlag::FragmentUnspecified),
"FRAGMENT_TYPE_FLAG_SOURCE" => Ok(FragmentTypeFlag::Source),
"FRAGMENT_TYPE_FLAG_MVIEW" => Ok(FragmentTypeFlag::Mview),
"FRAGMENT_TYPE_FLAG_SINK" => Ok(FragmentTypeFlag::Sink),
"FRAGMENT_TYPE_FLAG_NOW" => Ok(FragmentTypeFlag::Now),
"FRAGMENT_TYPE_FLAG_STREAM_SCAN" => Ok(FragmentTypeFlag::StreamScan),
"FRAGMENT_TYPE_FLAG_BARRIER_RECV" => Ok(FragmentTypeFlag::BarrierRecv),
"FRAGMENT_TYPE_FLAG_VALUES" => Ok(FragmentTypeFlag::Values),
"FRAGMENT_TYPE_FLAG_DML" => Ok(FragmentTypeFlag::Dml),
"FRAGMENT_TYPE_FLAG_CDC_FILTER" => Ok(FragmentTypeFlag::CdcFilter),
"FRAGMENT_TYPE_FLAG_SOURCE_SCAN" => Ok(FragmentTypeFlag::SourceScan),
"FRAGMENT_TYPE_FLAG_SNAPSHOT_BACKFILL_STREAM_SCAN" => Ok(FragmentTypeFlag::SnapshotBackfillStreamScan),
"FRAGMENT_TYPE_FLAG_FS_FETCH" => Ok(FragmentTypeFlag::FsFetch),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for GlobalApproxPercentileNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.base != 0. {
len += 1;
}
if self.quantile != 0. {
len += 1;
}
if self.bucket_state_table.is_some() {
len += 1;
}
if self.count_state_table.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.GlobalApproxPercentileNode", len)?;
if self.base != 0. {
struct_ser.serialize_field("base", &self.base)?;
}
if self.quantile != 0. {
struct_ser.serialize_field("quantile", &self.quantile)?;
}
if let Some(v) = self.bucket_state_table.as_ref() {
struct_ser.serialize_field("bucketStateTable", v)?;
}
if let Some(v) = self.count_state_table.as_ref() {
struct_ser.serialize_field("countStateTable", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GlobalApproxPercentileNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"base",
"quantile",
"bucket_state_table",
"bucketStateTable",
"count_state_table",
"countStateTable",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Base,
Quantile,
BucketStateTable,
CountStateTable,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"base" => Ok(GeneratedField::Base),
"quantile" => Ok(GeneratedField::Quantile),
"bucketStateTable" | "bucket_state_table" => Ok(GeneratedField::BucketStateTable),
"countStateTable" | "count_state_table" => Ok(GeneratedField::CountStateTable),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GlobalApproxPercentileNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.GlobalApproxPercentileNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GlobalApproxPercentileNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut base__ = None;
let mut quantile__ = None;
let mut bucket_state_table__ = None;
let mut count_state_table__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Base => {
if base__.is_some() {
return Err(serde::de::Error::duplicate_field("base"));
}
base__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Quantile => {
if quantile__.is_some() {
return Err(serde::de::Error::duplicate_field("quantile"));
}
quantile__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::BucketStateTable => {
if bucket_state_table__.is_some() {
return Err(serde::de::Error::duplicate_field("bucketStateTable"));
}
bucket_state_table__ = map_.next_value()?;
}
GeneratedField::CountStateTable => {
if count_state_table__.is_some() {
return Err(serde::de::Error::duplicate_field("countStateTable"));
}
count_state_table__ = map_.next_value()?;
}
}
}
Ok(GlobalApproxPercentileNode {
base: base__.unwrap_or_default(),
quantile: quantile__.unwrap_or_default(),
bucket_state_table: bucket_state_table__,
count_state_table: count_state_table__,
})
}
}
deserializer.deserialize_struct("stream_plan.GlobalApproxPercentileNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GroupTopNNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.limit != 0 {
len += 1;
}
if self.offset != 0 {
len += 1;
}
if !self.group_key.is_empty() {
len += 1;
}
if self.table.is_some() {
len += 1;
}
if !self.order_by.is_empty() {
len += 1;
}
if self.with_ties {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.GroupTopNNode", len)?;
if self.limit != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("limit", ToString::to_string(&self.limit).as_str())?;
}
if self.offset != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("offset", ToString::to_string(&self.offset).as_str())?;
}
if !self.group_key.is_empty() {
struct_ser.serialize_field("groupKey", &self.group_key)?;
}
if let Some(v) = self.table.as_ref() {
struct_ser.serialize_field("table", v)?;
}
if !self.order_by.is_empty() {
struct_ser.serialize_field("orderBy", &self.order_by)?;
}
if self.with_ties {
struct_ser.serialize_field("withTies", &self.with_ties)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GroupTopNNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"limit",
"offset",
"group_key",
"groupKey",
"table",
"order_by",
"orderBy",
"with_ties",
"withTies",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Limit,
Offset,
GroupKey,
Table,
OrderBy,
WithTies,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"limit" => Ok(GeneratedField::Limit),
"offset" => Ok(GeneratedField::Offset),
"groupKey" | "group_key" => Ok(GeneratedField::GroupKey),
"table" => Ok(GeneratedField::Table),
"orderBy" | "order_by" => Ok(GeneratedField::OrderBy),
"withTies" | "with_ties" => Ok(GeneratedField::WithTies),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GroupTopNNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.GroupTopNNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GroupTopNNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut limit__ = None;
let mut offset__ = None;
let mut group_key__ = None;
let mut table__ = None;
let mut order_by__ = None;
let mut with_ties__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Limit => {
if limit__.is_some() {
return Err(serde::de::Error::duplicate_field("limit"));
}
limit__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Offset => {
if offset__.is_some() {
return Err(serde::de::Error::duplicate_field("offset"));
}
offset__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::GroupKey => {
if group_key__.is_some() {
return Err(serde::de::Error::duplicate_field("groupKey"));
}
group_key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::Table => {
if table__.is_some() {
return Err(serde::de::Error::duplicate_field("table"));
}
table__ = map_.next_value()?;
}
GeneratedField::OrderBy => {
if order_by__.is_some() {
return Err(serde::de::Error::duplicate_field("orderBy"));
}
order_by__ = Some(map_.next_value()?);
}
GeneratedField::WithTies => {
if with_ties__.is_some() {
return Err(serde::de::Error::duplicate_field("withTies"));
}
with_ties__ = Some(map_.next_value()?);
}
}
}
Ok(GroupTopNNode {
limit: limit__.unwrap_or_default(),
offset: offset__.unwrap_or_default(),
group_key: group_key__.unwrap_or_default(),
table: table__,
order_by: order_by__.unwrap_or_default(),
with_ties: with_ties__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.GroupTopNNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for HashAggNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.group_key.is_empty() {
len += 1;
}
if !self.agg_calls.is_empty() {
len += 1;
}
if !self.agg_call_states.is_empty() {
len += 1;
}
if self.intermediate_state_table.is_some() {
len += 1;
}
if self.is_append_only {
len += 1;
}
if !self.distinct_dedup_tables.is_empty() {
len += 1;
}
if self.row_count_index != 0 {
len += 1;
}
if self.emit_on_window_close {
len += 1;
}
if self.version != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.HashAggNode", len)?;
if !self.group_key.is_empty() {
struct_ser.serialize_field("groupKey", &self.group_key)?;
}
if !self.agg_calls.is_empty() {
struct_ser.serialize_field("aggCalls", &self.agg_calls)?;
}
if !self.agg_call_states.is_empty() {
struct_ser.serialize_field("aggCallStates", &self.agg_call_states)?;
}
if let Some(v) = self.intermediate_state_table.as_ref() {
struct_ser.serialize_field("intermediateStateTable", v)?;
}
if self.is_append_only {
struct_ser.serialize_field("isAppendOnly", &self.is_append_only)?;
}
if !self.distinct_dedup_tables.is_empty() {
struct_ser.serialize_field("distinctDedupTables", &self.distinct_dedup_tables)?;
}
if self.row_count_index != 0 {
struct_ser.serialize_field("rowCountIndex", &self.row_count_index)?;
}
if self.emit_on_window_close {
struct_ser.serialize_field("emitOnWindowClose", &self.emit_on_window_close)?;
}
if self.version != 0 {
let v = AggNodeVersion::try_from(self.version)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.version)))?;
struct_ser.serialize_field("version", &v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for HashAggNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"group_key",
"groupKey",
"agg_calls",
"aggCalls",
"agg_call_states",
"aggCallStates",
"intermediate_state_table",
"intermediateStateTable",
"is_append_only",
"isAppendOnly",
"distinct_dedup_tables",
"distinctDedupTables",
"row_count_index",
"rowCountIndex",
"emit_on_window_close",
"emitOnWindowClose",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
GroupKey,
AggCalls,
AggCallStates,
IntermediateStateTable,
IsAppendOnly,
DistinctDedupTables,
RowCountIndex,
EmitOnWindowClose,
Version,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"groupKey" | "group_key" => Ok(GeneratedField::GroupKey),
"aggCalls" | "agg_calls" => Ok(GeneratedField::AggCalls),
"aggCallStates" | "agg_call_states" => Ok(GeneratedField::AggCallStates),
"intermediateStateTable" | "intermediate_state_table" => Ok(GeneratedField::IntermediateStateTable),
"isAppendOnly" | "is_append_only" => Ok(GeneratedField::IsAppendOnly),
"distinctDedupTables" | "distinct_dedup_tables" => Ok(GeneratedField::DistinctDedupTables),
"rowCountIndex" | "row_count_index" => Ok(GeneratedField::RowCountIndex),
"emitOnWindowClose" | "emit_on_window_close" => Ok(GeneratedField::EmitOnWindowClose),
"version" => Ok(GeneratedField::Version),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = HashAggNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.HashAggNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<HashAggNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut group_key__ = None;
let mut agg_calls__ = None;
let mut agg_call_states__ = None;
let mut intermediate_state_table__ = None;
let mut is_append_only__ = None;
let mut distinct_dedup_tables__ = None;
let mut row_count_index__ = None;
let mut emit_on_window_close__ = None;
let mut version__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::GroupKey => {
if group_key__.is_some() {
return Err(serde::de::Error::duplicate_field("groupKey"));
}
group_key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::AggCalls => {
if agg_calls__.is_some() {
return Err(serde::de::Error::duplicate_field("aggCalls"));
}
agg_calls__ = Some(map_.next_value()?);
}
GeneratedField::AggCallStates => {
if agg_call_states__.is_some() {
return Err(serde::de::Error::duplicate_field("aggCallStates"));
}
agg_call_states__ = Some(map_.next_value()?);
}
GeneratedField::IntermediateStateTable => {
if intermediate_state_table__.is_some() {
return Err(serde::de::Error::duplicate_field("intermediateStateTable"));
}
intermediate_state_table__ = map_.next_value()?;
}
GeneratedField::IsAppendOnly => {
if is_append_only__.is_some() {
return Err(serde::de::Error::duplicate_field("isAppendOnly"));
}
is_append_only__ = Some(map_.next_value()?);
}
GeneratedField::DistinctDedupTables => {
if distinct_dedup_tables__.is_some() {
return Err(serde::de::Error::duplicate_field("distinctDedupTables"));
}
distinct_dedup_tables__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::RowCountIndex => {
if row_count_index__.is_some() {
return Err(serde::de::Error::duplicate_field("rowCountIndex"));
}
row_count_index__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::EmitOnWindowClose => {
if emit_on_window_close__.is_some() {
return Err(serde::de::Error::duplicate_field("emitOnWindowClose"));
}
emit_on_window_close__ = Some(map_.next_value()?);
}
GeneratedField::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = Some(map_.next_value::<AggNodeVersion>()? as i32);
}
}
}
Ok(HashAggNode {
group_key: group_key__.unwrap_or_default(),
agg_calls: agg_calls__.unwrap_or_default(),
agg_call_states: agg_call_states__.unwrap_or_default(),
intermediate_state_table: intermediate_state_table__,
is_append_only: is_append_only__.unwrap_or_default(),
distinct_dedup_tables: distinct_dedup_tables__.unwrap_or_default(),
row_count_index: row_count_index__.unwrap_or_default(),
emit_on_window_close: emit_on_window_close__.unwrap_or_default(),
version: version__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.HashAggNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for HashJoinNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.join_type != 0 {
len += 1;
}
if !self.left_key.is_empty() {
len += 1;
}
if !self.right_key.is_empty() {
len += 1;
}
if self.condition.is_some() {
len += 1;
}
if !self.inequality_pairs.is_empty() {
len += 1;
}
if self.left_table.is_some() {
len += 1;
}
if self.right_table.is_some() {
len += 1;
}
if self.left_degree_table.is_some() {
len += 1;
}
if self.right_degree_table.is_some() {
len += 1;
}
if !self.output_indices.is_empty() {
len += 1;
}
if !self.left_deduped_input_pk_indices.is_empty() {
len += 1;
}
if !self.right_deduped_input_pk_indices.is_empty() {
len += 1;
}
if !self.null_safe.is_empty() {
len += 1;
}
if self.is_append_only {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.HashJoinNode", len)?;
if self.join_type != 0 {
let v = super::plan_common::JoinType::try_from(self.join_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.join_type)))?;
struct_ser.serialize_field("joinType", &v)?;
}
if !self.left_key.is_empty() {
struct_ser.serialize_field("leftKey", &self.left_key)?;
}
if !self.right_key.is_empty() {
struct_ser.serialize_field("rightKey", &self.right_key)?;
}
if let Some(v) = self.condition.as_ref() {
struct_ser.serialize_field("condition", v)?;
}
if !self.inequality_pairs.is_empty() {
struct_ser.serialize_field("inequalityPairs", &self.inequality_pairs)?;
}
if let Some(v) = self.left_table.as_ref() {
struct_ser.serialize_field("leftTable", v)?;
}
if let Some(v) = self.right_table.as_ref() {
struct_ser.serialize_field("rightTable", v)?;
}
if let Some(v) = self.left_degree_table.as_ref() {
struct_ser.serialize_field("leftDegreeTable", v)?;
}
if let Some(v) = self.right_degree_table.as_ref() {
struct_ser.serialize_field("rightDegreeTable", v)?;
}
if !self.output_indices.is_empty() {
struct_ser.serialize_field("outputIndices", &self.output_indices)?;
}
if !self.left_deduped_input_pk_indices.is_empty() {
struct_ser.serialize_field("leftDedupedInputPkIndices", &self.left_deduped_input_pk_indices)?;
}
if !self.right_deduped_input_pk_indices.is_empty() {
struct_ser.serialize_field("rightDedupedInputPkIndices", &self.right_deduped_input_pk_indices)?;
}
if !self.null_safe.is_empty() {
struct_ser.serialize_field("nullSafe", &self.null_safe)?;
}
if self.is_append_only {
struct_ser.serialize_field("isAppendOnly", &self.is_append_only)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for HashJoinNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"join_type",
"joinType",
"left_key",
"leftKey",
"right_key",
"rightKey",
"condition",
"inequality_pairs",
"inequalityPairs",
"left_table",
"leftTable",
"right_table",
"rightTable",
"left_degree_table",
"leftDegreeTable",
"right_degree_table",
"rightDegreeTable",
"output_indices",
"outputIndices",
"left_deduped_input_pk_indices",
"leftDedupedInputPkIndices",
"right_deduped_input_pk_indices",
"rightDedupedInputPkIndices",
"null_safe",
"nullSafe",
"is_append_only",
"isAppendOnly",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
JoinType,
LeftKey,
RightKey,
Condition,
InequalityPairs,
LeftTable,
RightTable,
LeftDegreeTable,
RightDegreeTable,
OutputIndices,
LeftDedupedInputPkIndices,
RightDedupedInputPkIndices,
NullSafe,
IsAppendOnly,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"joinType" | "join_type" => Ok(GeneratedField::JoinType),
"leftKey" | "left_key" => Ok(GeneratedField::LeftKey),
"rightKey" | "right_key" => Ok(GeneratedField::RightKey),
"condition" => Ok(GeneratedField::Condition),
"inequalityPairs" | "inequality_pairs" => Ok(GeneratedField::InequalityPairs),
"leftTable" | "left_table" => Ok(GeneratedField::LeftTable),
"rightTable" | "right_table" => Ok(GeneratedField::RightTable),
"leftDegreeTable" | "left_degree_table" => Ok(GeneratedField::LeftDegreeTable),
"rightDegreeTable" | "right_degree_table" => Ok(GeneratedField::RightDegreeTable),
"outputIndices" | "output_indices" => Ok(GeneratedField::OutputIndices),
"leftDedupedInputPkIndices" | "left_deduped_input_pk_indices" => Ok(GeneratedField::LeftDedupedInputPkIndices),
"rightDedupedInputPkIndices" | "right_deduped_input_pk_indices" => Ok(GeneratedField::RightDedupedInputPkIndices),
"nullSafe" | "null_safe" => Ok(GeneratedField::NullSafe),
"isAppendOnly" | "is_append_only" => Ok(GeneratedField::IsAppendOnly),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = HashJoinNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.HashJoinNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<HashJoinNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut join_type__ = None;
let mut left_key__ = None;
let mut right_key__ = None;
let mut condition__ = None;
let mut inequality_pairs__ = None;
let mut left_table__ = None;
let mut right_table__ = None;
let mut left_degree_table__ = None;
let mut right_degree_table__ = None;
let mut output_indices__ = None;
let mut left_deduped_input_pk_indices__ = None;
let mut right_deduped_input_pk_indices__ = None;
let mut null_safe__ = None;
let mut is_append_only__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::JoinType => {
if join_type__.is_some() {
return Err(serde::de::Error::duplicate_field("joinType"));
}
join_type__ = Some(map_.next_value::<super::plan_common::JoinType>()? as i32);
}
GeneratedField::LeftKey => {
if left_key__.is_some() {
return Err(serde::de::Error::duplicate_field("leftKey"));
}
left_key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::RightKey => {
if right_key__.is_some() {
return Err(serde::de::Error::duplicate_field("rightKey"));
}
right_key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::Condition => {
if condition__.is_some() {
return Err(serde::de::Error::duplicate_field("condition"));
}
condition__ = map_.next_value()?;
}
GeneratedField::InequalityPairs => {
if inequality_pairs__.is_some() {
return Err(serde::de::Error::duplicate_field("inequalityPairs"));
}
inequality_pairs__ = Some(map_.next_value()?);
}
GeneratedField::LeftTable => {
if left_table__.is_some() {
return Err(serde::de::Error::duplicate_field("leftTable"));
}
left_table__ = map_.next_value()?;
}
GeneratedField::RightTable => {
if right_table__.is_some() {
return Err(serde::de::Error::duplicate_field("rightTable"));
}
right_table__ = map_.next_value()?;
}
GeneratedField::LeftDegreeTable => {
if left_degree_table__.is_some() {
return Err(serde::de::Error::duplicate_field("leftDegreeTable"));
}
left_degree_table__ = map_.next_value()?;
}
GeneratedField::RightDegreeTable => {
if right_degree_table__.is_some() {
return Err(serde::de::Error::duplicate_field("rightDegreeTable"));
}
right_degree_table__ = map_.next_value()?;
}
GeneratedField::OutputIndices => {
if output_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("outputIndices"));
}
output_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::LeftDedupedInputPkIndices => {
if left_deduped_input_pk_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("leftDedupedInputPkIndices"));
}
left_deduped_input_pk_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::RightDedupedInputPkIndices => {
if right_deduped_input_pk_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("rightDedupedInputPkIndices"));
}
right_deduped_input_pk_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::NullSafe => {
if null_safe__.is_some() {
return Err(serde::de::Error::duplicate_field("nullSafe"));
}
null_safe__ = Some(map_.next_value()?);
}
GeneratedField::IsAppendOnly => {
if is_append_only__.is_some() {
return Err(serde::de::Error::duplicate_field("isAppendOnly"));
}
is_append_only__ = Some(map_.next_value()?);
}
}
}
Ok(HashJoinNode {
join_type: join_type__.unwrap_or_default(),
left_key: left_key__.unwrap_or_default(),
right_key: right_key__.unwrap_or_default(),
condition: condition__,
inequality_pairs: inequality_pairs__.unwrap_or_default(),
left_table: left_table__,
right_table: right_table__,
left_degree_table: left_degree_table__,
right_degree_table: right_degree_table__,
output_indices: output_indices__.unwrap_or_default(),
left_deduped_input_pk_indices: left_deduped_input_pk_indices__.unwrap_or_default(),
right_deduped_input_pk_indices: right_deduped_input_pk_indices__.unwrap_or_default(),
null_safe: null_safe__.unwrap_or_default(),
is_append_only: is_append_only__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.HashJoinNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for HopWindowNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.time_col != 0 {
len += 1;
}
if self.window_slide.is_some() {
len += 1;
}
if self.window_size.is_some() {
len += 1;
}
if !self.output_indices.is_empty() {
len += 1;
}
if !self.window_start_exprs.is_empty() {
len += 1;
}
if !self.window_end_exprs.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.HopWindowNode", len)?;
if self.time_col != 0 {
struct_ser.serialize_field("timeCol", &self.time_col)?;
}
if let Some(v) = self.window_slide.as_ref() {
struct_ser.serialize_field("windowSlide", v)?;
}
if let Some(v) = self.window_size.as_ref() {
struct_ser.serialize_field("windowSize", v)?;
}
if !self.output_indices.is_empty() {
struct_ser.serialize_field("outputIndices", &self.output_indices)?;
}
if !self.window_start_exprs.is_empty() {
struct_ser.serialize_field("windowStartExprs", &self.window_start_exprs)?;
}
if !self.window_end_exprs.is_empty() {
struct_ser.serialize_field("windowEndExprs", &self.window_end_exprs)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for HopWindowNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"time_col",
"timeCol",
"window_slide",
"windowSlide",
"window_size",
"windowSize",
"output_indices",
"outputIndices",
"window_start_exprs",
"windowStartExprs",
"window_end_exprs",
"windowEndExprs",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TimeCol,
WindowSlide,
WindowSize,
OutputIndices,
WindowStartExprs,
WindowEndExprs,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"timeCol" | "time_col" => Ok(GeneratedField::TimeCol),
"windowSlide" | "window_slide" => Ok(GeneratedField::WindowSlide),
"windowSize" | "window_size" => Ok(GeneratedField::WindowSize),
"outputIndices" | "output_indices" => Ok(GeneratedField::OutputIndices),
"windowStartExprs" | "window_start_exprs" => Ok(GeneratedField::WindowStartExprs),
"windowEndExprs" | "window_end_exprs" => Ok(GeneratedField::WindowEndExprs),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = HopWindowNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.HopWindowNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<HopWindowNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut time_col__ = None;
let mut window_slide__ = None;
let mut window_size__ = None;
let mut output_indices__ = None;
let mut window_start_exprs__ = None;
let mut window_end_exprs__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TimeCol => {
if time_col__.is_some() {
return Err(serde::de::Error::duplicate_field("timeCol"));
}
time_col__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::WindowSlide => {
if window_slide__.is_some() {
return Err(serde::de::Error::duplicate_field("windowSlide"));
}
window_slide__ = map_.next_value()?;
}
GeneratedField::WindowSize => {
if window_size__.is_some() {
return Err(serde::de::Error::duplicate_field("windowSize"));
}
window_size__ = map_.next_value()?;
}
GeneratedField::OutputIndices => {
if output_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("outputIndices"));
}
output_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::WindowStartExprs => {
if window_start_exprs__.is_some() {
return Err(serde::de::Error::duplicate_field("windowStartExprs"));
}
window_start_exprs__ = Some(map_.next_value()?);
}
GeneratedField::WindowEndExprs => {
if window_end_exprs__.is_some() {
return Err(serde::de::Error::duplicate_field("windowEndExprs"));
}
window_end_exprs__ = Some(map_.next_value()?);
}
}
}
Ok(HopWindowNode {
time_col: time_col__.unwrap_or_default(),
window_slide: window_slide__,
window_size: window_size__,
output_indices: output_indices__.unwrap_or_default(),
window_start_exprs: window_start_exprs__.unwrap_or_default(),
window_end_exprs: window_end_exprs__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.HopWindowNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for InequalityPair {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.key_required_larger != 0 {
len += 1;
}
if self.key_required_smaller != 0 {
len += 1;
}
if self.clean_state {
len += 1;
}
if self.delta_expression.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.InequalityPair", len)?;
if self.key_required_larger != 0 {
struct_ser.serialize_field("keyRequiredLarger", &self.key_required_larger)?;
}
if self.key_required_smaller != 0 {
struct_ser.serialize_field("keyRequiredSmaller", &self.key_required_smaller)?;
}
if self.clean_state {
struct_ser.serialize_field("cleanState", &self.clean_state)?;
}
if let Some(v) = self.delta_expression.as_ref() {
struct_ser.serialize_field("deltaExpression", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for InequalityPair {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"key_required_larger",
"keyRequiredLarger",
"key_required_smaller",
"keyRequiredSmaller",
"clean_state",
"cleanState",
"delta_expression",
"deltaExpression",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
KeyRequiredLarger,
KeyRequiredSmaller,
CleanState,
DeltaExpression,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"keyRequiredLarger" | "key_required_larger" => Ok(GeneratedField::KeyRequiredLarger),
"keyRequiredSmaller" | "key_required_smaller" => Ok(GeneratedField::KeyRequiredSmaller),
"cleanState" | "clean_state" => Ok(GeneratedField::CleanState),
"deltaExpression" | "delta_expression" => Ok(GeneratedField::DeltaExpression),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = InequalityPair;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.InequalityPair")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<InequalityPair, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut key_required_larger__ = None;
let mut key_required_smaller__ = None;
let mut clean_state__ = None;
let mut delta_expression__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::KeyRequiredLarger => {
if key_required_larger__.is_some() {
return Err(serde::de::Error::duplicate_field("keyRequiredLarger"));
}
key_required_larger__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::KeyRequiredSmaller => {
if key_required_smaller__.is_some() {
return Err(serde::de::Error::duplicate_field("keyRequiredSmaller"));
}
key_required_smaller__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::CleanState => {
if clean_state__.is_some() {
return Err(serde::de::Error::duplicate_field("cleanState"));
}
clean_state__ = Some(map_.next_value()?);
}
GeneratedField::DeltaExpression => {
if delta_expression__.is_some() {
return Err(serde::de::Error::duplicate_field("deltaExpression"));
}
delta_expression__ = map_.next_value()?;
}
}
}
Ok(InequalityPair {
key_required_larger: key_required_larger__.unwrap_or_default(),
key_required_smaller: key_required_smaller__.unwrap_or_default(),
clean_state: clean_state__.unwrap_or_default(),
delta_expression: delta_expression__,
})
}
}
deserializer.deserialize_struct("stream_plan.InequalityPair", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for LocalApproxPercentileNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.base != 0. {
len += 1;
}
if self.percentile_index != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.LocalApproxPercentileNode", len)?;
if self.base != 0. {
struct_ser.serialize_field("base", &self.base)?;
}
if self.percentile_index != 0 {
struct_ser.serialize_field("percentileIndex", &self.percentile_index)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for LocalApproxPercentileNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"base",
"percentile_index",
"percentileIndex",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Base,
PercentileIndex,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"base" => Ok(GeneratedField::Base),
"percentileIndex" | "percentile_index" => Ok(GeneratedField::PercentileIndex),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = LocalApproxPercentileNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.LocalApproxPercentileNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<LocalApproxPercentileNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut base__ = None;
let mut percentile_index__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Base => {
if base__.is_some() {
return Err(serde::de::Error::duplicate_field("base"));
}
base__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::PercentileIndex => {
if percentile_index__.is_some() {
return Err(serde::de::Error::duplicate_field("percentileIndex"));
}
percentile_index__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(LocalApproxPercentileNode {
base: base__.unwrap_or_default(),
percentile_index: percentile_index__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.LocalApproxPercentileNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for LookupNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.arrange_key.is_empty() {
len += 1;
}
if !self.stream_key.is_empty() {
len += 1;
}
if self.use_current_epoch {
len += 1;
}
if !self.column_mapping.is_empty() {
len += 1;
}
if self.arrangement_table_info.is_some() {
len += 1;
}
if self.arrangement_table_id.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.LookupNode", len)?;
if !self.arrange_key.is_empty() {
struct_ser.serialize_field("arrangeKey", &self.arrange_key)?;
}
if !self.stream_key.is_empty() {
struct_ser.serialize_field("streamKey", &self.stream_key)?;
}
if self.use_current_epoch {
struct_ser.serialize_field("useCurrentEpoch", &self.use_current_epoch)?;
}
if !self.column_mapping.is_empty() {
struct_ser.serialize_field("columnMapping", &self.column_mapping)?;
}
if let Some(v) = self.arrangement_table_info.as_ref() {
struct_ser.serialize_field("arrangementTableInfo", v)?;
}
if let Some(v) = self.arrangement_table_id.as_ref() {
match v {
lookup_node::ArrangementTableId::TableId(v) => {
struct_ser.serialize_field("tableId", v)?;
}
lookup_node::ArrangementTableId::IndexId(v) => {
struct_ser.serialize_field("indexId", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for LookupNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"arrange_key",
"arrangeKey",
"stream_key",
"streamKey",
"use_current_epoch",
"useCurrentEpoch",
"column_mapping",
"columnMapping",
"arrangement_table_info",
"arrangementTableInfo",
"table_id",
"tableId",
"index_id",
"indexId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ArrangeKey,
StreamKey,
UseCurrentEpoch,
ColumnMapping,
ArrangementTableInfo,
TableId,
IndexId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"arrangeKey" | "arrange_key" => Ok(GeneratedField::ArrangeKey),
"streamKey" | "stream_key" => Ok(GeneratedField::StreamKey),
"useCurrentEpoch" | "use_current_epoch" => Ok(GeneratedField::UseCurrentEpoch),
"columnMapping" | "column_mapping" => Ok(GeneratedField::ColumnMapping),
"arrangementTableInfo" | "arrangement_table_info" => Ok(GeneratedField::ArrangementTableInfo),
"tableId" | "table_id" => Ok(GeneratedField::TableId),
"indexId" | "index_id" => Ok(GeneratedField::IndexId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = LookupNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.LookupNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<LookupNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut arrange_key__ = None;
let mut stream_key__ = None;
let mut use_current_epoch__ = None;
let mut column_mapping__ = None;
let mut arrangement_table_info__ = None;
let mut arrangement_table_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ArrangeKey => {
if arrange_key__.is_some() {
return Err(serde::de::Error::duplicate_field("arrangeKey"));
}
arrange_key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::StreamKey => {
if stream_key__.is_some() {
return Err(serde::de::Error::duplicate_field("streamKey"));
}
stream_key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::UseCurrentEpoch => {
if use_current_epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("useCurrentEpoch"));
}
use_current_epoch__ = Some(map_.next_value()?);
}
GeneratedField::ColumnMapping => {
if column_mapping__.is_some() {
return Err(serde::de::Error::duplicate_field("columnMapping"));
}
column_mapping__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::ArrangementTableInfo => {
if arrangement_table_info__.is_some() {
return Err(serde::de::Error::duplicate_field("arrangementTableInfo"));
}
arrangement_table_info__ = map_.next_value()?;
}
GeneratedField::TableId => {
if arrangement_table_id__.is_some() {
return Err(serde::de::Error::duplicate_field("tableId"));
}
arrangement_table_id__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| lookup_node::ArrangementTableId::TableId(x.0));
}
GeneratedField::IndexId => {
if arrangement_table_id__.is_some() {
return Err(serde::de::Error::duplicate_field("indexId"));
}
arrangement_table_id__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| lookup_node::ArrangementTableId::IndexId(x.0));
}
}
}
Ok(LookupNode {
arrange_key: arrange_key__.unwrap_or_default(),
stream_key: stream_key__.unwrap_or_default(),
use_current_epoch: use_current_epoch__.unwrap_or_default(),
column_mapping: column_mapping__.unwrap_or_default(),
arrangement_table_info: arrangement_table_info__,
arrangement_table_id: arrangement_table_id__,
})
}
}
deserializer.deserialize_struct("stream_plan.LookupNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for LookupUnionNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.order.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.LookupUnionNode", len)?;
if !self.order.is_empty() {
struct_ser.serialize_field("order", &self.order)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for LookupUnionNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"order",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Order,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"order" => Ok(GeneratedField::Order),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = LookupUnionNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.LookupUnionNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<LookupUnionNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut order__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Order => {
if order__.is_some() {
return Err(serde::de::Error::duplicate_field("order"));
}
order__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(LookupUnionNode {
order: order__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.LookupUnionNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for MaterializeNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.table_id != 0 {
len += 1;
}
if !self.column_orders.is_empty() {
len += 1;
}
if self.table.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.MaterializeNode", len)?;
if self.table_id != 0 {
struct_ser.serialize_field("tableId", &self.table_id)?;
}
if !self.column_orders.is_empty() {
struct_ser.serialize_field("columnOrders", &self.column_orders)?;
}
if let Some(v) = self.table.as_ref() {
struct_ser.serialize_field("table", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for MaterializeNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table_id",
"tableId",
"column_orders",
"columnOrders",
"table",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableId,
ColumnOrders,
Table,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"tableId" | "table_id" => Ok(GeneratedField::TableId),
"columnOrders" | "column_orders" => Ok(GeneratedField::ColumnOrders),
"table" => Ok(GeneratedField::Table),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = MaterializeNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.MaterializeNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<MaterializeNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_id__ = None;
let mut column_orders__ = None;
let mut table__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TableId => {
if table_id__.is_some() {
return Err(serde::de::Error::duplicate_field("tableId"));
}
table_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::ColumnOrders => {
if column_orders__.is_some() {
return Err(serde::de::Error::duplicate_field("columnOrders"));
}
column_orders__ = Some(map_.next_value()?);
}
GeneratedField::Table => {
if table__.is_some() {
return Err(serde::de::Error::duplicate_field("table"));
}
table__ = map_.next_value()?;
}
}
}
Ok(MaterializeNode {
table_id: table_id__.unwrap_or_default(),
column_orders: column_orders__.unwrap_or_default(),
table: table__,
})
}
}
deserializer.deserialize_struct("stream_plan.MaterializeNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for MergeNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.upstream_actor_id.is_empty() {
len += 1;
}
if self.upstream_fragment_id != 0 {
len += 1;
}
if self.upstream_dispatcher_type != 0 {
len += 1;
}
if !self.fields.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.MergeNode", len)?;
if !self.upstream_actor_id.is_empty() {
struct_ser.serialize_field("upstreamActorId", &self.upstream_actor_id)?;
}
if self.upstream_fragment_id != 0 {
struct_ser.serialize_field("upstreamFragmentId", &self.upstream_fragment_id)?;
}
if self.upstream_dispatcher_type != 0 {
let v = DispatcherType::try_from(self.upstream_dispatcher_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.upstream_dispatcher_type)))?;
struct_ser.serialize_field("upstreamDispatcherType", &v)?;
}
if !self.fields.is_empty() {
struct_ser.serialize_field("fields", &self.fields)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for MergeNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"upstream_actor_id",
"upstreamActorId",
"upstream_fragment_id",
"upstreamFragmentId",
"upstream_dispatcher_type",
"upstreamDispatcherType",
"fields",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
UpstreamActorId,
UpstreamFragmentId,
UpstreamDispatcherType,
Fields,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"upstreamActorId" | "upstream_actor_id" => Ok(GeneratedField::UpstreamActorId),
"upstreamFragmentId" | "upstream_fragment_id" => Ok(GeneratedField::UpstreamFragmentId),
"upstreamDispatcherType" | "upstream_dispatcher_type" => Ok(GeneratedField::UpstreamDispatcherType),
"fields" => Ok(GeneratedField::Fields),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = MergeNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.MergeNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<MergeNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut upstream_actor_id__ = None;
let mut upstream_fragment_id__ = None;
let mut upstream_dispatcher_type__ = None;
let mut fields__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::UpstreamActorId => {
if upstream_actor_id__.is_some() {
return Err(serde::de::Error::duplicate_field("upstreamActorId"));
}
upstream_actor_id__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::UpstreamFragmentId => {
if upstream_fragment_id__.is_some() {
return Err(serde::de::Error::duplicate_field("upstreamFragmentId"));
}
upstream_fragment_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::UpstreamDispatcherType => {
if upstream_dispatcher_type__.is_some() {
return Err(serde::de::Error::duplicate_field("upstreamDispatcherType"));
}
upstream_dispatcher_type__ = Some(map_.next_value::<DispatcherType>()? as i32);
}
GeneratedField::Fields => {
if fields__.is_some() {
return Err(serde::de::Error::duplicate_field("fields"));
}
fields__ = Some(map_.next_value()?);
}
}
}
Ok(MergeNode {
upstream_actor_id: upstream_actor_id__.unwrap_or_default(),
upstream_fragment_id: upstream_fragment_id__.unwrap_or_default(),
upstream_dispatcher_type: upstream_dispatcher_type__.unwrap_or_default(),
fields: fields__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.MergeNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for NoOpNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("stream_plan.NoOpNode", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for NoOpNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = NoOpNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.NoOpNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<NoOpNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(NoOpNode {
})
}
}
deserializer.deserialize_struct("stream_plan.NoOpNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for NowModeGenerateSeries {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.start_timestamp.is_some() {
len += 1;
}
if self.interval.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.NowModeGenerateSeries", len)?;
if let Some(v) = self.start_timestamp.as_ref() {
struct_ser.serialize_field("startTimestamp", v)?;
}
if let Some(v) = self.interval.as_ref() {
struct_ser.serialize_field("interval", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for NowModeGenerateSeries {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"start_timestamp",
"startTimestamp",
"interval",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
StartTimestamp,
Interval,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"startTimestamp" | "start_timestamp" => Ok(GeneratedField::StartTimestamp),
"interval" => Ok(GeneratedField::Interval),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = NowModeGenerateSeries;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.NowModeGenerateSeries")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<NowModeGenerateSeries, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut start_timestamp__ = None;
let mut interval__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::StartTimestamp => {
if start_timestamp__.is_some() {
return Err(serde::de::Error::duplicate_field("startTimestamp"));
}
start_timestamp__ = map_.next_value()?;
}
GeneratedField::Interval => {
if interval__.is_some() {
return Err(serde::de::Error::duplicate_field("interval"));
}
interval__ = map_.next_value()?;
}
}
}
Ok(NowModeGenerateSeries {
start_timestamp: start_timestamp__,
interval: interval__,
})
}
}
deserializer.deserialize_struct("stream_plan.NowModeGenerateSeries", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for NowModeUpdateCurrent {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("stream_plan.NowModeUpdateCurrent", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for NowModeUpdateCurrent {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = NowModeUpdateCurrent;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.NowModeUpdateCurrent")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<NowModeUpdateCurrent, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(NowModeUpdateCurrent {
})
}
}
deserializer.deserialize_struct("stream_plan.NowModeUpdateCurrent", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for NowNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.state_table.is_some() {
len += 1;
}
if self.mode.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.NowNode", len)?;
if let Some(v) = self.state_table.as_ref() {
struct_ser.serialize_field("stateTable", v)?;
}
if let Some(v) = self.mode.as_ref() {
match v {
now_node::Mode::UpdateCurrent(v) => {
struct_ser.serialize_field("updateCurrent", v)?;
}
now_node::Mode::GenerateSeries(v) => {
struct_ser.serialize_field("generateSeries", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for NowNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"state_table",
"stateTable",
"update_current",
"updateCurrent",
"generate_series",
"generateSeries",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
StateTable,
UpdateCurrent,
GenerateSeries,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"stateTable" | "state_table" => Ok(GeneratedField::StateTable),
"updateCurrent" | "update_current" => Ok(GeneratedField::UpdateCurrent),
"generateSeries" | "generate_series" => Ok(GeneratedField::GenerateSeries),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = NowNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.NowNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<NowNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut state_table__ = None;
let mut mode__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::StateTable => {
if state_table__.is_some() {
return Err(serde::de::Error::duplicate_field("stateTable"));
}
state_table__ = map_.next_value()?;
}
GeneratedField::UpdateCurrent => {
if mode__.is_some() {
return Err(serde::de::Error::duplicate_field("updateCurrent"));
}
mode__ = map_.next_value::<::std::option::Option<_>>()?.map(now_node::Mode::UpdateCurrent)
;
}
GeneratedField::GenerateSeries => {
if mode__.is_some() {
return Err(serde::de::Error::duplicate_field("generateSeries"));
}
mode__ = map_.next_value::<::std::option::Option<_>>()?.map(now_node::Mode::GenerateSeries)
;
}
}
}
Ok(NowNode {
state_table: state_table__,
mode: mode__,
})
}
}
deserializer.deserialize_struct("stream_plan.NowNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for OverWindowCachePolicy {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
let variant = match self {
Self::Unspecified => "OVER_WINDOW_CACHE_POLICY_UNSPECIFIED",
Self::Full => "OVER_WINDOW_CACHE_POLICY_FULL",
Self::Recent => "OVER_WINDOW_CACHE_POLICY_RECENT",
Self::RecentFirstN => "OVER_WINDOW_CACHE_POLICY_RECENT_FIRST_N",
Self::RecentLastN => "OVER_WINDOW_CACHE_POLICY_RECENT_LAST_N",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for OverWindowCachePolicy {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"OVER_WINDOW_CACHE_POLICY_UNSPECIFIED",
"OVER_WINDOW_CACHE_POLICY_FULL",
"OVER_WINDOW_CACHE_POLICY_RECENT",
"OVER_WINDOW_CACHE_POLICY_RECENT_FIRST_N",
"OVER_WINDOW_CACHE_POLICY_RECENT_LAST_N",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = OverWindowCachePolicy;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
})
}
fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
})
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
match value {
"OVER_WINDOW_CACHE_POLICY_UNSPECIFIED" => Ok(OverWindowCachePolicy::Unspecified),
"OVER_WINDOW_CACHE_POLICY_FULL" => Ok(OverWindowCachePolicy::Full),
"OVER_WINDOW_CACHE_POLICY_RECENT" => Ok(OverWindowCachePolicy::Recent),
"OVER_WINDOW_CACHE_POLICY_RECENT_FIRST_N" => Ok(OverWindowCachePolicy::RecentFirstN),
"OVER_WINDOW_CACHE_POLICY_RECENT_LAST_N" => Ok(OverWindowCachePolicy::RecentLastN),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for OverWindowNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.calls.is_empty() {
len += 1;
}
if !self.partition_by.is_empty() {
len += 1;
}
if !self.order_by.is_empty() {
len += 1;
}
if self.state_table.is_some() {
len += 1;
}
if self.cache_policy != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.OverWindowNode", len)?;
if !self.calls.is_empty() {
struct_ser.serialize_field("calls", &self.calls)?;
}
if !self.partition_by.is_empty() {
struct_ser.serialize_field("partitionBy", &self.partition_by)?;
}
if !self.order_by.is_empty() {
struct_ser.serialize_field("orderBy", &self.order_by)?;
}
if let Some(v) = self.state_table.as_ref() {
struct_ser.serialize_field("stateTable", v)?;
}
if self.cache_policy != 0 {
let v = OverWindowCachePolicy::try_from(self.cache_policy)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.cache_policy)))?;
struct_ser.serialize_field("cachePolicy", &v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for OverWindowNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"calls",
"partition_by",
"partitionBy",
"order_by",
"orderBy",
"state_table",
"stateTable",
"cache_policy",
"cachePolicy",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Calls,
PartitionBy,
OrderBy,
StateTable,
CachePolicy,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"calls" => Ok(GeneratedField::Calls),
"partitionBy" | "partition_by" => Ok(GeneratedField::PartitionBy),
"orderBy" | "order_by" => Ok(GeneratedField::OrderBy),
"stateTable" | "state_table" => Ok(GeneratedField::StateTable),
"cachePolicy" | "cache_policy" => Ok(GeneratedField::CachePolicy),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = OverWindowNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.OverWindowNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<OverWindowNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut calls__ = None;
let mut partition_by__ = None;
let mut order_by__ = None;
let mut state_table__ = None;
let mut cache_policy__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Calls => {
if calls__.is_some() {
return Err(serde::de::Error::duplicate_field("calls"));
}
calls__ = Some(map_.next_value()?);
}
GeneratedField::PartitionBy => {
if partition_by__.is_some() {
return Err(serde::de::Error::duplicate_field("partitionBy"));
}
partition_by__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::OrderBy => {
if order_by__.is_some() {
return Err(serde::de::Error::duplicate_field("orderBy"));
}
order_by__ = Some(map_.next_value()?);
}
GeneratedField::StateTable => {
if state_table__.is_some() {
return Err(serde::de::Error::duplicate_field("stateTable"));
}
state_table__ = map_.next_value()?;
}
GeneratedField::CachePolicy => {
if cache_policy__.is_some() {
return Err(serde::de::Error::duplicate_field("cachePolicy"));
}
cache_policy__ = Some(map_.next_value::<OverWindowCachePolicy>()? as i32);
}
}
}
Ok(OverWindowNode {
calls: calls__.unwrap_or_default(),
partition_by: partition_by__.unwrap_or_default(),
order_by: order_by__.unwrap_or_default(),
state_table: state_table__,
cache_policy: cache_policy__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.OverWindowNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for PauseMutation {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("stream_plan.PauseMutation", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for PauseMutation {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = PauseMutation;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.PauseMutation")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<PauseMutation, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(PauseMutation {
})
}
}
deserializer.deserialize_struct("stream_plan.PauseMutation", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ProjectNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.select_list.is_empty() {
len += 1;
}
if !self.watermark_input_cols.is_empty() {
len += 1;
}
if !self.watermark_output_cols.is_empty() {
len += 1;
}
if !self.nondecreasing_exprs.is_empty() {
len += 1;
}
if self.noop_update_hint {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.ProjectNode", len)?;
if !self.select_list.is_empty() {
struct_ser.serialize_field("selectList", &self.select_list)?;
}
if !self.watermark_input_cols.is_empty() {
struct_ser.serialize_field("watermarkInputCols", &self.watermark_input_cols)?;
}
if !self.watermark_output_cols.is_empty() {
struct_ser.serialize_field("watermarkOutputCols", &self.watermark_output_cols)?;
}
if !self.nondecreasing_exprs.is_empty() {
struct_ser.serialize_field("nondecreasingExprs", &self.nondecreasing_exprs)?;
}
if self.noop_update_hint {
struct_ser.serialize_field("noopUpdateHint", &self.noop_update_hint)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ProjectNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"select_list",
"selectList",
"watermark_input_cols",
"watermarkInputCols",
"watermark_output_cols",
"watermarkOutputCols",
"nondecreasing_exprs",
"nondecreasingExprs",
"noop_update_hint",
"noopUpdateHint",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SelectList,
WatermarkInputCols,
WatermarkOutputCols,
NondecreasingExprs,
NoopUpdateHint,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"selectList" | "select_list" => Ok(GeneratedField::SelectList),
"watermarkInputCols" | "watermark_input_cols" => Ok(GeneratedField::WatermarkInputCols),
"watermarkOutputCols" | "watermark_output_cols" => Ok(GeneratedField::WatermarkOutputCols),
"nondecreasingExprs" | "nondecreasing_exprs" => Ok(GeneratedField::NondecreasingExprs),
"noopUpdateHint" | "noop_update_hint" => Ok(GeneratedField::NoopUpdateHint),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ProjectNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.ProjectNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ProjectNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut select_list__ = None;
let mut watermark_input_cols__ = None;
let mut watermark_output_cols__ = None;
let mut nondecreasing_exprs__ = None;
let mut noop_update_hint__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::SelectList => {
if select_list__.is_some() {
return Err(serde::de::Error::duplicate_field("selectList"));
}
select_list__ = Some(map_.next_value()?);
}
GeneratedField::WatermarkInputCols => {
if watermark_input_cols__.is_some() {
return Err(serde::de::Error::duplicate_field("watermarkInputCols"));
}
watermark_input_cols__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::WatermarkOutputCols => {
if watermark_output_cols__.is_some() {
return Err(serde::de::Error::duplicate_field("watermarkOutputCols"));
}
watermark_output_cols__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::NondecreasingExprs => {
if nondecreasing_exprs__.is_some() {
return Err(serde::de::Error::duplicate_field("nondecreasingExprs"));
}
nondecreasing_exprs__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::NoopUpdateHint => {
if noop_update_hint__.is_some() {
return Err(serde::de::Error::duplicate_field("noopUpdateHint"));
}
noop_update_hint__ = Some(map_.next_value()?);
}
}
}
Ok(ProjectNode {
select_list: select_list__.unwrap_or_default(),
watermark_input_cols: watermark_input_cols__.unwrap_or_default(),
watermark_output_cols: watermark_output_cols__.unwrap_or_default(),
nondecreasing_exprs: nondecreasing_exprs__.unwrap_or_default(),
noop_update_hint: noop_update_hint__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.ProjectNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ProjectSetNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.select_list.is_empty() {
len += 1;
}
if !self.watermark_input_cols.is_empty() {
len += 1;
}
if !self.watermark_expr_indices.is_empty() {
len += 1;
}
if !self.nondecreasing_exprs.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.ProjectSetNode", len)?;
if !self.select_list.is_empty() {
struct_ser.serialize_field("selectList", &self.select_list)?;
}
if !self.watermark_input_cols.is_empty() {
struct_ser.serialize_field("watermarkInputCols", &self.watermark_input_cols)?;
}
if !self.watermark_expr_indices.is_empty() {
struct_ser.serialize_field("watermarkExprIndices", &self.watermark_expr_indices)?;
}
if !self.nondecreasing_exprs.is_empty() {
struct_ser.serialize_field("nondecreasingExprs", &self.nondecreasing_exprs)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ProjectSetNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"select_list",
"selectList",
"watermark_input_cols",
"watermarkInputCols",
"watermark_expr_indices",
"watermarkExprIndices",
"nondecreasing_exprs",
"nondecreasingExprs",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SelectList,
WatermarkInputCols,
WatermarkExprIndices,
NondecreasingExprs,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"selectList" | "select_list" => Ok(GeneratedField::SelectList),
"watermarkInputCols" | "watermark_input_cols" => Ok(GeneratedField::WatermarkInputCols),
"watermarkExprIndices" | "watermark_expr_indices" => Ok(GeneratedField::WatermarkExprIndices),
"nondecreasingExprs" | "nondecreasing_exprs" => Ok(GeneratedField::NondecreasingExprs),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ProjectSetNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.ProjectSetNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ProjectSetNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut select_list__ = None;
let mut watermark_input_cols__ = None;
let mut watermark_expr_indices__ = None;
let mut nondecreasing_exprs__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::SelectList => {
if select_list__.is_some() {
return Err(serde::de::Error::duplicate_field("selectList"));
}
select_list__ = Some(map_.next_value()?);
}
GeneratedField::WatermarkInputCols => {
if watermark_input_cols__.is_some() {
return Err(serde::de::Error::duplicate_field("watermarkInputCols"));
}
watermark_input_cols__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::WatermarkExprIndices => {
if watermark_expr_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("watermarkExprIndices"));
}
watermark_expr_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::NondecreasingExprs => {
if nondecreasing_exprs__.is_some() {
return Err(serde::de::Error::duplicate_field("nondecreasingExprs"));
}
nondecreasing_exprs__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(ProjectSetNode {
select_list: select_list__.unwrap_or_default(),
watermark_input_cols: watermark_input_cols__.unwrap_or_default(),
watermark_expr_indices: watermark_expr_indices__.unwrap_or_default(),
nondecreasing_exprs: nondecreasing_exprs__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.ProjectSetNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ResumeMutation {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("stream_plan.ResumeMutation", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ResumeMutation {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ResumeMutation;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.ResumeMutation")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ResumeMutation, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(ResumeMutation {
})
}
}
deserializer.deserialize_struct("stream_plan.ResumeMutation", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RowIdGenNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.row_id_index != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.RowIdGenNode", len)?;
if self.row_id_index != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("rowIdIndex", ToString::to_string(&self.row_id_index).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RowIdGenNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"row_id_index",
"rowIdIndex",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
RowIdIndex,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"rowIdIndex" | "row_id_index" => Ok(GeneratedField::RowIdIndex),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RowIdGenNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.RowIdGenNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RowIdGenNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut row_id_index__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::RowIdIndex => {
if row_id_index__.is_some() {
return Err(serde::de::Error::duplicate_field("rowIdIndex"));
}
row_id_index__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(RowIdGenNode {
row_id_index: row_id_index__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.RowIdGenNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RowMergeNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.lhs_mapping.is_some() {
len += 1;
}
if self.rhs_mapping.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.RowMergeNode", len)?;
if let Some(v) = self.lhs_mapping.as_ref() {
struct_ser.serialize_field("lhsMapping", v)?;
}
if let Some(v) = self.rhs_mapping.as_ref() {
struct_ser.serialize_field("rhsMapping", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RowMergeNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"lhs_mapping",
"lhsMapping",
"rhs_mapping",
"rhsMapping",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
LhsMapping,
RhsMapping,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"lhsMapping" | "lhs_mapping" => Ok(GeneratedField::LhsMapping),
"rhsMapping" | "rhs_mapping" => Ok(GeneratedField::RhsMapping),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RowMergeNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.RowMergeNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RowMergeNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut lhs_mapping__ = None;
let mut rhs_mapping__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::LhsMapping => {
if lhs_mapping__.is_some() {
return Err(serde::de::Error::duplicate_field("lhsMapping"));
}
lhs_mapping__ = map_.next_value()?;
}
GeneratedField::RhsMapping => {
if rhs_mapping__.is_some() {
return Err(serde::de::Error::duplicate_field("rhsMapping"));
}
rhs_mapping__ = map_.next_value()?;
}
}
}
Ok(RowMergeNode {
lhs_mapping: lhs_mapping__,
rhs_mapping: rhs_mapping__,
})
}
}
deserializer.deserialize_struct("stream_plan.RowMergeNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SimpleAggNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.agg_calls.is_empty() {
len += 1;
}
if !self.distribution_key.is_empty() {
len += 1;
}
if !self.agg_call_states.is_empty() {
len += 1;
}
if self.intermediate_state_table.is_some() {
len += 1;
}
if self.is_append_only {
len += 1;
}
if !self.distinct_dedup_tables.is_empty() {
len += 1;
}
if self.row_count_index != 0 {
len += 1;
}
if self.version != 0 {
len += 1;
}
if self.must_output_per_barrier {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.SimpleAggNode", len)?;
if !self.agg_calls.is_empty() {
struct_ser.serialize_field("aggCalls", &self.agg_calls)?;
}
if !self.distribution_key.is_empty() {
struct_ser.serialize_field("distributionKey", &self.distribution_key)?;
}
if !self.agg_call_states.is_empty() {
struct_ser.serialize_field("aggCallStates", &self.agg_call_states)?;
}
if let Some(v) = self.intermediate_state_table.as_ref() {
struct_ser.serialize_field("intermediateStateTable", v)?;
}
if self.is_append_only {
struct_ser.serialize_field("isAppendOnly", &self.is_append_only)?;
}
if !self.distinct_dedup_tables.is_empty() {
struct_ser.serialize_field("distinctDedupTables", &self.distinct_dedup_tables)?;
}
if self.row_count_index != 0 {
struct_ser.serialize_field("rowCountIndex", &self.row_count_index)?;
}
if self.version != 0 {
let v = AggNodeVersion::try_from(self.version)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.version)))?;
struct_ser.serialize_field("version", &v)?;
}
if self.must_output_per_barrier {
struct_ser.serialize_field("mustOutputPerBarrier", &self.must_output_per_barrier)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SimpleAggNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"agg_calls",
"aggCalls",
"distribution_key",
"distributionKey",
"agg_call_states",
"aggCallStates",
"intermediate_state_table",
"intermediateStateTable",
"is_append_only",
"isAppendOnly",
"distinct_dedup_tables",
"distinctDedupTables",
"row_count_index",
"rowCountIndex",
"version",
"must_output_per_barrier",
"mustOutputPerBarrier",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
AggCalls,
DistributionKey,
AggCallStates,
IntermediateStateTable,
IsAppendOnly,
DistinctDedupTables,
RowCountIndex,
Version,
MustOutputPerBarrier,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"aggCalls" | "agg_calls" => Ok(GeneratedField::AggCalls),
"distributionKey" | "distribution_key" => Ok(GeneratedField::DistributionKey),
"aggCallStates" | "agg_call_states" => Ok(GeneratedField::AggCallStates),
"intermediateStateTable" | "intermediate_state_table" => Ok(GeneratedField::IntermediateStateTable),
"isAppendOnly" | "is_append_only" => Ok(GeneratedField::IsAppendOnly),
"distinctDedupTables" | "distinct_dedup_tables" => Ok(GeneratedField::DistinctDedupTables),
"rowCountIndex" | "row_count_index" => Ok(GeneratedField::RowCountIndex),
"version" => Ok(GeneratedField::Version),
"mustOutputPerBarrier" | "must_output_per_barrier" => Ok(GeneratedField::MustOutputPerBarrier),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SimpleAggNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.SimpleAggNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SimpleAggNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut agg_calls__ = None;
let mut distribution_key__ = None;
let mut agg_call_states__ = None;
let mut intermediate_state_table__ = None;
let mut is_append_only__ = None;
let mut distinct_dedup_tables__ = None;
let mut row_count_index__ = None;
let mut version__ = None;
let mut must_output_per_barrier__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::AggCalls => {
if agg_calls__.is_some() {
return Err(serde::de::Error::duplicate_field("aggCalls"));
}
agg_calls__ = Some(map_.next_value()?);
}
GeneratedField::DistributionKey => {
if distribution_key__.is_some() {
return Err(serde::de::Error::duplicate_field("distributionKey"));
}
distribution_key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::AggCallStates => {
if agg_call_states__.is_some() {
return Err(serde::de::Error::duplicate_field("aggCallStates"));
}
agg_call_states__ = Some(map_.next_value()?);
}
GeneratedField::IntermediateStateTable => {
if intermediate_state_table__.is_some() {
return Err(serde::de::Error::duplicate_field("intermediateStateTable"));
}
intermediate_state_table__ = map_.next_value()?;
}
GeneratedField::IsAppendOnly => {
if is_append_only__.is_some() {
return Err(serde::de::Error::duplicate_field("isAppendOnly"));
}
is_append_only__ = Some(map_.next_value()?);
}
GeneratedField::DistinctDedupTables => {
if distinct_dedup_tables__.is_some() {
return Err(serde::de::Error::duplicate_field("distinctDedupTables"));
}
distinct_dedup_tables__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::RowCountIndex => {
if row_count_index__.is_some() {
return Err(serde::de::Error::duplicate_field("rowCountIndex"));
}
row_count_index__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = Some(map_.next_value::<AggNodeVersion>()? as i32);
}
GeneratedField::MustOutputPerBarrier => {
if must_output_per_barrier__.is_some() {
return Err(serde::de::Error::duplicate_field("mustOutputPerBarrier"));
}
must_output_per_barrier__ = Some(map_.next_value()?);
}
}
}
Ok(SimpleAggNode {
agg_calls: agg_calls__.unwrap_or_default(),
distribution_key: distribution_key__.unwrap_or_default(),
agg_call_states: agg_call_states__.unwrap_or_default(),
intermediate_state_table: intermediate_state_table__,
is_append_only: is_append_only__.unwrap_or_default(),
distinct_dedup_tables: distinct_dedup_tables__.unwrap_or_default(),
row_count_index: row_count_index__.unwrap_or_default(),
version: version__.unwrap_or_default(),
must_output_per_barrier: must_output_per_barrier__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.SimpleAggNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SinkDesc {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.id != 0 {
len += 1;
}
if !self.name.is_empty() {
len += 1;
}
if !self.definition.is_empty() {
len += 1;
}
if !self.plan_pk.is_empty() {
len += 1;
}
if !self.downstream_pk.is_empty() {
len += 1;
}
if !self.distribution_key.is_empty() {
len += 1;
}
if !self.properties.is_empty() {
len += 1;
}
if self.sink_type != 0 {
len += 1;
}
if !self.column_catalogs.is_empty() {
len += 1;
}
if !self.db_name.is_empty() {
len += 1;
}
if !self.sink_from_name.is_empty() {
len += 1;
}
if self.format_desc.is_some() {
len += 1;
}
if self.target_table.is_some() {
len += 1;
}
if self.extra_partition_col_idx.is_some() {
len += 1;
}
if !self.secret_refs.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.SinkDesc", len)?;
if self.id != 0 {
struct_ser.serialize_field("id", &self.id)?;
}
if !self.name.is_empty() {
struct_ser.serialize_field("name", &self.name)?;
}
if !self.definition.is_empty() {
struct_ser.serialize_field("definition", &self.definition)?;
}
if !self.plan_pk.is_empty() {
struct_ser.serialize_field("planPk", &self.plan_pk)?;
}
if !self.downstream_pk.is_empty() {
struct_ser.serialize_field("downstreamPk", &self.downstream_pk)?;
}
if !self.distribution_key.is_empty() {
struct_ser.serialize_field("distributionKey", &self.distribution_key)?;
}
if !self.properties.is_empty() {
struct_ser.serialize_field("properties", &self.properties)?;
}
if self.sink_type != 0 {
let v = super::catalog::SinkType::try_from(self.sink_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.sink_type)))?;
struct_ser.serialize_field("sinkType", &v)?;
}
if !self.column_catalogs.is_empty() {
struct_ser.serialize_field("columnCatalogs", &self.column_catalogs)?;
}
if !self.db_name.is_empty() {
struct_ser.serialize_field("dbName", &self.db_name)?;
}
if !self.sink_from_name.is_empty() {
struct_ser.serialize_field("sinkFromName", &self.sink_from_name)?;
}
if let Some(v) = self.format_desc.as_ref() {
struct_ser.serialize_field("formatDesc", v)?;
}
if let Some(v) = self.target_table.as_ref() {
struct_ser.serialize_field("targetTable", v)?;
}
if let Some(v) = self.extra_partition_col_idx.as_ref() {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("extraPartitionColIdx", ToString::to_string(&v).as_str())?;
}
if !self.secret_refs.is_empty() {
struct_ser.serialize_field("secretRefs", &self.secret_refs)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SinkDesc {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"id",
"name",
"definition",
"plan_pk",
"planPk",
"downstream_pk",
"downstreamPk",
"distribution_key",
"distributionKey",
"properties",
"sink_type",
"sinkType",
"column_catalogs",
"columnCatalogs",
"db_name",
"dbName",
"sink_from_name",
"sinkFromName",
"format_desc",
"formatDesc",
"target_table",
"targetTable",
"extra_partition_col_idx",
"extraPartitionColIdx",
"secret_refs",
"secretRefs",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Id,
Name,
Definition,
PlanPk,
DownstreamPk,
DistributionKey,
Properties,
SinkType,
ColumnCatalogs,
DbName,
SinkFromName,
FormatDesc,
TargetTable,
ExtraPartitionColIdx,
SecretRefs,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"id" => Ok(GeneratedField::Id),
"name" => Ok(GeneratedField::Name),
"definition" => Ok(GeneratedField::Definition),
"planPk" | "plan_pk" => Ok(GeneratedField::PlanPk),
"downstreamPk" | "downstream_pk" => Ok(GeneratedField::DownstreamPk),
"distributionKey" | "distribution_key" => Ok(GeneratedField::DistributionKey),
"properties" => Ok(GeneratedField::Properties),
"sinkType" | "sink_type" => Ok(GeneratedField::SinkType),
"columnCatalogs" | "column_catalogs" => Ok(GeneratedField::ColumnCatalogs),
"dbName" | "db_name" => Ok(GeneratedField::DbName),
"sinkFromName" | "sink_from_name" => Ok(GeneratedField::SinkFromName),
"formatDesc" | "format_desc" => Ok(GeneratedField::FormatDesc),
"targetTable" | "target_table" => Ok(GeneratedField::TargetTable),
"extraPartitionColIdx" | "extra_partition_col_idx" => Ok(GeneratedField::ExtraPartitionColIdx),
"secretRefs" | "secret_refs" => Ok(GeneratedField::SecretRefs),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SinkDesc;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.SinkDesc")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SinkDesc, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut id__ = None;
let mut name__ = None;
let mut definition__ = None;
let mut plan_pk__ = None;
let mut downstream_pk__ = None;
let mut distribution_key__ = None;
let mut properties__ = None;
let mut sink_type__ = None;
let mut column_catalogs__ = None;
let mut db_name__ = None;
let mut sink_from_name__ = None;
let mut format_desc__ = None;
let mut target_table__ = None;
let mut extra_partition_col_idx__ = None;
let mut secret_refs__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Id => {
if id__.is_some() {
return Err(serde::de::Error::duplicate_field("id"));
}
id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Name => {
if name__.is_some() {
return Err(serde::de::Error::duplicate_field("name"));
}
name__ = Some(map_.next_value()?);
}
GeneratedField::Definition => {
if definition__.is_some() {
return Err(serde::de::Error::duplicate_field("definition"));
}
definition__ = Some(map_.next_value()?);
}
GeneratedField::PlanPk => {
if plan_pk__.is_some() {
return Err(serde::de::Error::duplicate_field("planPk"));
}
plan_pk__ = Some(map_.next_value()?);
}
GeneratedField::DownstreamPk => {
if downstream_pk__.is_some() {
return Err(serde::de::Error::duplicate_field("downstreamPk"));
}
downstream_pk__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::DistributionKey => {
if distribution_key__.is_some() {
return Err(serde::de::Error::duplicate_field("distributionKey"));
}
distribution_key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::Properties => {
if properties__.is_some() {
return Err(serde::de::Error::duplicate_field("properties"));
}
properties__ = Some(
map_.next_value::<std::collections::BTreeMap<_, _>>()?
);
}
GeneratedField::SinkType => {
if sink_type__.is_some() {
return Err(serde::de::Error::duplicate_field("sinkType"));
}
sink_type__ = Some(map_.next_value::<super::catalog::SinkType>()? as i32);
}
GeneratedField::ColumnCatalogs => {
if column_catalogs__.is_some() {
return Err(serde::de::Error::duplicate_field("columnCatalogs"));
}
column_catalogs__ = Some(map_.next_value()?);
}
GeneratedField::DbName => {
if db_name__.is_some() {
return Err(serde::de::Error::duplicate_field("dbName"));
}
db_name__ = Some(map_.next_value()?);
}
GeneratedField::SinkFromName => {
if sink_from_name__.is_some() {
return Err(serde::de::Error::duplicate_field("sinkFromName"));
}
sink_from_name__ = Some(map_.next_value()?);
}
GeneratedField::FormatDesc => {
if format_desc__.is_some() {
return Err(serde::de::Error::duplicate_field("formatDesc"));
}
format_desc__ = map_.next_value()?;
}
GeneratedField::TargetTable => {
if target_table__.is_some() {
return Err(serde::de::Error::duplicate_field("targetTable"));
}
target_table__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::ExtraPartitionColIdx => {
if extra_partition_col_idx__.is_some() {
return Err(serde::de::Error::duplicate_field("extraPartitionColIdx"));
}
extra_partition_col_idx__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::SecretRefs => {
if secret_refs__.is_some() {
return Err(serde::de::Error::duplicate_field("secretRefs"));
}
secret_refs__ = Some(
map_.next_value::<std::collections::BTreeMap<_, _>>()?
);
}
}
}
Ok(SinkDesc {
id: id__.unwrap_or_default(),
name: name__.unwrap_or_default(),
definition: definition__.unwrap_or_default(),
plan_pk: plan_pk__.unwrap_or_default(),
downstream_pk: downstream_pk__.unwrap_or_default(),
distribution_key: distribution_key__.unwrap_or_default(),
properties: properties__.unwrap_or_default(),
sink_type: sink_type__.unwrap_or_default(),
column_catalogs: column_catalogs__.unwrap_or_default(),
db_name: db_name__.unwrap_or_default(),
sink_from_name: sink_from_name__.unwrap_or_default(),
format_desc: format_desc__,
target_table: target_table__,
extra_partition_col_idx: extra_partition_col_idx__,
secret_refs: secret_refs__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.SinkDesc", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SinkLogStoreType {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
let variant = match self {
Self::Unspecified => "SINK_LOG_STORE_TYPE_UNSPECIFIED",
Self::KvLogStore => "SINK_LOG_STORE_TYPE_KV_LOG_STORE",
Self::InMemoryLogStore => "SINK_LOG_STORE_TYPE_IN_MEMORY_LOG_STORE",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for SinkLogStoreType {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"SINK_LOG_STORE_TYPE_UNSPECIFIED",
"SINK_LOG_STORE_TYPE_KV_LOG_STORE",
"SINK_LOG_STORE_TYPE_IN_MEMORY_LOG_STORE",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SinkLogStoreType;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
})
}
fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
})
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
match value {
"SINK_LOG_STORE_TYPE_UNSPECIFIED" => Ok(SinkLogStoreType::Unspecified),
"SINK_LOG_STORE_TYPE_KV_LOG_STORE" => Ok(SinkLogStoreType::KvLogStore),
"SINK_LOG_STORE_TYPE_IN_MEMORY_LOG_STORE" => Ok(SinkLogStoreType::InMemoryLogStore),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for SinkNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.sink_desc.is_some() {
len += 1;
}
if self.table.is_some() {
len += 1;
}
if self.log_store_type != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.SinkNode", len)?;
if let Some(v) = self.sink_desc.as_ref() {
struct_ser.serialize_field("sinkDesc", v)?;
}
if let Some(v) = self.table.as_ref() {
struct_ser.serialize_field("table", v)?;
}
if self.log_store_type != 0 {
let v = SinkLogStoreType::try_from(self.log_store_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.log_store_type)))?;
struct_ser.serialize_field("logStoreType", &v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SinkNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"sink_desc",
"sinkDesc",
"table",
"log_store_type",
"logStoreType",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SinkDesc,
Table,
LogStoreType,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"sinkDesc" | "sink_desc" => Ok(GeneratedField::SinkDesc),
"table" => Ok(GeneratedField::Table),
"logStoreType" | "log_store_type" => Ok(GeneratedField::LogStoreType),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SinkNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.SinkNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SinkNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut sink_desc__ = None;
let mut table__ = None;
let mut log_store_type__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::SinkDesc => {
if sink_desc__.is_some() {
return Err(serde::de::Error::duplicate_field("sinkDesc"));
}
sink_desc__ = map_.next_value()?;
}
GeneratedField::Table => {
if table__.is_some() {
return Err(serde::de::Error::duplicate_field("table"));
}
table__ = map_.next_value()?;
}
GeneratedField::LogStoreType => {
if log_store_type__.is_some() {
return Err(serde::de::Error::duplicate_field("logStoreType"));
}
log_store_type__ = Some(map_.next_value::<SinkLogStoreType>()? as i32);
}
}
}
Ok(SinkNode {
sink_desc: sink_desc__,
table: table__,
log_store_type: log_store_type__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.SinkNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SortNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.state_table.is_some() {
len += 1;
}
if self.sort_column_index != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.SortNode", len)?;
if let Some(v) = self.state_table.as_ref() {
struct_ser.serialize_field("stateTable", v)?;
}
if self.sort_column_index != 0 {
struct_ser.serialize_field("sortColumnIndex", &self.sort_column_index)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SortNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"state_table",
"stateTable",
"sort_column_index",
"sortColumnIndex",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
StateTable,
SortColumnIndex,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"stateTable" | "state_table" => Ok(GeneratedField::StateTable),
"sortColumnIndex" | "sort_column_index" => Ok(GeneratedField::SortColumnIndex),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SortNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.SortNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SortNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut state_table__ = None;
let mut sort_column_index__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::StateTable => {
if state_table__.is_some() {
return Err(serde::de::Error::duplicate_field("stateTable"));
}
state_table__ = map_.next_value()?;
}
GeneratedField::SortColumnIndex => {
if sort_column_index__.is_some() {
return Err(serde::de::Error::duplicate_field("sortColumnIndex"));
}
sort_column_index__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(SortNode {
state_table: state_table__,
sort_column_index: sort_column_index__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.SortNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SourceBackfillNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.upstream_source_id != 0 {
len += 1;
}
if self.row_id_index.is_some() {
len += 1;
}
if !self.columns.is_empty() {
len += 1;
}
if self.info.is_some() {
len += 1;
}
if !self.source_name.is_empty() {
len += 1;
}
if !self.with_properties.is_empty() {
len += 1;
}
if self.rate_limit.is_some() {
len += 1;
}
if self.state_table.is_some() {
len += 1;
}
if !self.secret_refs.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.SourceBackfillNode", len)?;
if self.upstream_source_id != 0 {
struct_ser.serialize_field("upstreamSourceId", &self.upstream_source_id)?;
}
if let Some(v) = self.row_id_index.as_ref() {
struct_ser.serialize_field("rowIdIndex", v)?;
}
if !self.columns.is_empty() {
struct_ser.serialize_field("columns", &self.columns)?;
}
if let Some(v) = self.info.as_ref() {
struct_ser.serialize_field("info", v)?;
}
if !self.source_name.is_empty() {
struct_ser.serialize_field("sourceName", &self.source_name)?;
}
if !self.with_properties.is_empty() {
struct_ser.serialize_field("withProperties", &self.with_properties)?;
}
if let Some(v) = self.rate_limit.as_ref() {
struct_ser.serialize_field("rateLimit", v)?;
}
if let Some(v) = self.state_table.as_ref() {
struct_ser.serialize_field("stateTable", v)?;
}
if !self.secret_refs.is_empty() {
struct_ser.serialize_field("secretRefs", &self.secret_refs)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SourceBackfillNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"upstream_source_id",
"upstreamSourceId",
"row_id_index",
"rowIdIndex",
"columns",
"info",
"source_name",
"sourceName",
"with_properties",
"withProperties",
"rate_limit",
"rateLimit",
"state_table",
"stateTable",
"secret_refs",
"secretRefs",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
UpstreamSourceId,
RowIdIndex,
Columns,
Info,
SourceName,
WithProperties,
RateLimit,
StateTable,
SecretRefs,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"upstreamSourceId" | "upstream_source_id" => Ok(GeneratedField::UpstreamSourceId),
"rowIdIndex" | "row_id_index" => Ok(GeneratedField::RowIdIndex),
"columns" => Ok(GeneratedField::Columns),
"info" => Ok(GeneratedField::Info),
"sourceName" | "source_name" => Ok(GeneratedField::SourceName),
"withProperties" | "with_properties" => Ok(GeneratedField::WithProperties),
"rateLimit" | "rate_limit" => Ok(GeneratedField::RateLimit),
"stateTable" | "state_table" => Ok(GeneratedField::StateTable),
"secretRefs" | "secret_refs" => Ok(GeneratedField::SecretRefs),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SourceBackfillNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.SourceBackfillNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SourceBackfillNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut upstream_source_id__ = None;
let mut row_id_index__ = None;
let mut columns__ = None;
let mut info__ = None;
let mut source_name__ = None;
let mut with_properties__ = None;
let mut rate_limit__ = None;
let mut state_table__ = None;
let mut secret_refs__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::UpstreamSourceId => {
if upstream_source_id__.is_some() {
return Err(serde::de::Error::duplicate_field("upstreamSourceId"));
}
upstream_source_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::RowIdIndex => {
if row_id_index__.is_some() {
return Err(serde::de::Error::duplicate_field("rowIdIndex"));
}
row_id_index__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::Columns => {
if columns__.is_some() {
return Err(serde::de::Error::duplicate_field("columns"));
}
columns__ = Some(map_.next_value()?);
}
GeneratedField::Info => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("info"));
}
info__ = map_.next_value()?;
}
GeneratedField::SourceName => {
if source_name__.is_some() {
return Err(serde::de::Error::duplicate_field("sourceName"));
}
source_name__ = Some(map_.next_value()?);
}
GeneratedField::WithProperties => {
if with_properties__.is_some() {
return Err(serde::de::Error::duplicate_field("withProperties"));
}
with_properties__ = Some(
map_.next_value::<std::collections::BTreeMap<_, _>>()?
);
}
GeneratedField::RateLimit => {
if rate_limit__.is_some() {
return Err(serde::de::Error::duplicate_field("rateLimit"));
}
rate_limit__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::StateTable => {
if state_table__.is_some() {
return Err(serde::de::Error::duplicate_field("stateTable"));
}
state_table__ = map_.next_value()?;
}
GeneratedField::SecretRefs => {
if secret_refs__.is_some() {
return Err(serde::de::Error::duplicate_field("secretRefs"));
}
secret_refs__ = Some(
map_.next_value::<std::collections::BTreeMap<_, _>>()?
);
}
}
}
Ok(SourceBackfillNode {
upstream_source_id: upstream_source_id__.unwrap_or_default(),
row_id_index: row_id_index__,
columns: columns__.unwrap_or_default(),
info: info__,
source_name: source_name__.unwrap_or_default(),
with_properties: with_properties__.unwrap_or_default(),
rate_limit: rate_limit__,
state_table: state_table__,
secret_refs: secret_refs__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.SourceBackfillNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SourceChangeSplitMutation {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.actor_splits.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.SourceChangeSplitMutation", len)?;
if !self.actor_splits.is_empty() {
struct_ser.serialize_field("actorSplits", &self.actor_splits)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SourceChangeSplitMutation {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"actor_splits",
"actorSplits",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ActorSplits,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"actorSplits" | "actor_splits" => Ok(GeneratedField::ActorSplits),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SourceChangeSplitMutation;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.SourceChangeSplitMutation")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SourceChangeSplitMutation, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut actor_splits__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ActorSplits => {
if actor_splits__.is_some() {
return Err(serde::de::Error::duplicate_field("actorSplits"));
}
actor_splits__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
}
}
Ok(SourceChangeSplitMutation {
actor_splits: actor_splits__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.SourceChangeSplitMutation", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SourceNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.source_inner.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.SourceNode", len)?;
if let Some(v) = self.source_inner.as_ref() {
struct_ser.serialize_field("sourceInner", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SourceNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"source_inner",
"sourceInner",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SourceInner,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"sourceInner" | "source_inner" => Ok(GeneratedField::SourceInner),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SourceNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.SourceNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SourceNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut source_inner__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::SourceInner => {
if source_inner__.is_some() {
return Err(serde::de::Error::duplicate_field("sourceInner"));
}
source_inner__ = map_.next_value()?;
}
}
}
Ok(SourceNode {
source_inner: source_inner__,
})
}
}
deserializer.deserialize_struct("stream_plan.SourceNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for StopMutation {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.actors.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.StopMutation", len)?;
if !self.actors.is_empty() {
struct_ser.serialize_field("actors", &self.actors)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for StopMutation {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"actors",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Actors,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"actors" => Ok(GeneratedField::Actors),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = StopMutation;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.StopMutation")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<StopMutation, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut actors__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Actors => {
if actors__.is_some() {
return Err(serde::de::Error::duplicate_field("actors"));
}
actors__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(StopMutation {
actors: actors__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.StopMutation", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for StreamActor {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.actor_id != 0 {
len += 1;
}
if self.fragment_id != 0 {
len += 1;
}
if self.nodes.is_some() {
len += 1;
}
if !self.dispatcher.is_empty() {
len += 1;
}
if !self.upstream_actor_id.is_empty() {
len += 1;
}
if self.vnode_bitmap.is_some() {
len += 1;
}
if !self.mview_definition.is_empty() {
len += 1;
}
if self.expr_context.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.StreamActor", len)?;
if self.actor_id != 0 {
struct_ser.serialize_field("actorId", &self.actor_id)?;
}
if self.fragment_id != 0 {
struct_ser.serialize_field("fragmentId", &self.fragment_id)?;
}
if let Some(v) = self.nodes.as_ref() {
struct_ser.serialize_field("nodes", v)?;
}
if !self.dispatcher.is_empty() {
struct_ser.serialize_field("dispatcher", &self.dispatcher)?;
}
if !self.upstream_actor_id.is_empty() {
struct_ser.serialize_field("upstreamActorId", &self.upstream_actor_id)?;
}
if let Some(v) = self.vnode_bitmap.as_ref() {
struct_ser.serialize_field("vnodeBitmap", v)?;
}
if !self.mview_definition.is_empty() {
struct_ser.serialize_field("mviewDefinition", &self.mview_definition)?;
}
if let Some(v) = self.expr_context.as_ref() {
struct_ser.serialize_field("exprContext", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for StreamActor {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"actor_id",
"actorId",
"fragment_id",
"fragmentId",
"nodes",
"dispatcher",
"upstream_actor_id",
"upstreamActorId",
"vnode_bitmap",
"vnodeBitmap",
"mview_definition",
"mviewDefinition",
"expr_context",
"exprContext",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ActorId,
FragmentId,
Nodes,
Dispatcher,
UpstreamActorId,
VnodeBitmap,
MviewDefinition,
ExprContext,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"actorId" | "actor_id" => Ok(GeneratedField::ActorId),
"fragmentId" | "fragment_id" => Ok(GeneratedField::FragmentId),
"nodes" => Ok(GeneratedField::Nodes),
"dispatcher" => Ok(GeneratedField::Dispatcher),
"upstreamActorId" | "upstream_actor_id" => Ok(GeneratedField::UpstreamActorId),
"vnodeBitmap" | "vnode_bitmap" => Ok(GeneratedField::VnodeBitmap),
"mviewDefinition" | "mview_definition" => Ok(GeneratedField::MviewDefinition),
"exprContext" | "expr_context" => Ok(GeneratedField::ExprContext),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = StreamActor;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.StreamActor")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<StreamActor, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut actor_id__ = None;
let mut fragment_id__ = None;
let mut nodes__ = None;
let mut dispatcher__ = None;
let mut upstream_actor_id__ = None;
let mut vnode_bitmap__ = None;
let mut mview_definition__ = None;
let mut expr_context__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ActorId => {
if actor_id__.is_some() {
return Err(serde::de::Error::duplicate_field("actorId"));
}
actor_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::FragmentId => {
if fragment_id__.is_some() {
return Err(serde::de::Error::duplicate_field("fragmentId"));
}
fragment_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Nodes => {
if nodes__.is_some() {
return Err(serde::de::Error::duplicate_field("nodes"));
}
nodes__ = map_.next_value()?;
}
GeneratedField::Dispatcher => {
if dispatcher__.is_some() {
return Err(serde::de::Error::duplicate_field("dispatcher"));
}
dispatcher__ = Some(map_.next_value()?);
}
GeneratedField::UpstreamActorId => {
if upstream_actor_id__.is_some() {
return Err(serde::de::Error::duplicate_field("upstreamActorId"));
}
upstream_actor_id__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::VnodeBitmap => {
if vnode_bitmap__.is_some() {
return Err(serde::de::Error::duplicate_field("vnodeBitmap"));
}
vnode_bitmap__ = map_.next_value()?;
}
GeneratedField::MviewDefinition => {
if mview_definition__.is_some() {
return Err(serde::de::Error::duplicate_field("mviewDefinition"));
}
mview_definition__ = Some(map_.next_value()?);
}
GeneratedField::ExprContext => {
if expr_context__.is_some() {
return Err(serde::de::Error::duplicate_field("exprContext"));
}
expr_context__ = map_.next_value()?;
}
}
}
Ok(StreamActor {
actor_id: actor_id__.unwrap_or_default(),
fragment_id: fragment_id__.unwrap_or_default(),
nodes: nodes__,
dispatcher: dispatcher__.unwrap_or_default(),
upstream_actor_id: upstream_actor_id__.unwrap_or_default(),
vnode_bitmap: vnode_bitmap__,
mview_definition: mview_definition__.unwrap_or_default(),
expr_context: expr_context__,
})
}
}
deserializer.deserialize_struct("stream_plan.StreamActor", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for StreamCdcScanNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.table_id != 0 {
len += 1;
}
if !self.upstream_column_ids.is_empty() {
len += 1;
}
if !self.output_indices.is_empty() {
len += 1;
}
if self.state_table.is_some() {
len += 1;
}
if self.cdc_table_desc.is_some() {
len += 1;
}
if self.rate_limit.is_some() {
len += 1;
}
if self.disable_backfill {
len += 1;
}
if self.options.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.StreamCdcScanNode", len)?;
if self.table_id != 0 {
struct_ser.serialize_field("tableId", &self.table_id)?;
}
if !self.upstream_column_ids.is_empty() {
struct_ser.serialize_field("upstreamColumnIds", &self.upstream_column_ids)?;
}
if !self.output_indices.is_empty() {
struct_ser.serialize_field("outputIndices", &self.output_indices)?;
}
if let Some(v) = self.state_table.as_ref() {
struct_ser.serialize_field("stateTable", v)?;
}
if let Some(v) = self.cdc_table_desc.as_ref() {
struct_ser.serialize_field("cdcTableDesc", v)?;
}
if let Some(v) = self.rate_limit.as_ref() {
struct_ser.serialize_field("rateLimit", v)?;
}
if self.disable_backfill {
struct_ser.serialize_field("disableBackfill", &self.disable_backfill)?;
}
if let Some(v) = self.options.as_ref() {
struct_ser.serialize_field("options", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for StreamCdcScanNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table_id",
"tableId",
"upstream_column_ids",
"upstreamColumnIds",
"output_indices",
"outputIndices",
"state_table",
"stateTable",
"cdc_table_desc",
"cdcTableDesc",
"rate_limit",
"rateLimit",
"disable_backfill",
"disableBackfill",
"options",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableId,
UpstreamColumnIds,
OutputIndices,
StateTable,
CdcTableDesc,
RateLimit,
DisableBackfill,
Options,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"tableId" | "table_id" => Ok(GeneratedField::TableId),
"upstreamColumnIds" | "upstream_column_ids" => Ok(GeneratedField::UpstreamColumnIds),
"outputIndices" | "output_indices" => Ok(GeneratedField::OutputIndices),
"stateTable" | "state_table" => Ok(GeneratedField::StateTable),
"cdcTableDesc" | "cdc_table_desc" => Ok(GeneratedField::CdcTableDesc),
"rateLimit" | "rate_limit" => Ok(GeneratedField::RateLimit),
"disableBackfill" | "disable_backfill" => Ok(GeneratedField::DisableBackfill),
"options" => Ok(GeneratedField::Options),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = StreamCdcScanNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.StreamCdcScanNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<StreamCdcScanNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_id__ = None;
let mut upstream_column_ids__ = None;
let mut output_indices__ = None;
let mut state_table__ = None;
let mut cdc_table_desc__ = None;
let mut rate_limit__ = None;
let mut disable_backfill__ = None;
let mut options__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TableId => {
if table_id__.is_some() {
return Err(serde::de::Error::duplicate_field("tableId"));
}
table_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::UpstreamColumnIds => {
if upstream_column_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("upstreamColumnIds"));
}
upstream_column_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::OutputIndices => {
if output_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("outputIndices"));
}
output_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::StateTable => {
if state_table__.is_some() {
return Err(serde::de::Error::duplicate_field("stateTable"));
}
state_table__ = map_.next_value()?;
}
GeneratedField::CdcTableDesc => {
if cdc_table_desc__.is_some() {
return Err(serde::de::Error::duplicate_field("cdcTableDesc"));
}
cdc_table_desc__ = map_.next_value()?;
}
GeneratedField::RateLimit => {
if rate_limit__.is_some() {
return Err(serde::de::Error::duplicate_field("rateLimit"));
}
rate_limit__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::DisableBackfill => {
if disable_backfill__.is_some() {
return Err(serde::de::Error::duplicate_field("disableBackfill"));
}
disable_backfill__ = Some(map_.next_value()?);
}
GeneratedField::Options => {
if options__.is_some() {
return Err(serde::de::Error::duplicate_field("options"));
}
options__ = map_.next_value()?;
}
}
}
Ok(StreamCdcScanNode {
table_id: table_id__.unwrap_or_default(),
upstream_column_ids: upstream_column_ids__.unwrap_or_default(),
output_indices: output_indices__.unwrap_or_default(),
state_table: state_table__,
cdc_table_desc: cdc_table_desc__,
rate_limit: rate_limit__,
disable_backfill: disable_backfill__.unwrap_or_default(),
options: options__,
})
}
}
deserializer.deserialize_struct("stream_plan.StreamCdcScanNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for StreamCdcScanOptions {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.disable_backfill {
len += 1;
}
if self.snapshot_barrier_interval != 0 {
len += 1;
}
if self.snapshot_batch_size != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.StreamCdcScanOptions", len)?;
if self.disable_backfill {
struct_ser.serialize_field("disableBackfill", &self.disable_backfill)?;
}
if self.snapshot_barrier_interval != 0 {
struct_ser.serialize_field("snapshotBarrierInterval", &self.snapshot_barrier_interval)?;
}
if self.snapshot_batch_size != 0 {
struct_ser.serialize_field("snapshotBatchSize", &self.snapshot_batch_size)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for StreamCdcScanOptions {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"disable_backfill",
"disableBackfill",
"snapshot_barrier_interval",
"snapshotBarrierInterval",
"snapshot_batch_size",
"snapshotBatchSize",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
DisableBackfill,
SnapshotBarrierInterval,
SnapshotBatchSize,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"disableBackfill" | "disable_backfill" => Ok(GeneratedField::DisableBackfill),
"snapshotBarrierInterval" | "snapshot_barrier_interval" => Ok(GeneratedField::SnapshotBarrierInterval),
"snapshotBatchSize" | "snapshot_batch_size" => Ok(GeneratedField::SnapshotBatchSize),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = StreamCdcScanOptions;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.StreamCdcScanOptions")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<StreamCdcScanOptions, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut disable_backfill__ = None;
let mut snapshot_barrier_interval__ = None;
let mut snapshot_batch_size__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::DisableBackfill => {
if disable_backfill__.is_some() {
return Err(serde::de::Error::duplicate_field("disableBackfill"));
}
disable_backfill__ = Some(map_.next_value()?);
}
GeneratedField::SnapshotBarrierInterval => {
if snapshot_barrier_interval__.is_some() {
return Err(serde::de::Error::duplicate_field("snapshotBarrierInterval"));
}
snapshot_barrier_interval__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::SnapshotBatchSize => {
if snapshot_batch_size__.is_some() {
return Err(serde::de::Error::duplicate_field("snapshotBatchSize"));
}
snapshot_batch_size__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(StreamCdcScanOptions {
disable_backfill: disable_backfill__.unwrap_or_default(),
snapshot_barrier_interval: snapshot_barrier_interval__.unwrap_or_default(),
snapshot_batch_size: snapshot_batch_size__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.StreamCdcScanOptions", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for StreamContext {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.timezone.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.StreamContext", len)?;
if !self.timezone.is_empty() {
struct_ser.serialize_field("timezone", &self.timezone)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for StreamContext {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"timezone",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Timezone,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"timezone" => Ok(GeneratedField::Timezone),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = StreamContext;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.StreamContext")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<StreamContext, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut timezone__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Timezone => {
if timezone__.is_some() {
return Err(serde::de::Error::duplicate_field("timezone"));
}
timezone__ = Some(map_.next_value()?);
}
}
}
Ok(StreamContext {
timezone: timezone__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.StreamContext", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for StreamFragmentGraph {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.fragments.is_empty() {
len += 1;
}
if !self.edges.is_empty() {
len += 1;
}
if !self.dependent_table_ids.is_empty() {
len += 1;
}
if self.table_ids_cnt != 0 {
len += 1;
}
if self.ctx.is_some() {
len += 1;
}
if self.parallelism.is_some() {
len += 1;
}
if self.max_parallelism != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.StreamFragmentGraph", len)?;
if !self.fragments.is_empty() {
struct_ser.serialize_field("fragments", &self.fragments)?;
}
if !self.edges.is_empty() {
struct_ser.serialize_field("edges", &self.edges)?;
}
if !self.dependent_table_ids.is_empty() {
struct_ser.serialize_field("dependentTableIds", &self.dependent_table_ids)?;
}
if self.table_ids_cnt != 0 {
struct_ser.serialize_field("tableIdsCnt", &self.table_ids_cnt)?;
}
if let Some(v) = self.ctx.as_ref() {
struct_ser.serialize_field("ctx", v)?;
}
if let Some(v) = self.parallelism.as_ref() {
struct_ser.serialize_field("parallelism", v)?;
}
if self.max_parallelism != 0 {
struct_ser.serialize_field("maxParallelism", &self.max_parallelism)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for StreamFragmentGraph {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"fragments",
"edges",
"dependent_table_ids",
"dependentTableIds",
"table_ids_cnt",
"tableIdsCnt",
"ctx",
"parallelism",
"max_parallelism",
"maxParallelism",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Fragments,
Edges,
DependentTableIds,
TableIdsCnt,
Ctx,
Parallelism,
MaxParallelism,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"fragments" => Ok(GeneratedField::Fragments),
"edges" => Ok(GeneratedField::Edges),
"dependentTableIds" | "dependent_table_ids" => Ok(GeneratedField::DependentTableIds),
"tableIdsCnt" | "table_ids_cnt" => Ok(GeneratedField::TableIdsCnt),
"ctx" => Ok(GeneratedField::Ctx),
"parallelism" => Ok(GeneratedField::Parallelism),
"maxParallelism" | "max_parallelism" => Ok(GeneratedField::MaxParallelism),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = StreamFragmentGraph;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.StreamFragmentGraph")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<StreamFragmentGraph, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut fragments__ = None;
let mut edges__ = None;
let mut dependent_table_ids__ = None;
let mut table_ids_cnt__ = None;
let mut ctx__ = None;
let mut parallelism__ = None;
let mut max_parallelism__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Fragments => {
if fragments__.is_some() {
return Err(serde::de::Error::duplicate_field("fragments"));
}
fragments__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::Edges => {
if edges__.is_some() {
return Err(serde::de::Error::duplicate_field("edges"));
}
edges__ = Some(map_.next_value()?);
}
GeneratedField::DependentTableIds => {
if dependent_table_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("dependentTableIds"));
}
dependent_table_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::TableIdsCnt => {
if table_ids_cnt__.is_some() {
return Err(serde::de::Error::duplicate_field("tableIdsCnt"));
}
table_ids_cnt__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Ctx => {
if ctx__.is_some() {
return Err(serde::de::Error::duplicate_field("ctx"));
}
ctx__ = map_.next_value()?;
}
GeneratedField::Parallelism => {
if parallelism__.is_some() {
return Err(serde::de::Error::duplicate_field("parallelism"));
}
parallelism__ = map_.next_value()?;
}
GeneratedField::MaxParallelism => {
if max_parallelism__.is_some() {
return Err(serde::de::Error::duplicate_field("maxParallelism"));
}
max_parallelism__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(StreamFragmentGraph {
fragments: fragments__.unwrap_or_default(),
edges: edges__.unwrap_or_default(),
dependent_table_ids: dependent_table_ids__.unwrap_or_default(),
table_ids_cnt: table_ids_cnt__.unwrap_or_default(),
ctx: ctx__,
parallelism: parallelism__,
max_parallelism: max_parallelism__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.StreamFragmentGraph", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for stream_fragment_graph::Parallelism {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.parallelism != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.StreamFragmentGraph.Parallelism", len)?;
if self.parallelism != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("parallelism", ToString::to_string(&self.parallelism).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for stream_fragment_graph::Parallelism {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"parallelism",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Parallelism,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"parallelism" => Ok(GeneratedField::Parallelism),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = stream_fragment_graph::Parallelism;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.StreamFragmentGraph.Parallelism")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<stream_fragment_graph::Parallelism, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut parallelism__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Parallelism => {
if parallelism__.is_some() {
return Err(serde::de::Error::duplicate_field("parallelism"));
}
parallelism__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(stream_fragment_graph::Parallelism {
parallelism: parallelism__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.StreamFragmentGraph.Parallelism", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for stream_fragment_graph::StreamFragment {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.fragment_id != 0 {
len += 1;
}
if self.node.is_some() {
len += 1;
}
if self.fragment_type_mask != 0 {
len += 1;
}
if self.requires_singleton {
len += 1;
}
if self.table_ids_cnt != 0 {
len += 1;
}
if !self.upstream_table_ids.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.StreamFragmentGraph.StreamFragment", len)?;
if self.fragment_id != 0 {
struct_ser.serialize_field("fragmentId", &self.fragment_id)?;
}
if let Some(v) = self.node.as_ref() {
struct_ser.serialize_field("node", v)?;
}
if self.fragment_type_mask != 0 {
struct_ser.serialize_field("fragmentTypeMask", &self.fragment_type_mask)?;
}
if self.requires_singleton {
struct_ser.serialize_field("requiresSingleton", &self.requires_singleton)?;
}
if self.table_ids_cnt != 0 {
struct_ser.serialize_field("tableIdsCnt", &self.table_ids_cnt)?;
}
if !self.upstream_table_ids.is_empty() {
struct_ser.serialize_field("upstreamTableIds", &self.upstream_table_ids)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for stream_fragment_graph::StreamFragment {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"fragment_id",
"fragmentId",
"node",
"fragment_type_mask",
"fragmentTypeMask",
"requires_singleton",
"requiresSingleton",
"table_ids_cnt",
"tableIdsCnt",
"upstream_table_ids",
"upstreamTableIds",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
FragmentId,
Node,
FragmentTypeMask,
RequiresSingleton,
TableIdsCnt,
UpstreamTableIds,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"fragmentId" | "fragment_id" => Ok(GeneratedField::FragmentId),
"node" => Ok(GeneratedField::Node),
"fragmentTypeMask" | "fragment_type_mask" => Ok(GeneratedField::FragmentTypeMask),
"requiresSingleton" | "requires_singleton" => Ok(GeneratedField::RequiresSingleton),
"tableIdsCnt" | "table_ids_cnt" => Ok(GeneratedField::TableIdsCnt),
"upstreamTableIds" | "upstream_table_ids" => Ok(GeneratedField::UpstreamTableIds),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = stream_fragment_graph::StreamFragment;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.StreamFragmentGraph.StreamFragment")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<stream_fragment_graph::StreamFragment, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut fragment_id__ = None;
let mut node__ = None;
let mut fragment_type_mask__ = None;
let mut requires_singleton__ = None;
let mut table_ids_cnt__ = None;
let mut upstream_table_ids__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::FragmentId => {
if fragment_id__.is_some() {
return Err(serde::de::Error::duplicate_field("fragmentId"));
}
fragment_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Node => {
if node__.is_some() {
return Err(serde::de::Error::duplicate_field("node"));
}
node__ = map_.next_value()?;
}
GeneratedField::FragmentTypeMask => {
if fragment_type_mask__.is_some() {
return Err(serde::de::Error::duplicate_field("fragmentTypeMask"));
}
fragment_type_mask__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::RequiresSingleton => {
if requires_singleton__.is_some() {
return Err(serde::de::Error::duplicate_field("requiresSingleton"));
}
requires_singleton__ = Some(map_.next_value()?);
}
GeneratedField::TableIdsCnt => {
if table_ids_cnt__.is_some() {
return Err(serde::de::Error::duplicate_field("tableIdsCnt"));
}
table_ids_cnt__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::UpstreamTableIds => {
if upstream_table_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("upstreamTableIds"));
}
upstream_table_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(stream_fragment_graph::StreamFragment {
fragment_id: fragment_id__.unwrap_or_default(),
node: node__,
fragment_type_mask: fragment_type_mask__.unwrap_or_default(),
requires_singleton: requires_singleton__.unwrap_or_default(),
table_ids_cnt: table_ids_cnt__.unwrap_or_default(),
upstream_table_ids: upstream_table_ids__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.StreamFragmentGraph.StreamFragment", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for stream_fragment_graph::StreamFragmentEdge {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.dispatch_strategy.is_some() {
len += 1;
}
if self.link_id != 0 {
len += 1;
}
if self.upstream_id != 0 {
len += 1;
}
if self.downstream_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.StreamFragmentGraph.StreamFragmentEdge", len)?;
if let Some(v) = self.dispatch_strategy.as_ref() {
struct_ser.serialize_field("dispatchStrategy", v)?;
}
if self.link_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("linkId", ToString::to_string(&self.link_id).as_str())?;
}
if self.upstream_id != 0 {
struct_ser.serialize_field("upstreamId", &self.upstream_id)?;
}
if self.downstream_id != 0 {
struct_ser.serialize_field("downstreamId", &self.downstream_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for stream_fragment_graph::StreamFragmentEdge {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"dispatch_strategy",
"dispatchStrategy",
"link_id",
"linkId",
"upstream_id",
"upstreamId",
"downstream_id",
"downstreamId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
DispatchStrategy,
LinkId,
UpstreamId,
DownstreamId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"dispatchStrategy" | "dispatch_strategy" => Ok(GeneratedField::DispatchStrategy),
"linkId" | "link_id" => Ok(GeneratedField::LinkId),
"upstreamId" | "upstream_id" => Ok(GeneratedField::UpstreamId),
"downstreamId" | "downstream_id" => Ok(GeneratedField::DownstreamId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = stream_fragment_graph::StreamFragmentEdge;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.StreamFragmentGraph.StreamFragmentEdge")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<stream_fragment_graph::StreamFragmentEdge, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut dispatch_strategy__ = None;
let mut link_id__ = None;
let mut upstream_id__ = None;
let mut downstream_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::DispatchStrategy => {
if dispatch_strategy__.is_some() {
return Err(serde::de::Error::duplicate_field("dispatchStrategy"));
}
dispatch_strategy__ = map_.next_value()?;
}
GeneratedField::LinkId => {
if link_id__.is_some() {
return Err(serde::de::Error::duplicate_field("linkId"));
}
link_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::UpstreamId => {
if upstream_id__.is_some() {
return Err(serde::de::Error::duplicate_field("upstreamId"));
}
upstream_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::DownstreamId => {
if downstream_id__.is_some() {
return Err(serde::de::Error::duplicate_field("downstreamId"));
}
downstream_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(stream_fragment_graph::StreamFragmentEdge {
dispatch_strategy: dispatch_strategy__,
link_id: link_id__.unwrap_or_default(),
upstream_id: upstream_id__.unwrap_or_default(),
downstream_id: downstream_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.StreamFragmentGraph.StreamFragmentEdge", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for StreamFsFetch {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.source_id != 0 {
len += 1;
}
if self.state_table.is_some() {
len += 1;
}
if self.row_id_index.is_some() {
len += 1;
}
if !self.columns.is_empty() {
len += 1;
}
if !self.with_properties.is_empty() {
len += 1;
}
if self.info.is_some() {
len += 1;
}
if !self.source_name.is_empty() {
len += 1;
}
if self.rate_limit.is_some() {
len += 1;
}
if !self.secret_refs.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.StreamFsFetch", len)?;
if self.source_id != 0 {
struct_ser.serialize_field("sourceId", &self.source_id)?;
}
if let Some(v) = self.state_table.as_ref() {
struct_ser.serialize_field("stateTable", v)?;
}
if let Some(v) = self.row_id_index.as_ref() {
struct_ser.serialize_field("rowIdIndex", v)?;
}
if !self.columns.is_empty() {
struct_ser.serialize_field("columns", &self.columns)?;
}
if !self.with_properties.is_empty() {
struct_ser.serialize_field("withProperties", &self.with_properties)?;
}
if let Some(v) = self.info.as_ref() {
struct_ser.serialize_field("info", v)?;
}
if !self.source_name.is_empty() {
struct_ser.serialize_field("sourceName", &self.source_name)?;
}
if let Some(v) = self.rate_limit.as_ref() {
struct_ser.serialize_field("rateLimit", v)?;
}
if !self.secret_refs.is_empty() {
struct_ser.serialize_field("secretRefs", &self.secret_refs)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for StreamFsFetch {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"source_id",
"sourceId",
"state_table",
"stateTable",
"row_id_index",
"rowIdIndex",
"columns",
"with_properties",
"withProperties",
"info",
"source_name",
"sourceName",
"rate_limit",
"rateLimit",
"secret_refs",
"secretRefs",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SourceId,
StateTable,
RowIdIndex,
Columns,
WithProperties,
Info,
SourceName,
RateLimit,
SecretRefs,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"sourceId" | "source_id" => Ok(GeneratedField::SourceId),
"stateTable" | "state_table" => Ok(GeneratedField::StateTable),
"rowIdIndex" | "row_id_index" => Ok(GeneratedField::RowIdIndex),
"columns" => Ok(GeneratedField::Columns),
"withProperties" | "with_properties" => Ok(GeneratedField::WithProperties),
"info" => Ok(GeneratedField::Info),
"sourceName" | "source_name" => Ok(GeneratedField::SourceName),
"rateLimit" | "rate_limit" => Ok(GeneratedField::RateLimit),
"secretRefs" | "secret_refs" => Ok(GeneratedField::SecretRefs),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = StreamFsFetch;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.StreamFsFetch")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<StreamFsFetch, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut source_id__ = None;
let mut state_table__ = None;
let mut row_id_index__ = None;
let mut columns__ = None;
let mut with_properties__ = None;
let mut info__ = None;
let mut source_name__ = None;
let mut rate_limit__ = None;
let mut secret_refs__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::SourceId => {
if source_id__.is_some() {
return Err(serde::de::Error::duplicate_field("sourceId"));
}
source_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::StateTable => {
if state_table__.is_some() {
return Err(serde::de::Error::duplicate_field("stateTable"));
}
state_table__ = map_.next_value()?;
}
GeneratedField::RowIdIndex => {
if row_id_index__.is_some() {
return Err(serde::de::Error::duplicate_field("rowIdIndex"));
}
row_id_index__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::Columns => {
if columns__.is_some() {
return Err(serde::de::Error::duplicate_field("columns"));
}
columns__ = Some(map_.next_value()?);
}
GeneratedField::WithProperties => {
if with_properties__.is_some() {
return Err(serde::de::Error::duplicate_field("withProperties"));
}
with_properties__ = Some(
map_.next_value::<std::collections::BTreeMap<_, _>>()?
);
}
GeneratedField::Info => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("info"));
}
info__ = map_.next_value()?;
}
GeneratedField::SourceName => {
if source_name__.is_some() {
return Err(serde::de::Error::duplicate_field("sourceName"));
}
source_name__ = Some(map_.next_value()?);
}
GeneratedField::RateLimit => {
if rate_limit__.is_some() {
return Err(serde::de::Error::duplicate_field("rateLimit"));
}
rate_limit__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::SecretRefs => {
if secret_refs__.is_some() {
return Err(serde::de::Error::duplicate_field("secretRefs"));
}
secret_refs__ = Some(
map_.next_value::<std::collections::BTreeMap<_, _>>()?
);
}
}
}
Ok(StreamFsFetch {
source_id: source_id__.unwrap_or_default(),
state_table: state_table__,
row_id_index: row_id_index__,
columns: columns__.unwrap_or_default(),
with_properties: with_properties__.unwrap_or_default(),
info: info__,
source_name: source_name__.unwrap_or_default(),
rate_limit: rate_limit__,
secret_refs: secret_refs__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.StreamFsFetch", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for StreamFsFetchNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.node_inner.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.StreamFsFetchNode", len)?;
if let Some(v) = self.node_inner.as_ref() {
struct_ser.serialize_field("nodeInner", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for StreamFsFetchNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"node_inner",
"nodeInner",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
NodeInner,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"nodeInner" | "node_inner" => Ok(GeneratedField::NodeInner),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = StreamFsFetchNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.StreamFsFetchNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<StreamFsFetchNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut node_inner__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::NodeInner => {
if node_inner__.is_some() {
return Err(serde::de::Error::duplicate_field("nodeInner"));
}
node_inner__ = map_.next_value()?;
}
}
}
Ok(StreamFsFetchNode {
node_inner: node_inner__,
})
}
}
deserializer.deserialize_struct("stream_plan.StreamFsFetchNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for StreamMessage {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.stream_message.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.StreamMessage", len)?;
if let Some(v) = self.stream_message.as_ref() {
match v {
stream_message::StreamMessage::StreamChunk(v) => {
struct_ser.serialize_field("streamChunk", v)?;
}
stream_message::StreamMessage::Barrier(v) => {
struct_ser.serialize_field("barrier", v)?;
}
stream_message::StreamMessage::Watermark(v) => {
struct_ser.serialize_field("watermark", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for StreamMessage {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"stream_chunk",
"streamChunk",
"barrier",
"watermark",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
StreamChunk,
Barrier,
Watermark,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"streamChunk" | "stream_chunk" => Ok(GeneratedField::StreamChunk),
"barrier" => Ok(GeneratedField::Barrier),
"watermark" => Ok(GeneratedField::Watermark),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = StreamMessage;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.StreamMessage")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<StreamMessage, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut stream_message__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::StreamChunk => {
if stream_message__.is_some() {
return Err(serde::de::Error::duplicate_field("streamChunk"));
}
stream_message__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_message::StreamMessage::StreamChunk)
;
}
GeneratedField::Barrier => {
if stream_message__.is_some() {
return Err(serde::de::Error::duplicate_field("barrier"));
}
stream_message__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_message::StreamMessage::Barrier)
;
}
GeneratedField::Watermark => {
if stream_message__.is_some() {
return Err(serde::de::Error::duplicate_field("watermark"));
}
stream_message__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_message::StreamMessage::Watermark)
;
}
}
}
Ok(StreamMessage {
stream_message: stream_message__,
})
}
}
deserializer.deserialize_struct("stream_plan.StreamMessage", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for StreamNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.operator_id != 0 {
len += 1;
}
if !self.input.is_empty() {
len += 1;
}
if !self.stream_key.is_empty() {
len += 1;
}
if self.append_only {
len += 1;
}
if !self.identity.is_empty() {
len += 1;
}
if !self.fields.is_empty() {
len += 1;
}
if self.node_body.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.StreamNode", len)?;
if self.operator_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("operatorId", ToString::to_string(&self.operator_id).as_str())?;
}
if !self.input.is_empty() {
struct_ser.serialize_field("input", &self.input)?;
}
if !self.stream_key.is_empty() {
struct_ser.serialize_field("streamKey", &self.stream_key)?;
}
if self.append_only {
struct_ser.serialize_field("appendOnly", &self.append_only)?;
}
if !self.identity.is_empty() {
struct_ser.serialize_field("identity", &self.identity)?;
}
if !self.fields.is_empty() {
struct_ser.serialize_field("fields", &self.fields)?;
}
if let Some(v) = self.node_body.as_ref() {
match v {
stream_node::NodeBody::Source(v) => {
struct_ser.serialize_field("source", v)?;
}
stream_node::NodeBody::Project(v) => {
struct_ser.serialize_field("project", v)?;
}
stream_node::NodeBody::Filter(v) => {
struct_ser.serialize_field("filter", v)?;
}
stream_node::NodeBody::Materialize(v) => {
struct_ser.serialize_field("materialize", v)?;
}
stream_node::NodeBody::StatelessSimpleAgg(v) => {
struct_ser.serialize_field("statelessSimpleAgg", v)?;
}
stream_node::NodeBody::SimpleAgg(v) => {
struct_ser.serialize_field("simpleAgg", v)?;
}
stream_node::NodeBody::HashAgg(v) => {
struct_ser.serialize_field("hashAgg", v)?;
}
stream_node::NodeBody::AppendOnlyTopN(v) => {
struct_ser.serialize_field("appendOnlyTopN", v)?;
}
stream_node::NodeBody::HashJoin(v) => {
struct_ser.serialize_field("hashJoin", v)?;
}
stream_node::NodeBody::TopN(v) => {
struct_ser.serialize_field("topN", v)?;
}
stream_node::NodeBody::HopWindow(v) => {
struct_ser.serialize_field("hopWindow", v)?;
}
stream_node::NodeBody::Merge(v) => {
struct_ser.serialize_field("merge", v)?;
}
stream_node::NodeBody::Exchange(v) => {
struct_ser.serialize_field("exchange", v)?;
}
stream_node::NodeBody::StreamScan(v) => {
struct_ser.serialize_field("streamScan", v)?;
}
stream_node::NodeBody::BatchPlan(v) => {
struct_ser.serialize_field("batchPlan", v)?;
}
stream_node::NodeBody::Lookup(v) => {
struct_ser.serialize_field("lookup", v)?;
}
stream_node::NodeBody::Arrange(v) => {
struct_ser.serialize_field("arrange", v)?;
}
stream_node::NodeBody::LookupUnion(v) => {
struct_ser.serialize_field("lookupUnion", v)?;
}
stream_node::NodeBody::Union(v) => {
struct_ser.serialize_field("union", v)?;
}
stream_node::NodeBody::DeltaIndexJoin(v) => {
struct_ser.serialize_field("deltaIndexJoin", v)?;
}
stream_node::NodeBody::Sink(v) => {
struct_ser.serialize_field("sink", v)?;
}
stream_node::NodeBody::Expand(v) => {
struct_ser.serialize_field("expand", v)?;
}
stream_node::NodeBody::DynamicFilter(v) => {
struct_ser.serialize_field("dynamicFilter", v)?;
}
stream_node::NodeBody::ProjectSet(v) => {
struct_ser.serialize_field("projectSet", v)?;
}
stream_node::NodeBody::GroupTopN(v) => {
struct_ser.serialize_field("groupTopN", v)?;
}
stream_node::NodeBody::Sort(v) => {
struct_ser.serialize_field("sort", v)?;
}
stream_node::NodeBody::WatermarkFilter(v) => {
struct_ser.serialize_field("watermarkFilter", v)?;
}
stream_node::NodeBody::Dml(v) => {
struct_ser.serialize_field("dml", v)?;
}
stream_node::NodeBody::RowIdGen(v) => {
struct_ser.serialize_field("rowIdGen", v)?;
}
stream_node::NodeBody::Now(v) => {
struct_ser.serialize_field("now", v)?;
}
stream_node::NodeBody::AppendOnlyGroupTopN(v) => {
struct_ser.serialize_field("appendOnlyGroupTopN", v)?;
}
stream_node::NodeBody::TemporalJoin(v) => {
struct_ser.serialize_field("temporalJoin", v)?;
}
stream_node::NodeBody::BarrierRecv(v) => {
struct_ser.serialize_field("barrierRecv", v)?;
}
stream_node::NodeBody::Values(v) => {
struct_ser.serialize_field("values", v)?;
}
stream_node::NodeBody::AppendOnlyDedup(v) => {
struct_ser.serialize_field("appendOnlyDedup", v)?;
}
stream_node::NodeBody::NoOp(v) => {
struct_ser.serialize_field("noOp", v)?;
}
stream_node::NodeBody::EowcOverWindow(v) => {
struct_ser.serialize_field("eowcOverWindow", v)?;
}
stream_node::NodeBody::OverWindow(v) => {
struct_ser.serialize_field("overWindow", v)?;
}
stream_node::NodeBody::StreamFsFetch(v) => {
struct_ser.serialize_field("streamFsFetch", v)?;
}
stream_node::NodeBody::StreamCdcScan(v) => {
struct_ser.serialize_field("streamCdcScan", v)?;
}
stream_node::NodeBody::CdcFilter(v) => {
struct_ser.serialize_field("cdcFilter", v)?;
}
stream_node::NodeBody::SourceBackfill(v) => {
struct_ser.serialize_field("sourceBackfill", v)?;
}
stream_node::NodeBody::Changelog(v) => {
struct_ser.serialize_field("changelog", v)?;
}
stream_node::NodeBody::LocalApproxPercentile(v) => {
struct_ser.serialize_field("localApproxPercentile", v)?;
}
stream_node::NodeBody::GlobalApproxPercentile(v) => {
struct_ser.serialize_field("globalApproxPercentile", v)?;
}
stream_node::NodeBody::RowMerge(v) => {
struct_ser.serialize_field("rowMerge", v)?;
}
stream_node::NodeBody::AsOfJoin(v) => {
struct_ser.serialize_field("asOfJoin", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for StreamNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"operator_id",
"operatorId",
"input",
"stream_key",
"streamKey",
"append_only",
"appendOnly",
"identity",
"fields",
"source",
"project",
"filter",
"materialize",
"stateless_simple_agg",
"statelessSimpleAgg",
"simple_agg",
"simpleAgg",
"hash_agg",
"hashAgg",
"append_only_top_n",
"appendOnlyTopN",
"hash_join",
"hashJoin",
"top_n",
"topN",
"hop_window",
"hopWindow",
"merge",
"exchange",
"stream_scan",
"streamScan",
"batch_plan",
"batchPlan",
"lookup",
"arrange",
"lookup_union",
"lookupUnion",
"union",
"delta_index_join",
"deltaIndexJoin",
"sink",
"expand",
"dynamic_filter",
"dynamicFilter",
"project_set",
"projectSet",
"group_top_n",
"groupTopN",
"sort",
"watermark_filter",
"watermarkFilter",
"dml",
"row_id_gen",
"rowIdGen",
"now",
"append_only_group_top_n",
"appendOnlyGroupTopN",
"temporal_join",
"temporalJoin",
"barrier_recv",
"barrierRecv",
"values",
"append_only_dedup",
"appendOnlyDedup",
"no_op",
"noOp",
"eowc_over_window",
"eowcOverWindow",
"over_window",
"overWindow",
"stream_fs_fetch",
"streamFsFetch",
"stream_cdc_scan",
"streamCdcScan",
"cdc_filter",
"cdcFilter",
"source_backfill",
"sourceBackfill",
"changelog",
"local_approx_percentile",
"localApproxPercentile",
"global_approx_percentile",
"globalApproxPercentile",
"row_merge",
"rowMerge",
"as_of_join",
"asOfJoin",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
OperatorId,
Input,
StreamKey,
AppendOnly,
Identity,
Fields,
Source,
Project,
Filter,
Materialize,
StatelessSimpleAgg,
SimpleAgg,
HashAgg,
AppendOnlyTopN,
HashJoin,
TopN,
HopWindow,
Merge,
Exchange,
StreamScan,
BatchPlan,
Lookup,
Arrange,
LookupUnion,
Union,
DeltaIndexJoin,
Sink,
Expand,
DynamicFilter,
ProjectSet,
GroupTopN,
Sort,
WatermarkFilter,
Dml,
RowIdGen,
Now,
AppendOnlyGroupTopN,
TemporalJoin,
BarrierRecv,
Values,
AppendOnlyDedup,
NoOp,
EowcOverWindow,
OverWindow,
StreamFsFetch,
StreamCdcScan,
CdcFilter,
SourceBackfill,
Changelog,
LocalApproxPercentile,
GlobalApproxPercentile,
RowMerge,
AsOfJoin,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"operatorId" | "operator_id" => Ok(GeneratedField::OperatorId),
"input" => Ok(GeneratedField::Input),
"streamKey" | "stream_key" => Ok(GeneratedField::StreamKey),
"appendOnly" | "append_only" => Ok(GeneratedField::AppendOnly),
"identity" => Ok(GeneratedField::Identity),
"fields" => Ok(GeneratedField::Fields),
"source" => Ok(GeneratedField::Source),
"project" => Ok(GeneratedField::Project),
"filter" => Ok(GeneratedField::Filter),
"materialize" => Ok(GeneratedField::Materialize),
"statelessSimpleAgg" | "stateless_simple_agg" => Ok(GeneratedField::StatelessSimpleAgg),
"simpleAgg" | "simple_agg" => Ok(GeneratedField::SimpleAgg),
"hashAgg" | "hash_agg" => Ok(GeneratedField::HashAgg),
"appendOnlyTopN" | "append_only_top_n" => Ok(GeneratedField::AppendOnlyTopN),
"hashJoin" | "hash_join" => Ok(GeneratedField::HashJoin),
"topN" | "top_n" => Ok(GeneratedField::TopN),
"hopWindow" | "hop_window" => Ok(GeneratedField::HopWindow),
"merge" => Ok(GeneratedField::Merge),
"exchange" => Ok(GeneratedField::Exchange),
"streamScan" | "stream_scan" => Ok(GeneratedField::StreamScan),
"batchPlan" | "batch_plan" => Ok(GeneratedField::BatchPlan),
"lookup" => Ok(GeneratedField::Lookup),
"arrange" => Ok(GeneratedField::Arrange),
"lookupUnion" | "lookup_union" => Ok(GeneratedField::LookupUnion),
"union" => Ok(GeneratedField::Union),
"deltaIndexJoin" | "delta_index_join" => Ok(GeneratedField::DeltaIndexJoin),
"sink" => Ok(GeneratedField::Sink),
"expand" => Ok(GeneratedField::Expand),
"dynamicFilter" | "dynamic_filter" => Ok(GeneratedField::DynamicFilter),
"projectSet" | "project_set" => Ok(GeneratedField::ProjectSet),
"groupTopN" | "group_top_n" => Ok(GeneratedField::GroupTopN),
"sort" => Ok(GeneratedField::Sort),
"watermarkFilter" | "watermark_filter" => Ok(GeneratedField::WatermarkFilter),
"dml" => Ok(GeneratedField::Dml),
"rowIdGen" | "row_id_gen" => Ok(GeneratedField::RowIdGen),
"now" => Ok(GeneratedField::Now),
"appendOnlyGroupTopN" | "append_only_group_top_n" => Ok(GeneratedField::AppendOnlyGroupTopN),
"temporalJoin" | "temporal_join" => Ok(GeneratedField::TemporalJoin),
"barrierRecv" | "barrier_recv" => Ok(GeneratedField::BarrierRecv),
"values" => Ok(GeneratedField::Values),
"appendOnlyDedup" | "append_only_dedup" => Ok(GeneratedField::AppendOnlyDedup),
"noOp" | "no_op" => Ok(GeneratedField::NoOp),
"eowcOverWindow" | "eowc_over_window" => Ok(GeneratedField::EowcOverWindow),
"overWindow" | "over_window" => Ok(GeneratedField::OverWindow),
"streamFsFetch" | "stream_fs_fetch" => Ok(GeneratedField::StreamFsFetch),
"streamCdcScan" | "stream_cdc_scan" => Ok(GeneratedField::StreamCdcScan),
"cdcFilter" | "cdc_filter" => Ok(GeneratedField::CdcFilter),
"sourceBackfill" | "source_backfill" => Ok(GeneratedField::SourceBackfill),
"changelog" => Ok(GeneratedField::Changelog),
"localApproxPercentile" | "local_approx_percentile" => Ok(GeneratedField::LocalApproxPercentile),
"globalApproxPercentile" | "global_approx_percentile" => Ok(GeneratedField::GlobalApproxPercentile),
"rowMerge" | "row_merge" => Ok(GeneratedField::RowMerge),
"asOfJoin" | "as_of_join" => Ok(GeneratedField::AsOfJoin),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = StreamNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.StreamNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<StreamNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut operator_id__ = None;
let mut input__ = None;
let mut stream_key__ = None;
let mut append_only__ = None;
let mut identity__ = None;
let mut fields__ = None;
let mut node_body__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::OperatorId => {
if operator_id__.is_some() {
return Err(serde::de::Error::duplicate_field("operatorId"));
}
operator_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Input => {
if input__.is_some() {
return Err(serde::de::Error::duplicate_field("input"));
}
input__ = Some(map_.next_value()?);
}
GeneratedField::StreamKey => {
if stream_key__.is_some() {
return Err(serde::de::Error::duplicate_field("streamKey"));
}
stream_key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::AppendOnly => {
if append_only__.is_some() {
return Err(serde::de::Error::duplicate_field("appendOnly"));
}
append_only__ = Some(map_.next_value()?);
}
GeneratedField::Identity => {
if identity__.is_some() {
return Err(serde::de::Error::duplicate_field("identity"));
}
identity__ = Some(map_.next_value()?);
}
GeneratedField::Fields => {
if fields__.is_some() {
return Err(serde::de::Error::duplicate_field("fields"));
}
fields__ = Some(map_.next_value()?);
}
GeneratedField::Source => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("source"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::Source)
;
}
GeneratedField::Project => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("project"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::Project)
;
}
GeneratedField::Filter => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("filter"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::Filter)
;
}
GeneratedField::Materialize => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("materialize"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::Materialize)
;
}
GeneratedField::StatelessSimpleAgg => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("statelessSimpleAgg"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::StatelessSimpleAgg)
;
}
GeneratedField::SimpleAgg => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("simpleAgg"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::SimpleAgg)
;
}
GeneratedField::HashAgg => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("hashAgg"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::HashAgg)
;
}
GeneratedField::AppendOnlyTopN => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("appendOnlyTopN"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::AppendOnlyTopN)
;
}
GeneratedField::HashJoin => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("hashJoin"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::HashJoin)
;
}
GeneratedField::TopN => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("topN"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::TopN)
;
}
GeneratedField::HopWindow => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("hopWindow"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::HopWindow)
;
}
GeneratedField::Merge => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("merge"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::Merge)
;
}
GeneratedField::Exchange => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("exchange"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::Exchange)
;
}
GeneratedField::StreamScan => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("streamScan"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::StreamScan)
;
}
GeneratedField::BatchPlan => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("batchPlan"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::BatchPlan)
;
}
GeneratedField::Lookup => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("lookup"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::Lookup)
;
}
GeneratedField::Arrange => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("arrange"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::Arrange)
;
}
GeneratedField::LookupUnion => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("lookupUnion"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::LookupUnion)
;
}
GeneratedField::Union => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("union"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::Union)
;
}
GeneratedField::DeltaIndexJoin => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("deltaIndexJoin"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::DeltaIndexJoin)
;
}
GeneratedField::Sink => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("sink"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::Sink)
;
}
GeneratedField::Expand => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("expand"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::Expand)
;
}
GeneratedField::DynamicFilter => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("dynamicFilter"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::DynamicFilter)
;
}
GeneratedField::ProjectSet => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("projectSet"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::ProjectSet)
;
}
GeneratedField::GroupTopN => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("groupTopN"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::GroupTopN)
;
}
GeneratedField::Sort => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("sort"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::Sort)
;
}
GeneratedField::WatermarkFilter => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("watermarkFilter"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::WatermarkFilter)
;
}
GeneratedField::Dml => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("dml"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::Dml)
;
}
GeneratedField::RowIdGen => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("rowIdGen"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::RowIdGen)
;
}
GeneratedField::Now => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("now"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::Now)
;
}
GeneratedField::AppendOnlyGroupTopN => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("appendOnlyGroupTopN"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::AppendOnlyGroupTopN)
;
}
GeneratedField::TemporalJoin => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("temporalJoin"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::TemporalJoin)
;
}
GeneratedField::BarrierRecv => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("barrierRecv"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::BarrierRecv)
;
}
GeneratedField::Values => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("values"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::Values)
;
}
GeneratedField::AppendOnlyDedup => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("appendOnlyDedup"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::AppendOnlyDedup)
;
}
GeneratedField::NoOp => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("noOp"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::NoOp)
;
}
GeneratedField::EowcOverWindow => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("eowcOverWindow"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::EowcOverWindow)
;
}
GeneratedField::OverWindow => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("overWindow"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::OverWindow)
;
}
GeneratedField::StreamFsFetch => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("streamFsFetch"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::StreamFsFetch)
;
}
GeneratedField::StreamCdcScan => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("streamCdcScan"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::StreamCdcScan)
;
}
GeneratedField::CdcFilter => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("cdcFilter"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::CdcFilter)
;
}
GeneratedField::SourceBackfill => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("sourceBackfill"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::SourceBackfill)
;
}
GeneratedField::Changelog => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("changelog"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::Changelog)
;
}
GeneratedField::LocalApproxPercentile => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("localApproxPercentile"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::LocalApproxPercentile)
;
}
GeneratedField::GlobalApproxPercentile => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("globalApproxPercentile"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::GlobalApproxPercentile)
;
}
GeneratedField::RowMerge => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("rowMerge"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::RowMerge)
;
}
GeneratedField::AsOfJoin => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("asOfJoin"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(stream_node::NodeBody::AsOfJoin)
;
}
}
}
Ok(StreamNode {
operator_id: operator_id__.unwrap_or_default(),
input: input__.unwrap_or_default(),
stream_key: stream_key__.unwrap_or_default(),
append_only: append_only__.unwrap_or_default(),
identity: identity__.unwrap_or_default(),
fields: fields__.unwrap_or_default(),
node_body: node_body__,
})
}
}
deserializer.deserialize_struct("stream_plan.StreamNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for StreamScanNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.table_id != 0 {
len += 1;
}
if !self.upstream_column_ids.is_empty() {
len += 1;
}
if !self.output_indices.is_empty() {
len += 1;
}
if self.stream_scan_type != 0 {
len += 1;
}
if self.state_table.is_some() {
len += 1;
}
if self.table_desc.is_some() {
len += 1;
}
if self.rate_limit.is_some() {
len += 1;
}
if self.snapshot_read_barrier_interval != 0 {
len += 1;
}
if self.arrangement_table.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.StreamScanNode", len)?;
if self.table_id != 0 {
struct_ser.serialize_field("tableId", &self.table_id)?;
}
if !self.upstream_column_ids.is_empty() {
struct_ser.serialize_field("upstreamColumnIds", &self.upstream_column_ids)?;
}
if !self.output_indices.is_empty() {
struct_ser.serialize_field("outputIndices", &self.output_indices)?;
}
if self.stream_scan_type != 0 {
let v = StreamScanType::try_from(self.stream_scan_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.stream_scan_type)))?;
struct_ser.serialize_field("streamScanType", &v)?;
}
if let Some(v) = self.state_table.as_ref() {
struct_ser.serialize_field("stateTable", v)?;
}
if let Some(v) = self.table_desc.as_ref() {
struct_ser.serialize_field("tableDesc", v)?;
}
if let Some(v) = self.rate_limit.as_ref() {
struct_ser.serialize_field("rateLimit", v)?;
}
if self.snapshot_read_barrier_interval != 0 {
struct_ser.serialize_field("snapshotReadBarrierInterval", &self.snapshot_read_barrier_interval)?;
}
if let Some(v) = self.arrangement_table.as_ref() {
struct_ser.serialize_field("arrangementTable", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for StreamScanNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table_id",
"tableId",
"upstream_column_ids",
"upstreamColumnIds",
"output_indices",
"outputIndices",
"stream_scan_type",
"streamScanType",
"state_table",
"stateTable",
"table_desc",
"tableDesc",
"rate_limit",
"rateLimit",
"snapshot_read_barrier_interval",
"snapshotReadBarrierInterval",
"arrangement_table",
"arrangementTable",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableId,
UpstreamColumnIds,
OutputIndices,
StreamScanType,
StateTable,
TableDesc,
RateLimit,
SnapshotReadBarrierInterval,
ArrangementTable,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"tableId" | "table_id" => Ok(GeneratedField::TableId),
"upstreamColumnIds" | "upstream_column_ids" => Ok(GeneratedField::UpstreamColumnIds),
"outputIndices" | "output_indices" => Ok(GeneratedField::OutputIndices),
"streamScanType" | "stream_scan_type" => Ok(GeneratedField::StreamScanType),
"stateTable" | "state_table" => Ok(GeneratedField::StateTable),
"tableDesc" | "table_desc" => Ok(GeneratedField::TableDesc),
"rateLimit" | "rate_limit" => Ok(GeneratedField::RateLimit),
"snapshotReadBarrierInterval" | "snapshot_read_barrier_interval" => Ok(GeneratedField::SnapshotReadBarrierInterval),
"arrangementTable" | "arrangement_table" => Ok(GeneratedField::ArrangementTable),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = StreamScanNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.StreamScanNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<StreamScanNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_id__ = None;
let mut upstream_column_ids__ = None;
let mut output_indices__ = None;
let mut stream_scan_type__ = None;
let mut state_table__ = None;
let mut table_desc__ = None;
let mut rate_limit__ = None;
let mut snapshot_read_barrier_interval__ = None;
let mut arrangement_table__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TableId => {
if table_id__.is_some() {
return Err(serde::de::Error::duplicate_field("tableId"));
}
table_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::UpstreamColumnIds => {
if upstream_column_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("upstreamColumnIds"));
}
upstream_column_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::OutputIndices => {
if output_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("outputIndices"));
}
output_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::StreamScanType => {
if stream_scan_type__.is_some() {
return Err(serde::de::Error::duplicate_field("streamScanType"));
}
stream_scan_type__ = Some(map_.next_value::<StreamScanType>()? as i32);
}
GeneratedField::StateTable => {
if state_table__.is_some() {
return Err(serde::de::Error::duplicate_field("stateTable"));
}
state_table__ = map_.next_value()?;
}
GeneratedField::TableDesc => {
if table_desc__.is_some() {
return Err(serde::de::Error::duplicate_field("tableDesc"));
}
table_desc__ = map_.next_value()?;
}
GeneratedField::RateLimit => {
if rate_limit__.is_some() {
return Err(serde::de::Error::duplicate_field("rateLimit"));
}
rate_limit__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::SnapshotReadBarrierInterval => {
if snapshot_read_barrier_interval__.is_some() {
return Err(serde::de::Error::duplicate_field("snapshotReadBarrierInterval"));
}
snapshot_read_barrier_interval__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::ArrangementTable => {
if arrangement_table__.is_some() {
return Err(serde::de::Error::duplicate_field("arrangementTable"));
}
arrangement_table__ = map_.next_value()?;
}
}
}
Ok(StreamScanNode {
table_id: table_id__.unwrap_or_default(),
upstream_column_ids: upstream_column_ids__.unwrap_or_default(),
output_indices: output_indices__.unwrap_or_default(),
stream_scan_type: stream_scan_type__.unwrap_or_default(),
state_table: state_table__,
table_desc: table_desc__,
rate_limit: rate_limit__,
snapshot_read_barrier_interval: snapshot_read_barrier_interval__.unwrap_or_default(),
arrangement_table: arrangement_table__,
})
}
}
deserializer.deserialize_struct("stream_plan.StreamScanNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for StreamScanType {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
let variant = match self {
Self::Unspecified => "STREAM_SCAN_TYPE_UNSPECIFIED",
Self::Chain => "STREAM_SCAN_TYPE_CHAIN",
Self::Rearrange => "STREAM_SCAN_TYPE_REARRANGE",
Self::Backfill => "STREAM_SCAN_TYPE_BACKFILL",
Self::UpstreamOnly => "STREAM_SCAN_TYPE_UPSTREAM_ONLY",
Self::ArrangementBackfill => "STREAM_SCAN_TYPE_ARRANGEMENT_BACKFILL",
Self::SnapshotBackfill => "STREAM_SCAN_TYPE_SNAPSHOT_BACKFILL",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for StreamScanType {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"STREAM_SCAN_TYPE_UNSPECIFIED",
"STREAM_SCAN_TYPE_CHAIN",
"STREAM_SCAN_TYPE_REARRANGE",
"STREAM_SCAN_TYPE_BACKFILL",
"STREAM_SCAN_TYPE_UPSTREAM_ONLY",
"STREAM_SCAN_TYPE_ARRANGEMENT_BACKFILL",
"STREAM_SCAN_TYPE_SNAPSHOT_BACKFILL",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = StreamScanType;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
})
}
fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
})
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
match value {
"STREAM_SCAN_TYPE_UNSPECIFIED" => Ok(StreamScanType::Unspecified),
"STREAM_SCAN_TYPE_CHAIN" => Ok(StreamScanType::Chain),
"STREAM_SCAN_TYPE_REARRANGE" => Ok(StreamScanType::Rearrange),
"STREAM_SCAN_TYPE_BACKFILL" => Ok(StreamScanType::Backfill),
"STREAM_SCAN_TYPE_UPSTREAM_ONLY" => Ok(StreamScanType::UpstreamOnly),
"STREAM_SCAN_TYPE_ARRANGEMENT_BACKFILL" => Ok(StreamScanType::ArrangementBackfill),
"STREAM_SCAN_TYPE_SNAPSHOT_BACKFILL" => Ok(StreamScanType::SnapshotBackfill),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for StreamSource {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.source_id != 0 {
len += 1;
}
if self.state_table.is_some() {
len += 1;
}
if self.row_id_index.is_some() {
len += 1;
}
if !self.columns.is_empty() {
len += 1;
}
if !self.with_properties.is_empty() {
len += 1;
}
if self.info.is_some() {
len += 1;
}
if !self.source_name.is_empty() {
len += 1;
}
if self.rate_limit.is_some() {
len += 1;
}
if !self.secret_refs.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.StreamSource", len)?;
if self.source_id != 0 {
struct_ser.serialize_field("sourceId", &self.source_id)?;
}
if let Some(v) = self.state_table.as_ref() {
struct_ser.serialize_field("stateTable", v)?;
}
if let Some(v) = self.row_id_index.as_ref() {
struct_ser.serialize_field("rowIdIndex", v)?;
}
if !self.columns.is_empty() {
struct_ser.serialize_field("columns", &self.columns)?;
}
if !self.with_properties.is_empty() {
struct_ser.serialize_field("withProperties", &self.with_properties)?;
}
if let Some(v) = self.info.as_ref() {
struct_ser.serialize_field("info", v)?;
}
if !self.source_name.is_empty() {
struct_ser.serialize_field("sourceName", &self.source_name)?;
}
if let Some(v) = self.rate_limit.as_ref() {
struct_ser.serialize_field("rateLimit", v)?;
}
if !self.secret_refs.is_empty() {
struct_ser.serialize_field("secretRefs", &self.secret_refs)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for StreamSource {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"source_id",
"sourceId",
"state_table",
"stateTable",
"row_id_index",
"rowIdIndex",
"columns",
"with_properties",
"withProperties",
"info",
"source_name",
"sourceName",
"rate_limit",
"rateLimit",
"secret_refs",
"secretRefs",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SourceId,
StateTable,
RowIdIndex,
Columns,
WithProperties,
Info,
SourceName,
RateLimit,
SecretRefs,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"sourceId" | "source_id" => Ok(GeneratedField::SourceId),
"stateTable" | "state_table" => Ok(GeneratedField::StateTable),
"rowIdIndex" | "row_id_index" => Ok(GeneratedField::RowIdIndex),
"columns" => Ok(GeneratedField::Columns),
"withProperties" | "with_properties" => Ok(GeneratedField::WithProperties),
"info" => Ok(GeneratedField::Info),
"sourceName" | "source_name" => Ok(GeneratedField::SourceName),
"rateLimit" | "rate_limit" => Ok(GeneratedField::RateLimit),
"secretRefs" | "secret_refs" => Ok(GeneratedField::SecretRefs),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = StreamSource;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.StreamSource")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<StreamSource, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut source_id__ = None;
let mut state_table__ = None;
let mut row_id_index__ = None;
let mut columns__ = None;
let mut with_properties__ = None;
let mut info__ = None;
let mut source_name__ = None;
let mut rate_limit__ = None;
let mut secret_refs__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::SourceId => {
if source_id__.is_some() {
return Err(serde::de::Error::duplicate_field("sourceId"));
}
source_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::StateTable => {
if state_table__.is_some() {
return Err(serde::de::Error::duplicate_field("stateTable"));
}
state_table__ = map_.next_value()?;
}
GeneratedField::RowIdIndex => {
if row_id_index__.is_some() {
return Err(serde::de::Error::duplicate_field("rowIdIndex"));
}
row_id_index__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::Columns => {
if columns__.is_some() {
return Err(serde::de::Error::duplicate_field("columns"));
}
columns__ = Some(map_.next_value()?);
}
GeneratedField::WithProperties => {
if with_properties__.is_some() {
return Err(serde::de::Error::duplicate_field("withProperties"));
}
with_properties__ = Some(
map_.next_value::<std::collections::BTreeMap<_, _>>()?
);
}
GeneratedField::Info => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("info"));
}
info__ = map_.next_value()?;
}
GeneratedField::SourceName => {
if source_name__.is_some() {
return Err(serde::de::Error::duplicate_field("sourceName"));
}
source_name__ = Some(map_.next_value()?);
}
GeneratedField::RateLimit => {
if rate_limit__.is_some() {
return Err(serde::de::Error::duplicate_field("rateLimit"));
}
rate_limit__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::SecretRefs => {
if secret_refs__.is_some() {
return Err(serde::de::Error::duplicate_field("secretRefs"));
}
secret_refs__ = Some(
map_.next_value::<std::collections::BTreeMap<_, _>>()?
);
}
}
}
Ok(StreamSource {
source_id: source_id__.unwrap_or_default(),
state_table: state_table__,
row_id_index: row_id_index__,
columns: columns__.unwrap_or_default(),
with_properties: with_properties__.unwrap_or_default(),
info: info__,
source_name: source_name__.unwrap_or_default(),
rate_limit: rate_limit__,
secret_refs: secret_refs__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.StreamSource", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SubscriptionUpstreamInfo {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.subscriber_id != 0 {
len += 1;
}
if self.upstream_mv_table_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.SubscriptionUpstreamInfo", len)?;
if self.subscriber_id != 0 {
struct_ser.serialize_field("subscriberId", &self.subscriber_id)?;
}
if self.upstream_mv_table_id != 0 {
struct_ser.serialize_field("upstreamMvTableId", &self.upstream_mv_table_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SubscriptionUpstreamInfo {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"subscriber_id",
"subscriberId",
"upstream_mv_table_id",
"upstreamMvTableId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SubscriberId,
UpstreamMvTableId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"subscriberId" | "subscriber_id" => Ok(GeneratedField::SubscriberId),
"upstreamMvTableId" | "upstream_mv_table_id" => Ok(GeneratedField::UpstreamMvTableId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SubscriptionUpstreamInfo;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.SubscriptionUpstreamInfo")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SubscriptionUpstreamInfo, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut subscriber_id__ = None;
let mut upstream_mv_table_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::SubscriberId => {
if subscriber_id__.is_some() {
return Err(serde::de::Error::duplicate_field("subscriberId"));
}
subscriber_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::UpstreamMvTableId => {
if upstream_mv_table_id__.is_some() {
return Err(serde::de::Error::duplicate_field("upstreamMvTableId"));
}
upstream_mv_table_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(SubscriptionUpstreamInfo {
subscriber_id: subscriber_id__.unwrap_or_default(),
upstream_mv_table_id: upstream_mv_table_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.SubscriptionUpstreamInfo", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for TemporalJoinNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.join_type != 0 {
len += 1;
}
if !self.left_key.is_empty() {
len += 1;
}
if !self.right_key.is_empty() {
len += 1;
}
if !self.null_safe.is_empty() {
len += 1;
}
if self.condition.is_some() {
len += 1;
}
if !self.output_indices.is_empty() {
len += 1;
}
if self.table_desc.is_some() {
len += 1;
}
if !self.table_output_indices.is_empty() {
len += 1;
}
if self.memo_table.is_some() {
len += 1;
}
if self.is_nested_loop {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.TemporalJoinNode", len)?;
if self.join_type != 0 {
let v = super::plan_common::JoinType::try_from(self.join_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.join_type)))?;
struct_ser.serialize_field("joinType", &v)?;
}
if !self.left_key.is_empty() {
struct_ser.serialize_field("leftKey", &self.left_key)?;
}
if !self.right_key.is_empty() {
struct_ser.serialize_field("rightKey", &self.right_key)?;
}
if !self.null_safe.is_empty() {
struct_ser.serialize_field("nullSafe", &self.null_safe)?;
}
if let Some(v) = self.condition.as_ref() {
struct_ser.serialize_field("condition", v)?;
}
if !self.output_indices.is_empty() {
struct_ser.serialize_field("outputIndices", &self.output_indices)?;
}
if let Some(v) = self.table_desc.as_ref() {
struct_ser.serialize_field("tableDesc", v)?;
}
if !self.table_output_indices.is_empty() {
struct_ser.serialize_field("tableOutputIndices", &self.table_output_indices)?;
}
if let Some(v) = self.memo_table.as_ref() {
struct_ser.serialize_field("memoTable", v)?;
}
if self.is_nested_loop {
struct_ser.serialize_field("isNestedLoop", &self.is_nested_loop)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TemporalJoinNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"join_type",
"joinType",
"left_key",
"leftKey",
"right_key",
"rightKey",
"null_safe",
"nullSafe",
"condition",
"output_indices",
"outputIndices",
"table_desc",
"tableDesc",
"table_output_indices",
"tableOutputIndices",
"memo_table",
"memoTable",
"is_nested_loop",
"isNestedLoop",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
JoinType,
LeftKey,
RightKey,
NullSafe,
Condition,
OutputIndices,
TableDesc,
TableOutputIndices,
MemoTable,
IsNestedLoop,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"joinType" | "join_type" => Ok(GeneratedField::JoinType),
"leftKey" | "left_key" => Ok(GeneratedField::LeftKey),
"rightKey" | "right_key" => Ok(GeneratedField::RightKey),
"nullSafe" | "null_safe" => Ok(GeneratedField::NullSafe),
"condition" => Ok(GeneratedField::Condition),
"outputIndices" | "output_indices" => Ok(GeneratedField::OutputIndices),
"tableDesc" | "table_desc" => Ok(GeneratedField::TableDesc),
"tableOutputIndices" | "table_output_indices" => Ok(GeneratedField::TableOutputIndices),
"memoTable" | "memo_table" => Ok(GeneratedField::MemoTable),
"isNestedLoop" | "is_nested_loop" => Ok(GeneratedField::IsNestedLoop),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TemporalJoinNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.TemporalJoinNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TemporalJoinNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut join_type__ = None;
let mut left_key__ = None;
let mut right_key__ = None;
let mut null_safe__ = None;
let mut condition__ = None;
let mut output_indices__ = None;
let mut table_desc__ = None;
let mut table_output_indices__ = None;
let mut memo_table__ = None;
let mut is_nested_loop__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::JoinType => {
if join_type__.is_some() {
return Err(serde::de::Error::duplicate_field("joinType"));
}
join_type__ = Some(map_.next_value::<super::plan_common::JoinType>()? as i32);
}
GeneratedField::LeftKey => {
if left_key__.is_some() {
return Err(serde::de::Error::duplicate_field("leftKey"));
}
left_key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::RightKey => {
if right_key__.is_some() {
return Err(serde::de::Error::duplicate_field("rightKey"));
}
right_key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::NullSafe => {
if null_safe__.is_some() {
return Err(serde::de::Error::duplicate_field("nullSafe"));
}
null_safe__ = Some(map_.next_value()?);
}
GeneratedField::Condition => {
if condition__.is_some() {
return Err(serde::de::Error::duplicate_field("condition"));
}
condition__ = map_.next_value()?;
}
GeneratedField::OutputIndices => {
if output_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("outputIndices"));
}
output_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::TableDesc => {
if table_desc__.is_some() {
return Err(serde::de::Error::duplicate_field("tableDesc"));
}
table_desc__ = map_.next_value()?;
}
GeneratedField::TableOutputIndices => {
if table_output_indices__.is_some() {
return Err(serde::de::Error::duplicate_field("tableOutputIndices"));
}
table_output_indices__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::MemoTable => {
if memo_table__.is_some() {
return Err(serde::de::Error::duplicate_field("memoTable"));
}
memo_table__ = map_.next_value()?;
}
GeneratedField::IsNestedLoop => {
if is_nested_loop__.is_some() {
return Err(serde::de::Error::duplicate_field("isNestedLoop"));
}
is_nested_loop__ = Some(map_.next_value()?);
}
}
}
Ok(TemporalJoinNode {
join_type: join_type__.unwrap_or_default(),
left_key: left_key__.unwrap_or_default(),
right_key: right_key__.unwrap_or_default(),
null_safe: null_safe__.unwrap_or_default(),
condition: condition__,
output_indices: output_indices__.unwrap_or_default(),
table_desc: table_desc__,
table_output_indices: table_output_indices__.unwrap_or_default(),
memo_table: memo_table__,
is_nested_loop: is_nested_loop__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.TemporalJoinNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ThrottleMutation {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.actor_throttle.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.ThrottleMutation", len)?;
if !self.actor_throttle.is_empty() {
struct_ser.serialize_field("actorThrottle", &self.actor_throttle)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ThrottleMutation {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"actor_throttle",
"actorThrottle",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ActorThrottle,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"actorThrottle" | "actor_throttle" => Ok(GeneratedField::ActorThrottle),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ThrottleMutation;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.ThrottleMutation")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ThrottleMutation, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut actor_throttle__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ActorThrottle => {
if actor_throttle__.is_some() {
return Err(serde::de::Error::duplicate_field("actorThrottle"));
}
actor_throttle__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
}
}
Ok(ThrottleMutation {
actor_throttle: actor_throttle__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.ThrottleMutation", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for throttle_mutation::RateLimit {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.rate_limit.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.ThrottleMutation.RateLimit", len)?;
if let Some(v) = self.rate_limit.as_ref() {
struct_ser.serialize_field("rateLimit", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for throttle_mutation::RateLimit {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"rate_limit",
"rateLimit",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
RateLimit,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"rateLimit" | "rate_limit" => Ok(GeneratedField::RateLimit),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = throttle_mutation::RateLimit;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.ThrottleMutation.RateLimit")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<throttle_mutation::RateLimit, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut rate_limit__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::RateLimit => {
if rate_limit__.is_some() {
return Err(serde::de::Error::duplicate_field("rateLimit"));
}
rate_limit__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
}
}
Ok(throttle_mutation::RateLimit {
rate_limit: rate_limit__,
})
}
}
deserializer.deserialize_struct("stream_plan.ThrottleMutation.RateLimit", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for TopNNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.limit != 0 {
len += 1;
}
if self.offset != 0 {
len += 1;
}
if self.table.is_some() {
len += 1;
}
if !self.order_by.is_empty() {
len += 1;
}
if self.with_ties {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.TopNNode", len)?;
if self.limit != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("limit", ToString::to_string(&self.limit).as_str())?;
}
if self.offset != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("offset", ToString::to_string(&self.offset).as_str())?;
}
if let Some(v) = self.table.as_ref() {
struct_ser.serialize_field("table", v)?;
}
if !self.order_by.is_empty() {
struct_ser.serialize_field("orderBy", &self.order_by)?;
}
if self.with_ties {
struct_ser.serialize_field("withTies", &self.with_ties)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TopNNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"limit",
"offset",
"table",
"order_by",
"orderBy",
"with_ties",
"withTies",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Limit,
Offset,
Table,
OrderBy,
WithTies,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"limit" => Ok(GeneratedField::Limit),
"offset" => Ok(GeneratedField::Offset),
"table" => Ok(GeneratedField::Table),
"orderBy" | "order_by" => Ok(GeneratedField::OrderBy),
"withTies" | "with_ties" => Ok(GeneratedField::WithTies),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TopNNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.TopNNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TopNNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut limit__ = None;
let mut offset__ = None;
let mut table__ = None;
let mut order_by__ = None;
let mut with_ties__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Limit => {
if limit__.is_some() {
return Err(serde::de::Error::duplicate_field("limit"));
}
limit__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Offset => {
if offset__.is_some() {
return Err(serde::de::Error::duplicate_field("offset"));
}
offset__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Table => {
if table__.is_some() {
return Err(serde::de::Error::duplicate_field("table"));
}
table__ = map_.next_value()?;
}
GeneratedField::OrderBy => {
if order_by__.is_some() {
return Err(serde::de::Error::duplicate_field("orderBy"));
}
order_by__ = Some(map_.next_value()?);
}
GeneratedField::WithTies => {
if with_ties__.is_some() {
return Err(serde::de::Error::duplicate_field("withTies"));
}
with_ties__ = Some(map_.next_value()?);
}
}
}
Ok(TopNNode {
limit: limit__.unwrap_or_default(),
offset: offset__.unwrap_or_default(),
table: table__,
order_by: order_by__.unwrap_or_default(),
with_ties: with_ties__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.TopNNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for UnionNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("stream_plan.UnionNode", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for UnionNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = UnionNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.UnionNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<UnionNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(UnionNode {
})
}
}
deserializer.deserialize_struct("stream_plan.UnionNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for UpdateMutation {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.dispatcher_update.is_empty() {
len += 1;
}
if !self.merge_update.is_empty() {
len += 1;
}
if !self.actor_vnode_bitmap_update.is_empty() {
len += 1;
}
if !self.dropped_actors.is_empty() {
len += 1;
}
if !self.actor_splits.is_empty() {
len += 1;
}
if !self.actor_new_dispatchers.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.UpdateMutation", len)?;
if !self.dispatcher_update.is_empty() {
struct_ser.serialize_field("dispatcherUpdate", &self.dispatcher_update)?;
}
if !self.merge_update.is_empty() {
struct_ser.serialize_field("mergeUpdate", &self.merge_update)?;
}
if !self.actor_vnode_bitmap_update.is_empty() {
struct_ser.serialize_field("actorVnodeBitmapUpdate", &self.actor_vnode_bitmap_update)?;
}
if !self.dropped_actors.is_empty() {
struct_ser.serialize_field("droppedActors", &self.dropped_actors)?;
}
if !self.actor_splits.is_empty() {
struct_ser.serialize_field("actorSplits", &self.actor_splits)?;
}
if !self.actor_new_dispatchers.is_empty() {
struct_ser.serialize_field("actorNewDispatchers", &self.actor_new_dispatchers)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for UpdateMutation {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"dispatcher_update",
"dispatcherUpdate",
"merge_update",
"mergeUpdate",
"actor_vnode_bitmap_update",
"actorVnodeBitmapUpdate",
"dropped_actors",
"droppedActors",
"actor_splits",
"actorSplits",
"actor_new_dispatchers",
"actorNewDispatchers",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
DispatcherUpdate,
MergeUpdate,
ActorVnodeBitmapUpdate,
DroppedActors,
ActorSplits,
ActorNewDispatchers,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"dispatcherUpdate" | "dispatcher_update" => Ok(GeneratedField::DispatcherUpdate),
"mergeUpdate" | "merge_update" => Ok(GeneratedField::MergeUpdate),
"actorVnodeBitmapUpdate" | "actor_vnode_bitmap_update" => Ok(GeneratedField::ActorVnodeBitmapUpdate),
"droppedActors" | "dropped_actors" => Ok(GeneratedField::DroppedActors),
"actorSplits" | "actor_splits" => Ok(GeneratedField::ActorSplits),
"actorNewDispatchers" | "actor_new_dispatchers" => Ok(GeneratedField::ActorNewDispatchers),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = UpdateMutation;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.UpdateMutation")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<UpdateMutation, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut dispatcher_update__ = None;
let mut merge_update__ = None;
let mut actor_vnode_bitmap_update__ = None;
let mut dropped_actors__ = None;
let mut actor_splits__ = None;
let mut actor_new_dispatchers__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::DispatcherUpdate => {
if dispatcher_update__.is_some() {
return Err(serde::de::Error::duplicate_field("dispatcherUpdate"));
}
dispatcher_update__ = Some(map_.next_value()?);
}
GeneratedField::MergeUpdate => {
if merge_update__.is_some() {
return Err(serde::de::Error::duplicate_field("mergeUpdate"));
}
merge_update__ = Some(map_.next_value()?);
}
GeneratedField::ActorVnodeBitmapUpdate => {
if actor_vnode_bitmap_update__.is_some() {
return Err(serde::de::Error::duplicate_field("actorVnodeBitmapUpdate"));
}
actor_vnode_bitmap_update__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::DroppedActors => {
if dropped_actors__.is_some() {
return Err(serde::de::Error::duplicate_field("droppedActors"));
}
dropped_actors__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::ActorSplits => {
if actor_splits__.is_some() {
return Err(serde::de::Error::duplicate_field("actorSplits"));
}
actor_splits__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::ActorNewDispatchers => {
if actor_new_dispatchers__.is_some() {
return Err(serde::de::Error::duplicate_field("actorNewDispatchers"));
}
actor_new_dispatchers__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
}
}
Ok(UpdateMutation {
dispatcher_update: dispatcher_update__.unwrap_or_default(),
merge_update: merge_update__.unwrap_or_default(),
actor_vnode_bitmap_update: actor_vnode_bitmap_update__.unwrap_or_default(),
dropped_actors: dropped_actors__.unwrap_or_default(),
actor_splits: actor_splits__.unwrap_or_default(),
actor_new_dispatchers: actor_new_dispatchers__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.UpdateMutation", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for update_mutation::DispatcherUpdate {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.actor_id != 0 {
len += 1;
}
if self.dispatcher_id != 0 {
len += 1;
}
if self.hash_mapping.is_some() {
len += 1;
}
if !self.added_downstream_actor_id.is_empty() {
len += 1;
}
if !self.removed_downstream_actor_id.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.UpdateMutation.DispatcherUpdate", len)?;
if self.actor_id != 0 {
struct_ser.serialize_field("actorId", &self.actor_id)?;
}
if self.dispatcher_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("dispatcherId", ToString::to_string(&self.dispatcher_id).as_str())?;
}
if let Some(v) = self.hash_mapping.as_ref() {
struct_ser.serialize_field("hashMapping", v)?;
}
if !self.added_downstream_actor_id.is_empty() {
struct_ser.serialize_field("addedDownstreamActorId", &self.added_downstream_actor_id)?;
}
if !self.removed_downstream_actor_id.is_empty() {
struct_ser.serialize_field("removedDownstreamActorId", &self.removed_downstream_actor_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for update_mutation::DispatcherUpdate {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"actor_id",
"actorId",
"dispatcher_id",
"dispatcherId",
"hash_mapping",
"hashMapping",
"added_downstream_actor_id",
"addedDownstreamActorId",
"removed_downstream_actor_id",
"removedDownstreamActorId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ActorId,
DispatcherId,
HashMapping,
AddedDownstreamActorId,
RemovedDownstreamActorId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"actorId" | "actor_id" => Ok(GeneratedField::ActorId),
"dispatcherId" | "dispatcher_id" => Ok(GeneratedField::DispatcherId),
"hashMapping" | "hash_mapping" => Ok(GeneratedField::HashMapping),
"addedDownstreamActorId" | "added_downstream_actor_id" => Ok(GeneratedField::AddedDownstreamActorId),
"removedDownstreamActorId" | "removed_downstream_actor_id" => Ok(GeneratedField::RemovedDownstreamActorId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = update_mutation::DispatcherUpdate;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.UpdateMutation.DispatcherUpdate")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<update_mutation::DispatcherUpdate, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut actor_id__ = None;
let mut dispatcher_id__ = None;
let mut hash_mapping__ = None;
let mut added_downstream_actor_id__ = None;
let mut removed_downstream_actor_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ActorId => {
if actor_id__.is_some() {
return Err(serde::de::Error::duplicate_field("actorId"));
}
actor_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::DispatcherId => {
if dispatcher_id__.is_some() {
return Err(serde::de::Error::duplicate_field("dispatcherId"));
}
dispatcher_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::HashMapping => {
if hash_mapping__.is_some() {
return Err(serde::de::Error::duplicate_field("hashMapping"));
}
hash_mapping__ = map_.next_value()?;
}
GeneratedField::AddedDownstreamActorId => {
if added_downstream_actor_id__.is_some() {
return Err(serde::de::Error::duplicate_field("addedDownstreamActorId"));
}
added_downstream_actor_id__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::RemovedDownstreamActorId => {
if removed_downstream_actor_id__.is_some() {
return Err(serde::de::Error::duplicate_field("removedDownstreamActorId"));
}
removed_downstream_actor_id__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(update_mutation::DispatcherUpdate {
actor_id: actor_id__.unwrap_or_default(),
dispatcher_id: dispatcher_id__.unwrap_or_default(),
hash_mapping: hash_mapping__,
added_downstream_actor_id: added_downstream_actor_id__.unwrap_or_default(),
removed_downstream_actor_id: removed_downstream_actor_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.UpdateMutation.DispatcherUpdate", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for update_mutation::MergeUpdate {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.actor_id != 0 {
len += 1;
}
if self.upstream_fragment_id != 0 {
len += 1;
}
if self.new_upstream_fragment_id.is_some() {
len += 1;
}
if !self.added_upstream_actor_id.is_empty() {
len += 1;
}
if !self.removed_upstream_actor_id.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.UpdateMutation.MergeUpdate", len)?;
if self.actor_id != 0 {
struct_ser.serialize_field("actorId", &self.actor_id)?;
}
if self.upstream_fragment_id != 0 {
struct_ser.serialize_field("upstreamFragmentId", &self.upstream_fragment_id)?;
}
if let Some(v) = self.new_upstream_fragment_id.as_ref() {
struct_ser.serialize_field("newUpstreamFragmentId", v)?;
}
if !self.added_upstream_actor_id.is_empty() {
struct_ser.serialize_field("addedUpstreamActorId", &self.added_upstream_actor_id)?;
}
if !self.removed_upstream_actor_id.is_empty() {
struct_ser.serialize_field("removedUpstreamActorId", &self.removed_upstream_actor_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for update_mutation::MergeUpdate {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"actor_id",
"actorId",
"upstream_fragment_id",
"upstreamFragmentId",
"new_upstream_fragment_id",
"newUpstreamFragmentId",
"added_upstream_actor_id",
"addedUpstreamActorId",
"removed_upstream_actor_id",
"removedUpstreamActorId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ActorId,
UpstreamFragmentId,
NewUpstreamFragmentId,
AddedUpstreamActorId,
RemovedUpstreamActorId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"actorId" | "actor_id" => Ok(GeneratedField::ActorId),
"upstreamFragmentId" | "upstream_fragment_id" => Ok(GeneratedField::UpstreamFragmentId),
"newUpstreamFragmentId" | "new_upstream_fragment_id" => Ok(GeneratedField::NewUpstreamFragmentId),
"addedUpstreamActorId" | "added_upstream_actor_id" => Ok(GeneratedField::AddedUpstreamActorId),
"removedUpstreamActorId" | "removed_upstream_actor_id" => Ok(GeneratedField::RemovedUpstreamActorId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = update_mutation::MergeUpdate;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.UpdateMutation.MergeUpdate")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<update_mutation::MergeUpdate, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut actor_id__ = None;
let mut upstream_fragment_id__ = None;
let mut new_upstream_fragment_id__ = None;
let mut added_upstream_actor_id__ = None;
let mut removed_upstream_actor_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ActorId => {
if actor_id__.is_some() {
return Err(serde::de::Error::duplicate_field("actorId"));
}
actor_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::UpstreamFragmentId => {
if upstream_fragment_id__.is_some() {
return Err(serde::de::Error::duplicate_field("upstreamFragmentId"));
}
upstream_fragment_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::NewUpstreamFragmentId => {
if new_upstream_fragment_id__.is_some() {
return Err(serde::de::Error::duplicate_field("newUpstreamFragmentId"));
}
new_upstream_fragment_id__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::AddedUpstreamActorId => {
if added_upstream_actor_id__.is_some() {
return Err(serde::de::Error::duplicate_field("addedUpstreamActorId"));
}
added_upstream_actor_id__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::RemovedUpstreamActorId => {
if removed_upstream_actor_id__.is_some() {
return Err(serde::de::Error::duplicate_field("removedUpstreamActorId"));
}
removed_upstream_actor_id__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(update_mutation::MergeUpdate {
actor_id: actor_id__.unwrap_or_default(),
upstream_fragment_id: upstream_fragment_id__.unwrap_or_default(),
new_upstream_fragment_id: new_upstream_fragment_id__,
added_upstream_actor_id: added_upstream_actor_id__.unwrap_or_default(),
removed_upstream_actor_id: removed_upstream_actor_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.UpdateMutation.MergeUpdate", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ValuesNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.tuples.is_empty() {
len += 1;
}
if !self.fields.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.ValuesNode", len)?;
if !self.tuples.is_empty() {
struct_ser.serialize_field("tuples", &self.tuples)?;
}
if !self.fields.is_empty() {
struct_ser.serialize_field("fields", &self.fields)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ValuesNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"tuples",
"fields",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Tuples,
Fields,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"tuples" => Ok(GeneratedField::Tuples),
"fields" => Ok(GeneratedField::Fields),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ValuesNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.ValuesNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ValuesNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut tuples__ = None;
let mut fields__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Tuples => {
if tuples__.is_some() {
return Err(serde::de::Error::duplicate_field("tuples"));
}
tuples__ = Some(map_.next_value()?);
}
GeneratedField::Fields => {
if fields__.is_some() {
return Err(serde::de::Error::duplicate_field("fields"));
}
fields__ = Some(map_.next_value()?);
}
}
}
Ok(ValuesNode {
tuples: tuples__.unwrap_or_default(),
fields: fields__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.ValuesNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for values_node::ExprTuple {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.cells.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.ValuesNode.ExprTuple", len)?;
if !self.cells.is_empty() {
struct_ser.serialize_field("cells", &self.cells)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for values_node::ExprTuple {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"cells",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Cells,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"cells" => Ok(GeneratedField::Cells),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = values_node::ExprTuple;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.ValuesNode.ExprTuple")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<values_node::ExprTuple, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut cells__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Cells => {
if cells__.is_some() {
return Err(serde::de::Error::duplicate_field("cells"));
}
cells__ = Some(map_.next_value()?);
}
}
}
Ok(values_node::ExprTuple {
cells: cells__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.ValuesNode.ExprTuple", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for Watermark {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.column.is_some() {
len += 1;
}
if self.val.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.Watermark", len)?;
if let Some(v) = self.column.as_ref() {
struct_ser.serialize_field("column", v)?;
}
if let Some(v) = self.val.as_ref() {
struct_ser.serialize_field("val", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for Watermark {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"column",
"val",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Column,
Val,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"column" => Ok(GeneratedField::Column),
"val" => Ok(GeneratedField::Val),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = Watermark;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.Watermark")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<Watermark, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut column__ = None;
let mut val__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Column => {
if column__.is_some() {
return Err(serde::de::Error::duplicate_field("column"));
}
column__ = map_.next_value()?;
}
GeneratedField::Val => {
if val__.is_some() {
return Err(serde::de::Error::duplicate_field("val"));
}
val__ = map_.next_value()?;
}
}
}
Ok(Watermark {
column: column__,
val: val__,
})
}
}
deserializer.deserialize_struct("stream_plan.Watermark", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for WatermarkFilterNode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.watermark_descs.is_empty() {
len += 1;
}
if !self.tables.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("stream_plan.WatermarkFilterNode", len)?;
if !self.watermark_descs.is_empty() {
struct_ser.serialize_field("watermarkDescs", &self.watermark_descs)?;
}
if !self.tables.is_empty() {
struct_ser.serialize_field("tables", &self.tables)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for WatermarkFilterNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"watermark_descs",
"watermarkDescs",
"tables",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
WatermarkDescs,
Tables,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"watermarkDescs" | "watermark_descs" => Ok(GeneratedField::WatermarkDescs),
"tables" => Ok(GeneratedField::Tables),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = WatermarkFilterNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct stream_plan.WatermarkFilterNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<WatermarkFilterNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut watermark_descs__ = None;
let mut tables__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::WatermarkDescs => {
if watermark_descs__.is_some() {
return Err(serde::de::Error::duplicate_field("watermarkDescs"));
}
watermark_descs__ = Some(map_.next_value()?);
}
GeneratedField::Tables => {
if tables__.is_some() {
return Err(serde::de::Error::duplicate_field("tables"));
}
tables__ = Some(map_.next_value()?);
}
}
}
Ok(WatermarkFilterNode {
watermark_descs: watermark_descs__.unwrap_or_default(),
tables: tables__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("stream_plan.WatermarkFilterNode", FIELDS, GeneratedVisitor)
}
}