use crate::batch_plan::*;
impl serde::Serialize for DeleteNode {
#[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.returning {
len += 1;
}
if self.session_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.DeleteNode", 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.returning {
struct_ser.serialize_field("returning", &self.returning)?;
}
if self.session_id != 0 {
struct_ser.serialize_field("sessionId", &self.session_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DeleteNode {
#[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",
"returning",
"session_id",
"sessionId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableId,
TableVersionId,
Returning,
SessionId,
}
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),
"returning" => Ok(GeneratedField::Returning),
"sessionId" | "session_id" => Ok(GeneratedField::SessionId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DeleteNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.DeleteNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DeleteNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_id__ = None;
let mut table_version_id__ = None;
let mut returning__ = None;
let mut session_id__ = 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::Returning => {
if returning__.is_some() {
return Err(serde::de::Error::duplicate_field("returning"));
}
returning__ = Some(map_.next_value()?);
}
GeneratedField::SessionId => {
if session_id__.is_some() {
return Err(serde::de::Error::duplicate_field("sessionId"));
}
session_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(DeleteNode {
table_id: table_id__.unwrap_or_default(),
table_version_id: table_version_id__.unwrap_or_default(),
returning: returning__.unwrap_or_default(),
session_id: session_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.DeleteNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DistributedLookupJoinNode {
#[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.condition.is_some() {
len += 1;
}
if !self.outer_side_key.is_empty() {
len += 1;
}
if !self.inner_side_key.is_empty() {
len += 1;
}
if self.lookup_prefix_len != 0 {
len += 1;
}
if self.inner_side_table_desc.is_some() {
len += 1;
}
if !self.inner_side_column_ids.is_empty() {
len += 1;
}
if !self.output_indices.is_empty() {
len += 1;
}
if !self.null_safe.is_empty() {
len += 1;
}
if self.as_of.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.DistributedLookupJoinNode", 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 let Some(v) = self.condition.as_ref() {
struct_ser.serialize_field("condition", v)?;
}
if !self.outer_side_key.is_empty() {
struct_ser.serialize_field("outerSideKey", &self.outer_side_key)?;
}
if !self.inner_side_key.is_empty() {
struct_ser.serialize_field("innerSideKey", &self.inner_side_key)?;
}
if self.lookup_prefix_len != 0 {
struct_ser.serialize_field("lookupPrefixLen", &self.lookup_prefix_len)?;
}
if let Some(v) = self.inner_side_table_desc.as_ref() {
struct_ser.serialize_field("innerSideTableDesc", v)?;
}
if !self.inner_side_column_ids.is_empty() {
struct_ser.serialize_field("innerSideColumnIds", &self.inner_side_column_ids)?;
}
if !self.output_indices.is_empty() {
struct_ser.serialize_field("outputIndices", &self.output_indices)?;
}
if !self.null_safe.is_empty() {
struct_ser.serialize_field("nullSafe", &self.null_safe)?;
}
if let Some(v) = self.as_of.as_ref() {
struct_ser.serialize_field("asOf", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DistributedLookupJoinNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"join_type",
"joinType",
"condition",
"outer_side_key",
"outerSideKey",
"inner_side_key",
"innerSideKey",
"lookup_prefix_len",
"lookupPrefixLen",
"inner_side_table_desc",
"innerSideTableDesc",
"inner_side_column_ids",
"innerSideColumnIds",
"output_indices",
"outputIndices",
"null_safe",
"nullSafe",
"as_of",
"asOf",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
JoinType,
Condition,
OuterSideKey,
InnerSideKey,
LookupPrefixLen,
InnerSideTableDesc,
InnerSideColumnIds,
OutputIndices,
NullSafe,
AsOf,
}
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),
"condition" => Ok(GeneratedField::Condition),
"outerSideKey" | "outer_side_key" => Ok(GeneratedField::OuterSideKey),
"innerSideKey" | "inner_side_key" => Ok(GeneratedField::InnerSideKey),
"lookupPrefixLen" | "lookup_prefix_len" => Ok(GeneratedField::LookupPrefixLen),
"innerSideTableDesc" | "inner_side_table_desc" => Ok(GeneratedField::InnerSideTableDesc),
"innerSideColumnIds" | "inner_side_column_ids" => Ok(GeneratedField::InnerSideColumnIds),
"outputIndices" | "output_indices" => Ok(GeneratedField::OutputIndices),
"nullSafe" | "null_safe" => Ok(GeneratedField::NullSafe),
"asOf" | "as_of" => Ok(GeneratedField::AsOf),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DistributedLookupJoinNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.DistributedLookupJoinNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DistributedLookupJoinNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut join_type__ = None;
let mut condition__ = None;
let mut outer_side_key__ = None;
let mut inner_side_key__ = None;
let mut lookup_prefix_len__ = None;
let mut inner_side_table_desc__ = None;
let mut inner_side_column_ids__ = None;
let mut output_indices__ = None;
let mut null_safe__ = None;
let mut as_of__ = 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::Condition => {
if condition__.is_some() {
return Err(serde::de::Error::duplicate_field("condition"));
}
condition__ = map_.next_value()?;
}
GeneratedField::OuterSideKey => {
if outer_side_key__.is_some() {
return Err(serde::de::Error::duplicate_field("outerSideKey"));
}
outer_side_key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::InnerSideKey => {
if inner_side_key__.is_some() {
return Err(serde::de::Error::duplicate_field("innerSideKey"));
}
inner_side_key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::LookupPrefixLen => {
if lookup_prefix_len__.is_some() {
return Err(serde::de::Error::duplicate_field("lookupPrefixLen"));
}
lookup_prefix_len__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::InnerSideTableDesc => {
if inner_side_table_desc__.is_some() {
return Err(serde::de::Error::duplicate_field("innerSideTableDesc"));
}
inner_side_table_desc__ = map_.next_value()?;
}
GeneratedField::InnerSideColumnIds => {
if inner_side_column_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("innerSideColumnIds"));
}
inner_side_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::NullSafe => {
if null_safe__.is_some() {
return Err(serde::de::Error::duplicate_field("nullSafe"));
}
null_safe__ = Some(map_.next_value()?);
}
GeneratedField::AsOf => {
if as_of__.is_some() {
return Err(serde::de::Error::duplicate_field("asOf"));
}
as_of__ = map_.next_value()?;
}
}
}
Ok(DistributedLookupJoinNode {
join_type: join_type__.unwrap_or_default(),
condition: condition__,
outer_side_key: outer_side_key__.unwrap_or_default(),
inner_side_key: inner_side_key__.unwrap_or_default(),
lookup_prefix_len: lookup_prefix_len__.unwrap_or_default(),
inner_side_table_desc: inner_side_table_desc__,
inner_side_column_ids: inner_side_column_ids__.unwrap_or_default(),
output_indices: output_indices__.unwrap_or_default(),
null_safe: null_safe__.unwrap_or_default(),
as_of: as_of__,
})
}
}
deserializer.deserialize_struct("batch_plan.DistributedLookupJoinNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ExchangeInfo {
#[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.mode != 0 {
len += 1;
}
if self.distribution.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.ExchangeInfo", len)?;
if self.mode != 0 {
let v = exchange_info::DistributionMode::try_from(self.mode)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.mode)))?;
struct_ser.serialize_field("mode", &v)?;
}
if let Some(v) = self.distribution.as_ref() {
match v {
exchange_info::Distribution::BroadcastInfo(v) => {
struct_ser.serialize_field("broadcastInfo", v)?;
}
exchange_info::Distribution::HashInfo(v) => {
struct_ser.serialize_field("hashInfo", v)?;
}
exchange_info::Distribution::ConsistentHashInfo(v) => {
struct_ser.serialize_field("consistentHashInfo", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ExchangeInfo {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"mode",
"broadcast_info",
"broadcastInfo",
"hash_info",
"hashInfo",
"consistent_hash_info",
"consistentHashInfo",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Mode,
BroadcastInfo,
HashInfo,
ConsistentHashInfo,
}
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 {
"mode" => Ok(GeneratedField::Mode),
"broadcastInfo" | "broadcast_info" => Ok(GeneratedField::BroadcastInfo),
"hashInfo" | "hash_info" => Ok(GeneratedField::HashInfo),
"consistentHashInfo" | "consistent_hash_info" => Ok(GeneratedField::ConsistentHashInfo),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ExchangeInfo;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.ExchangeInfo")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ExchangeInfo, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut mode__ = None;
let mut distribution__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Mode => {
if mode__.is_some() {
return Err(serde::de::Error::duplicate_field("mode"));
}
mode__ = Some(map_.next_value::<exchange_info::DistributionMode>()? as i32);
}
GeneratedField::BroadcastInfo => {
if distribution__.is_some() {
return Err(serde::de::Error::duplicate_field("broadcastInfo"));
}
distribution__ = map_.next_value::<::std::option::Option<_>>()?.map(exchange_info::Distribution::BroadcastInfo)
;
}
GeneratedField::HashInfo => {
if distribution__.is_some() {
return Err(serde::de::Error::duplicate_field("hashInfo"));
}
distribution__ = map_.next_value::<::std::option::Option<_>>()?.map(exchange_info::Distribution::HashInfo)
;
}
GeneratedField::ConsistentHashInfo => {
if distribution__.is_some() {
return Err(serde::de::Error::duplicate_field("consistentHashInfo"));
}
distribution__ = map_.next_value::<::std::option::Option<_>>()?.map(exchange_info::Distribution::ConsistentHashInfo)
;
}
}
}
Ok(ExchangeInfo {
mode: mode__.unwrap_or_default(),
distribution: distribution__,
})
}
}
deserializer.deserialize_struct("batch_plan.ExchangeInfo", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for exchange_info::BroadcastInfo {
#[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.count != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.ExchangeInfo.BroadcastInfo", len)?;
if self.count != 0 {
struct_ser.serialize_field("count", &self.count)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for exchange_info::BroadcastInfo {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"count",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Count,
}
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 {
"count" => Ok(GeneratedField::Count),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = exchange_info::BroadcastInfo;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.ExchangeInfo.BroadcastInfo")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<exchange_info::BroadcastInfo, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut count__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Count => {
if count__.is_some() {
return Err(serde::de::Error::duplicate_field("count"));
}
count__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(exchange_info::BroadcastInfo {
count: count__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.ExchangeInfo.BroadcastInfo", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for exchange_info::ConsistentHashInfo {
#[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.vmap.is_empty() {
len += 1;
}
if !self.key.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.ExchangeInfo.ConsistentHashInfo", len)?;
if !self.vmap.is_empty() {
struct_ser.serialize_field("vmap", &self.vmap)?;
}
if !self.key.is_empty() {
struct_ser.serialize_field("key", &self.key)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for exchange_info::ConsistentHashInfo {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"vmap",
"key",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Vmap,
Key,
}
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 {
"vmap" => Ok(GeneratedField::Vmap),
"key" => Ok(GeneratedField::Key),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = exchange_info::ConsistentHashInfo;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.ExchangeInfo.ConsistentHashInfo")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<exchange_info::ConsistentHashInfo, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut vmap__ = None;
let mut key__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Vmap => {
if vmap__.is_some() {
return Err(serde::de::Error::duplicate_field("vmap"));
}
vmap__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::Key => {
if key__.is_some() {
return Err(serde::de::Error::duplicate_field("key"));
}
key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(exchange_info::ConsistentHashInfo {
vmap: vmap__.unwrap_or_default(),
key: key__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.ExchangeInfo.ConsistentHashInfo", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for exchange_info::DistributionMode {
#[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 => "UNSPECIFIED",
Self::Single => "SINGLE",
Self::Broadcast => "BROADCAST",
Self::Hash => "HASH",
Self::ConsistentHash => "CONSISTENT_HASH",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for exchange_info::DistributionMode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"UNSPECIFIED",
"SINGLE",
"BROADCAST",
"HASH",
"CONSISTENT_HASH",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = exchange_info::DistributionMode;
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 {
"UNSPECIFIED" => Ok(exchange_info::DistributionMode::Unspecified),
"SINGLE" => Ok(exchange_info::DistributionMode::Single),
"BROADCAST" => Ok(exchange_info::DistributionMode::Broadcast),
"HASH" => Ok(exchange_info::DistributionMode::Hash),
"CONSISTENT_HASH" => Ok(exchange_info::DistributionMode::ConsistentHash),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for exchange_info::HashInfo {
#[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.output_count != 0 {
len += 1;
}
if !self.key.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.ExchangeInfo.HashInfo", len)?;
if self.output_count != 0 {
struct_ser.serialize_field("outputCount", &self.output_count)?;
}
if !self.key.is_empty() {
struct_ser.serialize_field("key", &self.key)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for exchange_info::HashInfo {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"output_count",
"outputCount",
"key",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
OutputCount,
Key,
}
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 {
"outputCount" | "output_count" => Ok(GeneratedField::OutputCount),
"key" => Ok(GeneratedField::Key),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = exchange_info::HashInfo;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.ExchangeInfo.HashInfo")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<exchange_info::HashInfo, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut output_count__ = None;
let mut key__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::OutputCount => {
if output_count__.is_some() {
return Err(serde::de::Error::duplicate_field("outputCount"));
}
output_count__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Key => {
if key__.is_some() {
return Err(serde::de::Error::duplicate_field("key"));
}
key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(exchange_info::HashInfo {
output_count: output_count__.unwrap_or_default(),
key: key__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.ExchangeInfo.HashInfo", 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.sources.is_empty() {
len += 1;
}
if self.sequential {
len += 1;
}
if !self.input_schema.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.ExchangeNode", len)?;
if !self.sources.is_empty() {
struct_ser.serialize_field("sources", &self.sources)?;
}
if self.sequential {
struct_ser.serialize_field("sequential", &self.sequential)?;
}
if !self.input_schema.is_empty() {
struct_ser.serialize_field("inputSchema", &self.input_schema)?;
}
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] = &[
"sources",
"sequential",
"input_schema",
"inputSchema",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Sources,
Sequential,
InputSchema,
}
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 {
"sources" => Ok(GeneratedField::Sources),
"sequential" => Ok(GeneratedField::Sequential),
"inputSchema" | "input_schema" => Ok(GeneratedField::InputSchema),
_ => 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 batch_plan.ExchangeNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ExchangeNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut sources__ = None;
let mut sequential__ = None;
let mut input_schema__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Sources => {
if sources__.is_some() {
return Err(serde::de::Error::duplicate_field("sources"));
}
sources__ = Some(map_.next_value()?);
}
GeneratedField::Sequential => {
if sequential__.is_some() {
return Err(serde::de::Error::duplicate_field("sequential"));
}
sequential__ = Some(map_.next_value()?);
}
GeneratedField::InputSchema => {
if input_schema__.is_some() {
return Err(serde::de::Error::duplicate_field("inputSchema"));
}
input_schema__ = Some(map_.next_value()?);
}
}
}
Ok(ExchangeNode {
sources: sources__.unwrap_or_default(),
sequential: sequential__.unwrap_or_default(),
input_schema: input_schema__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.ExchangeNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ExchangeSource {
#[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.task_output_id.is_some() {
len += 1;
}
if self.host.is_some() {
len += 1;
}
if self.local_execute_plan.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.ExchangeSource", len)?;
if let Some(v) = self.task_output_id.as_ref() {
struct_ser.serialize_field("taskOutputId", v)?;
}
if let Some(v) = self.host.as_ref() {
struct_ser.serialize_field("host", v)?;
}
if let Some(v) = self.local_execute_plan.as_ref() {
match v {
exchange_source::LocalExecutePlan::Plan(v) => {
struct_ser.serialize_field("plan", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ExchangeSource {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"task_output_id",
"taskOutputId",
"host",
"plan",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TaskOutputId,
Host,
Plan,
}
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 {
"taskOutputId" | "task_output_id" => Ok(GeneratedField::TaskOutputId),
"host" => Ok(GeneratedField::Host),
"plan" => Ok(GeneratedField::Plan),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ExchangeSource;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.ExchangeSource")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ExchangeSource, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut task_output_id__ = None;
let mut host__ = None;
let mut local_execute_plan__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TaskOutputId => {
if task_output_id__.is_some() {
return Err(serde::de::Error::duplicate_field("taskOutputId"));
}
task_output_id__ = map_.next_value()?;
}
GeneratedField::Host => {
if host__.is_some() {
return Err(serde::de::Error::duplicate_field("host"));
}
host__ = map_.next_value()?;
}
GeneratedField::Plan => {
if local_execute_plan__.is_some() {
return Err(serde::de::Error::duplicate_field("plan"));
}
local_execute_plan__ = map_.next_value::<::std::option::Option<_>>()?.map(exchange_source::LocalExecutePlan::Plan)
;
}
}
}
Ok(ExchangeSource {
task_output_id: task_output_id__,
host: host__,
local_execute_plan: local_execute_plan__,
})
}
}
deserializer.deserialize_struct("batch_plan.ExchangeSource", 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("batch_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 batch_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("batch_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("batch_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 batch_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("batch_plan.ExpandNode.Subset", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for FileScanNode {
#[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.columns.is_empty() {
len += 1;
}
if self.file_format != 0 {
len += 1;
}
if self.storage_type != 0 {
len += 1;
}
if !self.s3_region.is_empty() {
len += 1;
}
if !self.s3_access_key.is_empty() {
len += 1;
}
if !self.s3_secret_key.is_empty() {
len += 1;
}
if !self.file_location.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.FileScanNode", len)?;
if !self.columns.is_empty() {
struct_ser.serialize_field("columns", &self.columns)?;
}
if self.file_format != 0 {
let v = file_scan_node::FileFormat::try_from(self.file_format)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.file_format)))?;
struct_ser.serialize_field("fileFormat", &v)?;
}
if self.storage_type != 0 {
let v = file_scan_node::StorageType::try_from(self.storage_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.storage_type)))?;
struct_ser.serialize_field("storageType", &v)?;
}
if !self.s3_region.is_empty() {
struct_ser.serialize_field("s3Region", &self.s3_region)?;
}
if !self.s3_access_key.is_empty() {
struct_ser.serialize_field("s3AccessKey", &self.s3_access_key)?;
}
if !self.s3_secret_key.is_empty() {
struct_ser.serialize_field("s3SecretKey", &self.s3_secret_key)?;
}
if !self.file_location.is_empty() {
struct_ser.serialize_field("fileLocation", &self.file_location)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for FileScanNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"columns",
"file_format",
"fileFormat",
"storage_type",
"storageType",
"s3_region",
"s3Region",
"s3_access_key",
"s3AccessKey",
"s3_secret_key",
"s3SecretKey",
"file_location",
"fileLocation",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Columns,
FileFormat,
StorageType,
S3Region,
S3AccessKey,
S3SecretKey,
FileLocation,
}
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 {
"columns" => Ok(GeneratedField::Columns),
"fileFormat" | "file_format" => Ok(GeneratedField::FileFormat),
"storageType" | "storage_type" => Ok(GeneratedField::StorageType),
"s3Region" | "s3_region" => Ok(GeneratedField::S3Region),
"s3AccessKey" | "s3_access_key" => Ok(GeneratedField::S3AccessKey),
"s3SecretKey" | "s3_secret_key" => Ok(GeneratedField::S3SecretKey),
"fileLocation" | "file_location" => Ok(GeneratedField::FileLocation),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = FileScanNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.FileScanNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<FileScanNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut columns__ = None;
let mut file_format__ = None;
let mut storage_type__ = None;
let mut s3_region__ = None;
let mut s3_access_key__ = None;
let mut s3_secret_key__ = None;
let mut file_location__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Columns => {
if columns__.is_some() {
return Err(serde::de::Error::duplicate_field("columns"));
}
columns__ = Some(map_.next_value()?);
}
GeneratedField::FileFormat => {
if file_format__.is_some() {
return Err(serde::de::Error::duplicate_field("fileFormat"));
}
file_format__ = Some(map_.next_value::<file_scan_node::FileFormat>()? as i32);
}
GeneratedField::StorageType => {
if storage_type__.is_some() {
return Err(serde::de::Error::duplicate_field("storageType"));
}
storage_type__ = Some(map_.next_value::<file_scan_node::StorageType>()? as i32);
}
GeneratedField::S3Region => {
if s3_region__.is_some() {
return Err(serde::de::Error::duplicate_field("s3Region"));
}
s3_region__ = Some(map_.next_value()?);
}
GeneratedField::S3AccessKey => {
if s3_access_key__.is_some() {
return Err(serde::de::Error::duplicate_field("s3AccessKey"));
}
s3_access_key__ = Some(map_.next_value()?);
}
GeneratedField::S3SecretKey => {
if s3_secret_key__.is_some() {
return Err(serde::de::Error::duplicate_field("s3SecretKey"));
}
s3_secret_key__ = Some(map_.next_value()?);
}
GeneratedField::FileLocation => {
if file_location__.is_some() {
return Err(serde::de::Error::duplicate_field("fileLocation"));
}
file_location__ = Some(map_.next_value()?);
}
}
}
Ok(FileScanNode {
columns: columns__.unwrap_or_default(),
file_format: file_format__.unwrap_or_default(),
storage_type: storage_type__.unwrap_or_default(),
s3_region: s3_region__.unwrap_or_default(),
s3_access_key: s3_access_key__.unwrap_or_default(),
s3_secret_key: s3_secret_key__.unwrap_or_default(),
file_location: file_location__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.FileScanNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for file_scan_node::FileFormat {
#[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 => "FILE_FORMAT_UNSPECIFIED",
Self::Parquet => "PARQUET",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for file_scan_node::FileFormat {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"FILE_FORMAT_UNSPECIFIED",
"PARQUET",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = file_scan_node::FileFormat;
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 {
"FILE_FORMAT_UNSPECIFIED" => Ok(file_scan_node::FileFormat::Unspecified),
"PARQUET" => Ok(file_scan_node::FileFormat::Parquet),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for file_scan_node::StorageType {
#[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 => "STORAGE_TYPE_UNSPECIFIED",
Self::S3 => "S3",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for file_scan_node::StorageType {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"STORAGE_TYPE_UNSPECIFIED",
"S3",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = file_scan_node::StorageType;
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 {
"STORAGE_TYPE_UNSPECIFIED" => Ok(file_scan_node::StorageType::Unspecified),
"S3" => Ok(file_scan_node::StorageType::S3),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(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("batch_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 batch_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("batch_plan.FilterNode", 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.column_orders.is_empty() {
len += 1;
}
if self.limit != 0 {
len += 1;
}
if self.offset != 0 {
len += 1;
}
if !self.group_key.is_empty() {
len += 1;
}
if self.with_ties {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.GroupTopNNode", len)?;
if !self.column_orders.is_empty() {
struct_ser.serialize_field("columnOrders", &self.column_orders)?;
}
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 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] = &[
"column_orders",
"columnOrders",
"limit",
"offset",
"group_key",
"groupKey",
"with_ties",
"withTies",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ColumnOrders,
Limit,
Offset,
GroupKey,
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 {
"columnOrders" | "column_orders" => Ok(GeneratedField::ColumnOrders),
"limit" => Ok(GeneratedField::Limit),
"offset" => Ok(GeneratedField::Offset),
"groupKey" | "group_key" => Ok(GeneratedField::GroupKey),
"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 batch_plan.GroupTopNNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GroupTopNNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut column_orders__ = None;
let mut limit__ = None;
let mut offset__ = None;
let mut group_key__ = None;
let mut with_ties__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ColumnOrders => {
if column_orders__.is_some() {
return Err(serde::de::Error::duplicate_field("columnOrders"));
}
column_orders__ = Some(map_.next_value()?);
}
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::WithTies => {
if with_ties__.is_some() {
return Err(serde::de::Error::duplicate_field("withTies"));
}
with_ties__ = Some(map_.next_value()?);
}
}
}
Ok(GroupTopNNode {
column_orders: column_orders__.unwrap_or_default(),
limit: limit__.unwrap_or_default(),
offset: offset__.unwrap_or_default(),
group_key: group_key__.unwrap_or_default(),
with_ties: with_ties__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_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;
}
let mut struct_ser = serializer.serialize_struct("batch_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)?;
}
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",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
GroupKey,
AggCalls,
}
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),
_ => 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 batch_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;
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()?);
}
}
}
Ok(HashAggNode {
group_key: group_key__.unwrap_or_default(),
agg_calls: agg_calls__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_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.output_indices.is_empty() {
len += 1;
}
if !self.null_safe.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_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.output_indices.is_empty() {
struct_ser.serialize_field("outputIndices", &self.output_indices)?;
}
if !self.null_safe.is_empty() {
struct_ser.serialize_field("nullSafe", &self.null_safe)?;
}
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",
"output_indices",
"outputIndices",
"null_safe",
"nullSafe",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
JoinType,
LeftKey,
RightKey,
Condition,
OutputIndices,
NullSafe,
}
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),
"outputIndices" | "output_indices" => Ok(GeneratedField::OutputIndices),
"nullSafe" | "null_safe" => Ok(GeneratedField::NullSafe),
_ => 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 batch_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 output_indices__ = None;
let mut null_safe__ = 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::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::NullSafe => {
if null_safe__.is_some() {
return Err(serde::de::Error::duplicate_field("nullSafe"));
}
null_safe__ = 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__,
output_indices: output_indices__.unwrap_or_default(),
null_safe: null_safe__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_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("batch_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 batch_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("batch_plan.HopWindowNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for IcebergScanNode {
#[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.columns.is_empty() {
len += 1;
}
if !self.with_properties.is_empty() {
len += 1;
}
if !self.split.is_empty() {
len += 1;
}
if !self.secret_refs.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.IcebergScanNode", len)?;
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 !self.split.is_empty() {
struct_ser.serialize_field("split", &self.split.iter().map(pbjson::private::base64::encode).collect::<Vec<_>>())?;
}
if !self.secret_refs.is_empty() {
struct_ser.serialize_field("secretRefs", &self.secret_refs)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for IcebergScanNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"columns",
"with_properties",
"withProperties",
"split",
"secret_refs",
"secretRefs",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Columns,
WithProperties,
Split,
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 {
"columns" => Ok(GeneratedField::Columns),
"withProperties" | "with_properties" => Ok(GeneratedField::WithProperties),
"split" => Ok(GeneratedField::Split),
"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 = IcebergScanNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.IcebergScanNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<IcebergScanNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut columns__ = None;
let mut with_properties__ = None;
let mut split__ = None;
let mut secret_refs__ = None;
while let Some(k) = map_.next_key()? {
match k {
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::Split => {
if split__.is_some() {
return Err(serde::de::Error::duplicate_field("split"));
}
split__ =
Some(map_.next_value::<Vec<::pbjson::private::BytesDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
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(IcebergScanNode {
columns: columns__.unwrap_or_default(),
with_properties: with_properties__.unwrap_or_default(),
split: split__.unwrap_or_default(),
secret_refs: secret_refs__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.IcebergScanNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for InsertNode {
#[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_indices.is_empty() {
len += 1;
}
if self.default_columns.is_some() {
len += 1;
}
if self.row_id_index.is_some() {
len += 1;
}
if self.returning {
len += 1;
}
if self.session_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.InsertNode", 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_indices.is_empty() {
struct_ser.serialize_field("columnIndices", &self.column_indices)?;
}
if let Some(v) = self.default_columns.as_ref() {
struct_ser.serialize_field("defaultColumns", v)?;
}
if let Some(v) = self.row_id_index.as_ref() {
struct_ser.serialize_field("rowIdIndex", v)?;
}
if self.returning {
struct_ser.serialize_field("returning", &self.returning)?;
}
if self.session_id != 0 {
struct_ser.serialize_field("sessionId", &self.session_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for InsertNode {
#[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_indices",
"columnIndices",
"default_columns",
"defaultColumns",
"row_id_index",
"rowIdIndex",
"returning",
"session_id",
"sessionId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableId,
TableVersionId,
ColumnIndices,
DefaultColumns,
RowIdIndex,
Returning,
SessionId,
}
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),
"columnIndices" | "column_indices" => Ok(GeneratedField::ColumnIndices),
"defaultColumns" | "default_columns" => Ok(GeneratedField::DefaultColumns),
"rowIdIndex" | "row_id_index" => Ok(GeneratedField::RowIdIndex),
"returning" => Ok(GeneratedField::Returning),
"sessionId" | "session_id" => Ok(GeneratedField::SessionId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = InsertNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.InsertNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<InsertNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_id__ = None;
let mut table_version_id__ = None;
let mut column_indices__ = None;
let mut default_columns__ = None;
let mut row_id_index__ = None;
let mut returning__ = None;
let mut session_id__ = 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::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())
;
}
GeneratedField::DefaultColumns => {
if default_columns__.is_some() {
return Err(serde::de::Error::duplicate_field("defaultColumns"));
}
default_columns__ = 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::Returning => {
if returning__.is_some() {
return Err(serde::de::Error::duplicate_field("returning"));
}
returning__ = Some(map_.next_value()?);
}
GeneratedField::SessionId => {
if session_id__.is_some() {
return Err(serde::de::Error::duplicate_field("sessionId"));
}
session_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(InsertNode {
table_id: table_id__.unwrap_or_default(),
table_version_id: table_version_id__.unwrap_or_default(),
column_indices: column_indices__.unwrap_or_default(),
default_columns: default_columns__,
row_id_index: row_id_index__,
returning: returning__.unwrap_or_default(),
session_id: session_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.InsertNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for LimitNode {
#[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;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.LimitNode", 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())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for LimitNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"limit",
"offset",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Limit,
Offset,
}
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),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = LimitNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.LimitNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<LimitNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut limit__ = None;
let mut offset__ = 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)
;
}
}
}
Ok(LimitNode {
limit: limit__.unwrap_or_default(),
offset: offset__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.LimitNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for LocalExecutePlan {
#[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.plan.is_some() {
len += 1;
}
if self.epoch.is_some() {
len += 1;
}
if !self.tracing_context.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.LocalExecutePlan", len)?;
if let Some(v) = self.plan.as_ref() {
struct_ser.serialize_field("plan", v)?;
}
if let Some(v) = self.epoch.as_ref() {
struct_ser.serialize_field("epoch", v)?;
}
if !self.tracing_context.is_empty() {
struct_ser.serialize_field("tracingContext", &self.tracing_context)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for LocalExecutePlan {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"plan",
"epoch",
"tracing_context",
"tracingContext",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Plan,
Epoch,
TracingContext,
}
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 {
"plan" => Ok(GeneratedField::Plan),
"epoch" => Ok(GeneratedField::Epoch),
"tracingContext" | "tracing_context" => Ok(GeneratedField::TracingContext),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = LocalExecutePlan;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.LocalExecutePlan")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<LocalExecutePlan, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut plan__ = None;
let mut epoch__ = None;
let mut tracing_context__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Plan => {
if plan__.is_some() {
return Err(serde::de::Error::duplicate_field("plan"));
}
plan__ = map_.next_value()?;
}
GeneratedField::Epoch => {
if epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("epoch"));
}
epoch__ = 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<_, _>>()?
);
}
}
}
Ok(LocalExecutePlan {
plan: plan__,
epoch: epoch__,
tracing_context: tracing_context__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.LocalExecutePlan", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for LocalLookupJoinNode {
#[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.condition.is_some() {
len += 1;
}
if !self.outer_side_key.is_empty() {
len += 1;
}
if !self.inner_side_key.is_empty() {
len += 1;
}
if self.lookup_prefix_len != 0 {
len += 1;
}
if self.inner_side_table_desc.is_some() {
len += 1;
}
if !self.inner_side_vnode_mapping.is_empty() {
len += 1;
}
if !self.inner_side_column_ids.is_empty() {
len += 1;
}
if !self.output_indices.is_empty() {
len += 1;
}
if !self.worker_nodes.is_empty() {
len += 1;
}
if !self.null_safe.is_empty() {
len += 1;
}
if self.as_of.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.LocalLookupJoinNode", 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 let Some(v) = self.condition.as_ref() {
struct_ser.serialize_field("condition", v)?;
}
if !self.outer_side_key.is_empty() {
struct_ser.serialize_field("outerSideKey", &self.outer_side_key)?;
}
if !self.inner_side_key.is_empty() {
struct_ser.serialize_field("innerSideKey", &self.inner_side_key)?;
}
if self.lookup_prefix_len != 0 {
struct_ser.serialize_field("lookupPrefixLen", &self.lookup_prefix_len)?;
}
if let Some(v) = self.inner_side_table_desc.as_ref() {
struct_ser.serialize_field("innerSideTableDesc", v)?;
}
if !self.inner_side_vnode_mapping.is_empty() {
struct_ser.serialize_field("innerSideVnodeMapping", &self.inner_side_vnode_mapping.iter().map(ToString::to_string).collect::<Vec<_>>())?;
}
if !self.inner_side_column_ids.is_empty() {
struct_ser.serialize_field("innerSideColumnIds", &self.inner_side_column_ids)?;
}
if !self.output_indices.is_empty() {
struct_ser.serialize_field("outputIndices", &self.output_indices)?;
}
if !self.worker_nodes.is_empty() {
struct_ser.serialize_field("workerNodes", &self.worker_nodes)?;
}
if !self.null_safe.is_empty() {
struct_ser.serialize_field("nullSafe", &self.null_safe)?;
}
if let Some(v) = self.as_of.as_ref() {
struct_ser.serialize_field("asOf", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for LocalLookupJoinNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"join_type",
"joinType",
"condition",
"outer_side_key",
"outerSideKey",
"inner_side_key",
"innerSideKey",
"lookup_prefix_len",
"lookupPrefixLen",
"inner_side_table_desc",
"innerSideTableDesc",
"inner_side_vnode_mapping",
"innerSideVnodeMapping",
"inner_side_column_ids",
"innerSideColumnIds",
"output_indices",
"outputIndices",
"worker_nodes",
"workerNodes",
"null_safe",
"nullSafe",
"as_of",
"asOf",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
JoinType,
Condition,
OuterSideKey,
InnerSideKey,
LookupPrefixLen,
InnerSideTableDesc,
InnerSideVnodeMapping,
InnerSideColumnIds,
OutputIndices,
WorkerNodes,
NullSafe,
AsOf,
}
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),
"condition" => Ok(GeneratedField::Condition),
"outerSideKey" | "outer_side_key" => Ok(GeneratedField::OuterSideKey),
"innerSideKey" | "inner_side_key" => Ok(GeneratedField::InnerSideKey),
"lookupPrefixLen" | "lookup_prefix_len" => Ok(GeneratedField::LookupPrefixLen),
"innerSideTableDesc" | "inner_side_table_desc" => Ok(GeneratedField::InnerSideTableDesc),
"innerSideVnodeMapping" | "inner_side_vnode_mapping" => Ok(GeneratedField::InnerSideVnodeMapping),
"innerSideColumnIds" | "inner_side_column_ids" => Ok(GeneratedField::InnerSideColumnIds),
"outputIndices" | "output_indices" => Ok(GeneratedField::OutputIndices),
"workerNodes" | "worker_nodes" => Ok(GeneratedField::WorkerNodes),
"nullSafe" | "null_safe" => Ok(GeneratedField::NullSafe),
"asOf" | "as_of" => Ok(GeneratedField::AsOf),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = LocalLookupJoinNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.LocalLookupJoinNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<LocalLookupJoinNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut join_type__ = None;
let mut condition__ = None;
let mut outer_side_key__ = None;
let mut inner_side_key__ = None;
let mut lookup_prefix_len__ = None;
let mut inner_side_table_desc__ = None;
let mut inner_side_vnode_mapping__ = None;
let mut inner_side_column_ids__ = None;
let mut output_indices__ = None;
let mut worker_nodes__ = None;
let mut null_safe__ = None;
let mut as_of__ = 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::Condition => {
if condition__.is_some() {
return Err(serde::de::Error::duplicate_field("condition"));
}
condition__ = map_.next_value()?;
}
GeneratedField::OuterSideKey => {
if outer_side_key__.is_some() {
return Err(serde::de::Error::duplicate_field("outerSideKey"));
}
outer_side_key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::InnerSideKey => {
if inner_side_key__.is_some() {
return Err(serde::de::Error::duplicate_field("innerSideKey"));
}
inner_side_key__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::LookupPrefixLen => {
if lookup_prefix_len__.is_some() {
return Err(serde::de::Error::duplicate_field("lookupPrefixLen"));
}
lookup_prefix_len__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::InnerSideTableDesc => {
if inner_side_table_desc__.is_some() {
return Err(serde::de::Error::duplicate_field("innerSideTableDesc"));
}
inner_side_table_desc__ = map_.next_value()?;
}
GeneratedField::InnerSideVnodeMapping => {
if inner_side_vnode_mapping__.is_some() {
return Err(serde::de::Error::duplicate_field("innerSideVnodeMapping"));
}
inner_side_vnode_mapping__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::InnerSideColumnIds => {
if inner_side_column_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("innerSideColumnIds"));
}
inner_side_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::WorkerNodes => {
if worker_nodes__.is_some() {
return Err(serde::de::Error::duplicate_field("workerNodes"));
}
worker_nodes__ = Some(map_.next_value()?);
}
GeneratedField::NullSafe => {
if null_safe__.is_some() {
return Err(serde::de::Error::duplicate_field("nullSafe"));
}
null_safe__ = Some(map_.next_value()?);
}
GeneratedField::AsOf => {
if as_of__.is_some() {
return Err(serde::de::Error::duplicate_field("asOf"));
}
as_of__ = map_.next_value()?;
}
}
}
Ok(LocalLookupJoinNode {
join_type: join_type__.unwrap_or_default(),
condition: condition__,
outer_side_key: outer_side_key__.unwrap_or_default(),
inner_side_key: inner_side_key__.unwrap_or_default(),
lookup_prefix_len: lookup_prefix_len__.unwrap_or_default(),
inner_side_table_desc: inner_side_table_desc__,
inner_side_vnode_mapping: inner_side_vnode_mapping__.unwrap_or_default(),
inner_side_column_ids: inner_side_column_ids__.unwrap_or_default(),
output_indices: output_indices__.unwrap_or_default(),
worker_nodes: worker_nodes__.unwrap_or_default(),
null_safe: null_safe__.unwrap_or_default(),
as_of: as_of__,
})
}
}
deserializer.deserialize_struct("batch_plan.LocalLookupJoinNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for LogRowSeqScanNode {
#[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;
}
if self.vnode_bitmap.is_some() {
len += 1;
}
if self.old_epoch.is_some() {
len += 1;
}
if self.new_epoch.is_some() {
len += 1;
}
if self.ordered {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.LogRowSeqScanNode", 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)?;
}
if let Some(v) = self.vnode_bitmap.as_ref() {
struct_ser.serialize_field("vnodeBitmap", v)?;
}
if let Some(v) = self.old_epoch.as_ref() {
struct_ser.serialize_field("oldEpoch", v)?;
}
if let Some(v) = self.new_epoch.as_ref() {
struct_ser.serialize_field("newEpoch", v)?;
}
if self.ordered {
struct_ser.serialize_field("ordered", &self.ordered)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for LogRowSeqScanNode {
#[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",
"vnode_bitmap",
"vnodeBitmap",
"old_epoch",
"oldEpoch",
"new_epoch",
"newEpoch",
"ordered",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableDesc,
ColumnIds,
VnodeBitmap,
OldEpoch,
NewEpoch,
Ordered,
}
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),
"vnodeBitmap" | "vnode_bitmap" => Ok(GeneratedField::VnodeBitmap),
"oldEpoch" | "old_epoch" => Ok(GeneratedField::OldEpoch),
"newEpoch" | "new_epoch" => Ok(GeneratedField::NewEpoch),
"ordered" => Ok(GeneratedField::Ordered),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = LogRowSeqScanNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.LogRowSeqScanNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<LogRowSeqScanNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_desc__ = None;
let mut column_ids__ = None;
let mut vnode_bitmap__ = None;
let mut old_epoch__ = None;
let mut new_epoch__ = None;
let mut ordered__ = 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())
;
}
GeneratedField::VnodeBitmap => {
if vnode_bitmap__.is_some() {
return Err(serde::de::Error::duplicate_field("vnodeBitmap"));
}
vnode_bitmap__ = map_.next_value()?;
}
GeneratedField::OldEpoch => {
if old_epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("oldEpoch"));
}
old_epoch__ = map_.next_value()?;
}
GeneratedField::NewEpoch => {
if new_epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("newEpoch"));
}
new_epoch__ = map_.next_value()?;
}
GeneratedField::Ordered => {
if ordered__.is_some() {
return Err(serde::de::Error::duplicate_field("ordered"));
}
ordered__ = Some(map_.next_value()?);
}
}
}
Ok(LogRowSeqScanNode {
table_desc: table_desc__,
column_ids: column_ids__.unwrap_or_default(),
vnode_bitmap: vnode_bitmap__,
old_epoch: old_epoch__,
new_epoch: new_epoch__,
ordered: ordered__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.LogRowSeqScanNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for MaxOneRowNode {
#[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("batch_plan.MaxOneRowNode", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for MaxOneRowNode {
#[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 = MaxOneRowNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.MaxOneRowNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<MaxOneRowNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(MaxOneRowNode {
})
}
}
deserializer.deserialize_struct("batch_plan.MaxOneRowNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for MergeSortExchangeNode {
#[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.exchange.is_some() {
len += 1;
}
if !self.column_orders.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.MergeSortExchangeNode", len)?;
if let Some(v) = self.exchange.as_ref() {
struct_ser.serialize_field("exchange", v)?;
}
if !self.column_orders.is_empty() {
struct_ser.serialize_field("columnOrders", &self.column_orders)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for MergeSortExchangeNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"exchange",
"column_orders",
"columnOrders",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Exchange,
ColumnOrders,
}
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 {
"exchange" => Ok(GeneratedField::Exchange),
"columnOrders" | "column_orders" => Ok(GeneratedField::ColumnOrders),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = MergeSortExchangeNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.MergeSortExchangeNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<MergeSortExchangeNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut exchange__ = None;
let mut column_orders__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Exchange => {
if exchange__.is_some() {
return Err(serde::de::Error::duplicate_field("exchange"));
}
exchange__ = map_.next_value()?;
}
GeneratedField::ColumnOrders => {
if column_orders__.is_some() {
return Err(serde::de::Error::duplicate_field("columnOrders"));
}
column_orders__ = Some(map_.next_value()?);
}
}
}
Ok(MergeSortExchangeNode {
exchange: exchange__,
column_orders: column_orders__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.MergeSortExchangeNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for MySqlQueryNode {
#[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.columns.is_empty() {
len += 1;
}
if !self.hostname.is_empty() {
len += 1;
}
if !self.port.is_empty() {
len += 1;
}
if !self.username.is_empty() {
len += 1;
}
if !self.password.is_empty() {
len += 1;
}
if !self.database.is_empty() {
len += 1;
}
if !self.query.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.MySqlQueryNode", len)?;
if !self.columns.is_empty() {
struct_ser.serialize_field("columns", &self.columns)?;
}
if !self.hostname.is_empty() {
struct_ser.serialize_field("hostname", &self.hostname)?;
}
if !self.port.is_empty() {
struct_ser.serialize_field("port", &self.port)?;
}
if !self.username.is_empty() {
struct_ser.serialize_field("username", &self.username)?;
}
if !self.password.is_empty() {
struct_ser.serialize_field("password", &self.password)?;
}
if !self.database.is_empty() {
struct_ser.serialize_field("database", &self.database)?;
}
if !self.query.is_empty() {
struct_ser.serialize_field("query", &self.query)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for MySqlQueryNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"columns",
"hostname",
"port",
"username",
"password",
"database",
"query",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Columns,
Hostname,
Port,
Username,
Password,
Database,
Query,
}
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 {
"columns" => Ok(GeneratedField::Columns),
"hostname" => Ok(GeneratedField::Hostname),
"port" => Ok(GeneratedField::Port),
"username" => Ok(GeneratedField::Username),
"password" => Ok(GeneratedField::Password),
"database" => Ok(GeneratedField::Database),
"query" => Ok(GeneratedField::Query),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = MySqlQueryNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.MySqlQueryNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<MySqlQueryNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut columns__ = None;
let mut hostname__ = None;
let mut port__ = None;
let mut username__ = None;
let mut password__ = None;
let mut database__ = None;
let mut query__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Columns => {
if columns__.is_some() {
return Err(serde::de::Error::duplicate_field("columns"));
}
columns__ = Some(map_.next_value()?);
}
GeneratedField::Hostname => {
if hostname__.is_some() {
return Err(serde::de::Error::duplicate_field("hostname"));
}
hostname__ = Some(map_.next_value()?);
}
GeneratedField::Port => {
if port__.is_some() {
return Err(serde::de::Error::duplicate_field("port"));
}
port__ = Some(map_.next_value()?);
}
GeneratedField::Username => {
if username__.is_some() {
return Err(serde::de::Error::duplicate_field("username"));
}
username__ = Some(map_.next_value()?);
}
GeneratedField::Password => {
if password__.is_some() {
return Err(serde::de::Error::duplicate_field("password"));
}
password__ = Some(map_.next_value()?);
}
GeneratedField::Database => {
if database__.is_some() {
return Err(serde::de::Error::duplicate_field("database"));
}
database__ = Some(map_.next_value()?);
}
GeneratedField::Query => {
if query__.is_some() {
return Err(serde::de::Error::duplicate_field("query"));
}
query__ = Some(map_.next_value()?);
}
}
}
Ok(MySqlQueryNode {
columns: columns__.unwrap_or_default(),
hostname: hostname__.unwrap_or_default(),
port: port__.unwrap_or_default(),
username: username__.unwrap_or_default(),
password: password__.unwrap_or_default(),
database: database__.unwrap_or_default(),
query: query__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.MySqlQueryNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for NestedLoopJoinNode {
#[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.join_cond.is_some() {
len += 1;
}
if !self.output_indices.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.NestedLoopJoinNode", 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 let Some(v) = self.join_cond.as_ref() {
struct_ser.serialize_field("joinCond", v)?;
}
if !self.output_indices.is_empty() {
struct_ser.serialize_field("outputIndices", &self.output_indices)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for NestedLoopJoinNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"join_type",
"joinType",
"join_cond",
"joinCond",
"output_indices",
"outputIndices",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
JoinType,
JoinCond,
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),
"joinCond" | "join_cond" => Ok(GeneratedField::JoinCond),
"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 = NestedLoopJoinNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.NestedLoopJoinNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<NestedLoopJoinNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut join_type__ = None;
let mut join_cond__ = 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::JoinCond => {
if join_cond__.is_some() {
return Err(serde::de::Error::duplicate_field("joinCond"));
}
join_cond__ = 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(NestedLoopJoinNode {
join_type: join_type__.unwrap_or_default(),
join_cond: join_cond__,
output_indices: output_indices__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.NestedLoopJoinNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for PlanFragment {
#[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.root.is_some() {
len += 1;
}
if self.exchange_info.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.PlanFragment", len)?;
if let Some(v) = self.root.as_ref() {
struct_ser.serialize_field("root", v)?;
}
if let Some(v) = self.exchange_info.as_ref() {
struct_ser.serialize_field("exchangeInfo", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for PlanFragment {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"root",
"exchange_info",
"exchangeInfo",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Root,
ExchangeInfo,
}
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 {
"root" => Ok(GeneratedField::Root),
"exchangeInfo" | "exchange_info" => Ok(GeneratedField::ExchangeInfo),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = PlanFragment;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.PlanFragment")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<PlanFragment, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut root__ = None;
let mut exchange_info__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Root => {
if root__.is_some() {
return Err(serde::de::Error::duplicate_field("root"));
}
root__ = map_.next_value()?;
}
GeneratedField::ExchangeInfo => {
if exchange_info__.is_some() {
return Err(serde::de::Error::duplicate_field("exchangeInfo"));
}
exchange_info__ = map_.next_value()?;
}
}
}
Ok(PlanFragment {
root: root__,
exchange_info: exchange_info__,
})
}
}
deserializer.deserialize_struct("batch_plan.PlanFragment", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for PlanNode {
#[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.children.is_empty() {
len += 1;
}
if !self.identity.is_empty() {
len += 1;
}
if self.node_body.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.PlanNode", len)?;
if !self.children.is_empty() {
struct_ser.serialize_field("children", &self.children)?;
}
if !self.identity.is_empty() {
struct_ser.serialize_field("identity", &self.identity)?;
}
if let Some(v) = self.node_body.as_ref() {
match v {
plan_node::NodeBody::Insert(v) => {
struct_ser.serialize_field("insert", v)?;
}
plan_node::NodeBody::Delete(v) => {
struct_ser.serialize_field("delete", v)?;
}
plan_node::NodeBody::Update(v) => {
struct_ser.serialize_field("update", v)?;
}
plan_node::NodeBody::Project(v) => {
struct_ser.serialize_field("project", v)?;
}
plan_node::NodeBody::HashAgg(v) => {
struct_ser.serialize_field("hashAgg", v)?;
}
plan_node::NodeBody::Filter(v) => {
struct_ser.serialize_field("filter", v)?;
}
plan_node::NodeBody::Exchange(v) => {
struct_ser.serialize_field("exchange", v)?;
}
plan_node::NodeBody::Sort(v) => {
struct_ser.serialize_field("sort", v)?;
}
plan_node::NodeBody::NestedLoopJoin(v) => {
struct_ser.serialize_field("nestedLoopJoin", v)?;
}
plan_node::NodeBody::TopN(v) => {
struct_ser.serialize_field("topN", v)?;
}
plan_node::NodeBody::SortAgg(v) => {
struct_ser.serialize_field("sortAgg", v)?;
}
plan_node::NodeBody::RowSeqScan(v) => {
struct_ser.serialize_field("rowSeqScan", v)?;
}
plan_node::NodeBody::Limit(v) => {
struct_ser.serialize_field("limit", v)?;
}
plan_node::NodeBody::Values(v) => {
struct_ser.serialize_field("values", v)?;
}
plan_node::NodeBody::HashJoin(v) => {
struct_ser.serialize_field("hashJoin", v)?;
}
plan_node::NodeBody::MergeSortExchange(v) => {
struct_ser.serialize_field("mergeSortExchange", v)?;
}
plan_node::NodeBody::HopWindow(v) => {
struct_ser.serialize_field("hopWindow", v)?;
}
plan_node::NodeBody::TableFunction(v) => {
struct_ser.serialize_field("tableFunction", v)?;
}
plan_node::NodeBody::SysRowSeqScan(v) => {
struct_ser.serialize_field("sysRowSeqScan", v)?;
}
plan_node::NodeBody::Expand(v) => {
struct_ser.serialize_field("expand", v)?;
}
plan_node::NodeBody::LocalLookupJoin(v) => {
struct_ser.serialize_field("localLookupJoin", v)?;
}
plan_node::NodeBody::ProjectSet(v) => {
struct_ser.serialize_field("projectSet", v)?;
}
plan_node::NodeBody::Union(v) => {
struct_ser.serialize_field("union", v)?;
}
plan_node::NodeBody::GroupTopN(v) => {
struct_ser.serialize_field("groupTopN", v)?;
}
plan_node::NodeBody::DistributedLookupJoin(v) => {
struct_ser.serialize_field("distributedLookupJoin", v)?;
}
plan_node::NodeBody::Source(v) => {
struct_ser.serialize_field("source", v)?;
}
plan_node::NodeBody::SortOverWindow(v) => {
struct_ser.serialize_field("sortOverWindow", v)?;
}
plan_node::NodeBody::MaxOneRow(v) => {
struct_ser.serialize_field("maxOneRow", v)?;
}
plan_node::NodeBody::LogRowSeqScan(v) => {
struct_ser.serialize_field("logRowSeqScan", v)?;
}
plan_node::NodeBody::FileScan(v) => {
struct_ser.serialize_field("fileScan", v)?;
}
plan_node::NodeBody::IcebergScan(v) => {
struct_ser.serialize_field("icebergScan", v)?;
}
plan_node::NodeBody::PostgresQuery(v) => {
struct_ser.serialize_field("postgresQuery", v)?;
}
plan_node::NodeBody::MysqlQuery(v) => {
struct_ser.serialize_field("mysqlQuery", v)?;
}
plan_node::NodeBody::BlockExecutor(v) => {
struct_ser.serialize_field("blockExecutor", v)?;
}
plan_node::NodeBody::BusyLoopExecutor(v) => {
struct_ser.serialize_field("busyLoopExecutor", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for PlanNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"children",
"identity",
"insert",
"delete",
"update",
"project",
"hash_agg",
"hashAgg",
"filter",
"exchange",
"sort",
"nested_loop_join",
"nestedLoopJoin",
"top_n",
"topN",
"sort_agg",
"sortAgg",
"row_seq_scan",
"rowSeqScan",
"limit",
"values",
"hash_join",
"hashJoin",
"merge_sort_exchange",
"mergeSortExchange",
"hop_window",
"hopWindow",
"table_function",
"tableFunction",
"sys_row_seq_scan",
"sysRowSeqScan",
"expand",
"local_lookup_join",
"localLookupJoin",
"project_set",
"projectSet",
"union",
"group_top_n",
"groupTopN",
"distributed_lookup_join",
"distributedLookupJoin",
"source",
"sort_over_window",
"sortOverWindow",
"max_one_row",
"maxOneRow",
"log_row_seq_scan",
"logRowSeqScan",
"file_scan",
"fileScan",
"iceberg_scan",
"icebergScan",
"postgres_query",
"postgresQuery",
"mysql_query",
"mysqlQuery",
"block_executor",
"blockExecutor",
"busy_loop_executor",
"busyLoopExecutor",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Children,
Identity,
Insert,
Delete,
Update,
Project,
HashAgg,
Filter,
Exchange,
Sort,
NestedLoopJoin,
TopN,
SortAgg,
RowSeqScan,
Limit,
Values,
HashJoin,
MergeSortExchange,
HopWindow,
TableFunction,
SysRowSeqScan,
Expand,
LocalLookupJoin,
ProjectSet,
Union,
GroupTopN,
DistributedLookupJoin,
Source,
SortOverWindow,
MaxOneRow,
LogRowSeqScan,
FileScan,
IcebergScan,
PostgresQuery,
MysqlQuery,
BlockExecutor,
BusyLoopExecutor,
}
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 {
"children" => Ok(GeneratedField::Children),
"identity" => Ok(GeneratedField::Identity),
"insert" => Ok(GeneratedField::Insert),
"delete" => Ok(GeneratedField::Delete),
"update" => Ok(GeneratedField::Update),
"project" => Ok(GeneratedField::Project),
"hashAgg" | "hash_agg" => Ok(GeneratedField::HashAgg),
"filter" => Ok(GeneratedField::Filter),
"exchange" => Ok(GeneratedField::Exchange),
"sort" => Ok(GeneratedField::Sort),
"nestedLoopJoin" | "nested_loop_join" => Ok(GeneratedField::NestedLoopJoin),
"topN" | "top_n" => Ok(GeneratedField::TopN),
"sortAgg" | "sort_agg" => Ok(GeneratedField::SortAgg),
"rowSeqScan" | "row_seq_scan" => Ok(GeneratedField::RowSeqScan),
"limit" => Ok(GeneratedField::Limit),
"values" => Ok(GeneratedField::Values),
"hashJoin" | "hash_join" => Ok(GeneratedField::HashJoin),
"mergeSortExchange" | "merge_sort_exchange" => Ok(GeneratedField::MergeSortExchange),
"hopWindow" | "hop_window" => Ok(GeneratedField::HopWindow),
"tableFunction" | "table_function" => Ok(GeneratedField::TableFunction),
"sysRowSeqScan" | "sys_row_seq_scan" => Ok(GeneratedField::SysRowSeqScan),
"expand" => Ok(GeneratedField::Expand),
"localLookupJoin" | "local_lookup_join" => Ok(GeneratedField::LocalLookupJoin),
"projectSet" | "project_set" => Ok(GeneratedField::ProjectSet),
"union" => Ok(GeneratedField::Union),
"groupTopN" | "group_top_n" => Ok(GeneratedField::GroupTopN),
"distributedLookupJoin" | "distributed_lookup_join" => Ok(GeneratedField::DistributedLookupJoin),
"source" => Ok(GeneratedField::Source),
"sortOverWindow" | "sort_over_window" => Ok(GeneratedField::SortOverWindow),
"maxOneRow" | "max_one_row" => Ok(GeneratedField::MaxOneRow),
"logRowSeqScan" | "log_row_seq_scan" => Ok(GeneratedField::LogRowSeqScan),
"fileScan" | "file_scan" => Ok(GeneratedField::FileScan),
"icebergScan" | "iceberg_scan" => Ok(GeneratedField::IcebergScan),
"postgresQuery" | "postgres_query" => Ok(GeneratedField::PostgresQuery),
"mysqlQuery" | "mysql_query" => Ok(GeneratedField::MysqlQuery),
"blockExecutor" | "block_executor" => Ok(GeneratedField::BlockExecutor),
"busyLoopExecutor" | "busy_loop_executor" => Ok(GeneratedField::BusyLoopExecutor),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = PlanNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.PlanNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<PlanNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut children__ = None;
let mut identity__ = None;
let mut node_body__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Children => {
if children__.is_some() {
return Err(serde::de::Error::duplicate_field("children"));
}
children__ = Some(map_.next_value()?);
}
GeneratedField::Identity => {
if identity__.is_some() {
return Err(serde::de::Error::duplicate_field("identity"));
}
identity__ = Some(map_.next_value()?);
}
GeneratedField::Insert => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("insert"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Insert)
;
}
GeneratedField::Delete => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("delete"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Delete)
;
}
GeneratedField::Update => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("update"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Update)
;
}
GeneratedField::Project => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("project"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Project)
;
}
GeneratedField::HashAgg => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("hashAgg"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::HashAgg)
;
}
GeneratedField::Filter => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("filter"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Filter)
;
}
GeneratedField::Exchange => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("exchange"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Exchange)
;
}
GeneratedField::Sort => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("sort"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Sort)
;
}
GeneratedField::NestedLoopJoin => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("nestedLoopJoin"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::NestedLoopJoin)
;
}
GeneratedField::TopN => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("topN"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::TopN)
;
}
GeneratedField::SortAgg => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("sortAgg"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::SortAgg)
;
}
GeneratedField::RowSeqScan => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("rowSeqScan"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::RowSeqScan)
;
}
GeneratedField::Limit => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("limit"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Limit)
;
}
GeneratedField::Values => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("values"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Values)
;
}
GeneratedField::HashJoin => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("hashJoin"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::HashJoin)
;
}
GeneratedField::MergeSortExchange => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("mergeSortExchange"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::MergeSortExchange)
;
}
GeneratedField::HopWindow => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("hopWindow"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::HopWindow)
;
}
GeneratedField::TableFunction => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("tableFunction"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::TableFunction)
;
}
GeneratedField::SysRowSeqScan => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("sysRowSeqScan"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::SysRowSeqScan)
;
}
GeneratedField::Expand => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("expand"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Expand)
;
}
GeneratedField::LocalLookupJoin => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("localLookupJoin"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::LocalLookupJoin)
;
}
GeneratedField::ProjectSet => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("projectSet"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::ProjectSet)
;
}
GeneratedField::Union => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("union"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Union)
;
}
GeneratedField::GroupTopN => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("groupTopN"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::GroupTopN)
;
}
GeneratedField::DistributedLookupJoin => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("distributedLookupJoin"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::DistributedLookupJoin)
;
}
GeneratedField::Source => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("source"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::Source)
;
}
GeneratedField::SortOverWindow => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("sortOverWindow"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::SortOverWindow)
;
}
GeneratedField::MaxOneRow => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("maxOneRow"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::MaxOneRow)
;
}
GeneratedField::LogRowSeqScan => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("logRowSeqScan"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::LogRowSeqScan)
;
}
GeneratedField::FileScan => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("fileScan"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::FileScan)
;
}
GeneratedField::IcebergScan => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("icebergScan"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::IcebergScan)
;
}
GeneratedField::PostgresQuery => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("postgresQuery"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::PostgresQuery)
;
}
GeneratedField::MysqlQuery => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("mysqlQuery"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::MysqlQuery)
;
}
GeneratedField::BlockExecutor => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("blockExecutor"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::BlockExecutor);
}
GeneratedField::BusyLoopExecutor => {
if node_body__.is_some() {
return Err(serde::de::Error::duplicate_field("busyLoopExecutor"));
}
node_body__ = map_.next_value::<::std::option::Option<_>>()?.map(plan_node::NodeBody::BusyLoopExecutor);
}
}
}
Ok(PlanNode {
children: children__.unwrap_or_default(),
identity: identity__.unwrap_or_default(),
node_body: node_body__,
})
}
}
deserializer.deserialize_struct("batch_plan.PlanNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for PostgresQueryNode {
#[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.columns.is_empty() {
len += 1;
}
if !self.hostname.is_empty() {
len += 1;
}
if !self.port.is_empty() {
len += 1;
}
if !self.username.is_empty() {
len += 1;
}
if !self.password.is_empty() {
len += 1;
}
if !self.database.is_empty() {
len += 1;
}
if !self.query.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.PostgresQueryNode", len)?;
if !self.columns.is_empty() {
struct_ser.serialize_field("columns", &self.columns)?;
}
if !self.hostname.is_empty() {
struct_ser.serialize_field("hostname", &self.hostname)?;
}
if !self.port.is_empty() {
struct_ser.serialize_field("port", &self.port)?;
}
if !self.username.is_empty() {
struct_ser.serialize_field("username", &self.username)?;
}
if !self.password.is_empty() {
struct_ser.serialize_field("password", &self.password)?;
}
if !self.database.is_empty() {
struct_ser.serialize_field("database", &self.database)?;
}
if !self.query.is_empty() {
struct_ser.serialize_field("query", &self.query)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for PostgresQueryNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"columns",
"hostname",
"port",
"username",
"password",
"database",
"query",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Columns,
Hostname,
Port,
Username,
Password,
Database,
Query,
}
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 {
"columns" => Ok(GeneratedField::Columns),
"hostname" => Ok(GeneratedField::Hostname),
"port" => Ok(GeneratedField::Port),
"username" => Ok(GeneratedField::Username),
"password" => Ok(GeneratedField::Password),
"database" => Ok(GeneratedField::Database),
"query" => Ok(GeneratedField::Query),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = PostgresQueryNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.PostgresQueryNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<PostgresQueryNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut columns__ = None;
let mut hostname__ = None;
let mut port__ = None;
let mut username__ = None;
let mut password__ = None;
let mut database__ = None;
let mut query__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Columns => {
if columns__.is_some() {
return Err(serde::de::Error::duplicate_field("columns"));
}
columns__ = Some(map_.next_value()?);
}
GeneratedField::Hostname => {
if hostname__.is_some() {
return Err(serde::de::Error::duplicate_field("hostname"));
}
hostname__ = Some(map_.next_value()?);
}
GeneratedField::Port => {
if port__.is_some() {
return Err(serde::de::Error::duplicate_field("port"));
}
port__ = Some(map_.next_value()?);
}
GeneratedField::Username => {
if username__.is_some() {
return Err(serde::de::Error::duplicate_field("username"));
}
username__ = Some(map_.next_value()?);
}
GeneratedField::Password => {
if password__.is_some() {
return Err(serde::de::Error::duplicate_field("password"));
}
password__ = Some(map_.next_value()?);
}
GeneratedField::Database => {
if database__.is_some() {
return Err(serde::de::Error::duplicate_field("database"));
}
database__ = Some(map_.next_value()?);
}
GeneratedField::Query => {
if query__.is_some() {
return Err(serde::de::Error::duplicate_field("query"));
}
query__ = Some(map_.next_value()?);
}
}
}
Ok(PostgresQueryNode {
columns: columns__.unwrap_or_default(),
hostname: hostname__.unwrap_or_default(),
port: port__.unwrap_or_default(),
username: username__.unwrap_or_default(),
password: password__.unwrap_or_default(),
database: database__.unwrap_or_default(),
query: query__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.PostgresQueryNode", 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;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.ProjectNode", len)?;
if !self.select_list.is_empty() {
struct_ser.serialize_field("selectList", &self.select_list)?;
}
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",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SelectList,
}
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),
_ => 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 batch_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;
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()?);
}
}
}
Ok(ProjectNode {
select_list: select_list__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_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;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.ProjectSetNode", len)?;
if !self.select_list.is_empty() {
struct_ser.serialize_field("selectList", &self.select_list)?;
}
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",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SelectList,
}
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),
_ => 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 batch_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;
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()?);
}
}
}
Ok(ProjectSetNode {
select_list: select_list__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.ProjectSetNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RowSeqScanNode {
#[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;
}
if !self.scan_ranges.is_empty() {
len += 1;
}
if self.vnode_bitmap.is_some() {
len += 1;
}
if self.ordered {
len += 1;
}
if self.limit.is_some() {
len += 1;
}
if self.as_of.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.RowSeqScanNode", 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)?;
}
if !self.scan_ranges.is_empty() {
struct_ser.serialize_field("scanRanges", &self.scan_ranges)?;
}
if let Some(v) = self.vnode_bitmap.as_ref() {
struct_ser.serialize_field("vnodeBitmap", v)?;
}
if self.ordered {
struct_ser.serialize_field("ordered", &self.ordered)?;
}
if let Some(v) = self.limit.as_ref() {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("limit", ToString::to_string(&v).as_str())?;
}
if let Some(v) = self.as_of.as_ref() {
struct_ser.serialize_field("asOf", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RowSeqScanNode {
#[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",
"scan_ranges",
"scanRanges",
"vnode_bitmap",
"vnodeBitmap",
"ordered",
"limit",
"as_of",
"asOf",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableDesc,
ColumnIds,
ScanRanges,
VnodeBitmap,
Ordered,
Limit,
AsOf,
}
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),
"scanRanges" | "scan_ranges" => Ok(GeneratedField::ScanRanges),
"vnodeBitmap" | "vnode_bitmap" => Ok(GeneratedField::VnodeBitmap),
"ordered" => Ok(GeneratedField::Ordered),
"limit" => Ok(GeneratedField::Limit),
"asOf" | "as_of" => Ok(GeneratedField::AsOf),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RowSeqScanNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.RowSeqScanNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RowSeqScanNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_desc__ = None;
let mut column_ids__ = None;
let mut scan_ranges__ = None;
let mut vnode_bitmap__ = None;
let mut ordered__ = None;
let mut limit__ = None;
let mut as_of__ = 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())
;
}
GeneratedField::ScanRanges => {
if scan_ranges__.is_some() {
return Err(serde::de::Error::duplicate_field("scanRanges"));
}
scan_ranges__ = Some(map_.next_value()?);
}
GeneratedField::VnodeBitmap => {
if vnode_bitmap__.is_some() {
return Err(serde::de::Error::duplicate_field("vnodeBitmap"));
}
vnode_bitmap__ = map_.next_value()?;
}
GeneratedField::Ordered => {
if ordered__.is_some() {
return Err(serde::de::Error::duplicate_field("ordered"));
}
ordered__ = Some(map_.next_value()?);
}
GeneratedField::Limit => {
if limit__.is_some() {
return Err(serde::de::Error::duplicate_field("limit"));
}
limit__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::AsOf => {
if as_of__.is_some() {
return Err(serde::de::Error::duplicate_field("asOf"));
}
as_of__ = map_.next_value()?;
}
}
}
Ok(RowSeqScanNode {
table_desc: table_desc__,
column_ids: column_ids__.unwrap_or_default(),
scan_ranges: scan_ranges__.unwrap_or_default(),
vnode_bitmap: vnode_bitmap__,
ordered: ordered__.unwrap_or_default(),
limit: limit__,
as_of: as_of__,
})
}
}
deserializer.deserialize_struct("batch_plan.RowSeqScanNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ScanRange {
#[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.eq_conds.is_empty() {
len += 1;
}
if self.lower_bound.is_some() {
len += 1;
}
if self.upper_bound.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.ScanRange", len)?;
if !self.eq_conds.is_empty() {
struct_ser.serialize_field("eqConds", &self.eq_conds.iter().map(pbjson::private::base64::encode).collect::<Vec<_>>())?;
}
if let Some(v) = self.lower_bound.as_ref() {
struct_ser.serialize_field("lowerBound", v)?;
}
if let Some(v) = self.upper_bound.as_ref() {
struct_ser.serialize_field("upperBound", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ScanRange {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"eq_conds",
"eqConds",
"lower_bound",
"lowerBound",
"upper_bound",
"upperBound",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
EqConds,
LowerBound,
UpperBound,
}
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 {
"eqConds" | "eq_conds" => Ok(GeneratedField::EqConds),
"lowerBound" | "lower_bound" => Ok(GeneratedField::LowerBound),
"upperBound" | "upper_bound" => Ok(GeneratedField::UpperBound),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ScanRange;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.ScanRange")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ScanRange, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut eq_conds__ = None;
let mut lower_bound__ = None;
let mut upper_bound__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::EqConds => {
if eq_conds__.is_some() {
return Err(serde::de::Error::duplicate_field("eqConds"));
}
eq_conds__ =
Some(map_.next_value::<Vec<::pbjson::private::BytesDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::LowerBound => {
if lower_bound__.is_some() {
return Err(serde::de::Error::duplicate_field("lowerBound"));
}
lower_bound__ = map_.next_value()?;
}
GeneratedField::UpperBound => {
if upper_bound__.is_some() {
return Err(serde::de::Error::duplicate_field("upperBound"));
}
upper_bound__ = map_.next_value()?;
}
}
}
Ok(ScanRange {
eq_conds: eq_conds__.unwrap_or_default(),
lower_bound: lower_bound__,
upper_bound: upper_bound__,
})
}
}
deserializer.deserialize_struct("batch_plan.ScanRange", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for scan_range::Bound {
#[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.value.is_empty() {
len += 1;
}
if self.inclusive {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.ScanRange.Bound", len)?;
if !self.value.is_empty() {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?;
}
if self.inclusive {
struct_ser.serialize_field("inclusive", &self.inclusive)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for scan_range::Bound {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"value",
"inclusive",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Value,
Inclusive,
}
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 {
"value" => Ok(GeneratedField::Value),
"inclusive" => Ok(GeneratedField::Inclusive),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = scan_range::Bound;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.ScanRange.Bound")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<scan_range::Bound, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut value__ = None;
let mut inclusive__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Value => {
if value__.is_some() {
return Err(serde::de::Error::duplicate_field("value"));
}
value__ =
Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0)
;
}
GeneratedField::Inclusive => {
if inclusive__.is_some() {
return Err(serde::de::Error::duplicate_field("inclusive"));
}
inclusive__ = Some(map_.next_value()?);
}
}
}
Ok(scan_range::Bound {
value: value__.unwrap_or_default(),
inclusive: inclusive__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.ScanRange.Bound", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SortAggNode {
#[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;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.SortAggNode", 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)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SortAggNode {
#[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",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
GroupKey,
AggCalls,
}
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),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SortAggNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.SortAggNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SortAggNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut group_key__ = None;
let mut agg_calls__ = 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()?);
}
GeneratedField::AggCalls => {
if agg_calls__.is_some() {
return Err(serde::de::Error::duplicate_field("aggCalls"));
}
agg_calls__ = Some(map_.next_value()?);
}
}
}
Ok(SortAggNode {
group_key: group_key__.unwrap_or_default(),
agg_calls: agg_calls__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.SortAggNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SortMergeJoinNode {
#[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.direction != 0 {
len += 1;
}
if !self.output_indices.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.SortMergeJoinNode", 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.direction != 0 {
let v = super::common::Direction::try_from(self.direction)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.direction)))?;
struct_ser.serialize_field("direction", &v)?;
}
if !self.output_indices.is_empty() {
struct_ser.serialize_field("outputIndices", &self.output_indices)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SortMergeJoinNode {
#[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",
"direction",
"output_indices",
"outputIndices",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
JoinType,
LeftKey,
RightKey,
Direction,
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),
"direction" => Ok(GeneratedField::Direction),
"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 = SortMergeJoinNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.SortMergeJoinNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SortMergeJoinNode, 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 direction__ = 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::Direction => {
if direction__.is_some() {
return Err(serde::de::Error::duplicate_field("direction"));
}
direction__ = Some(map_.next_value::<super::common::Direction>()? as i32);
}
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(SortMergeJoinNode {
join_type: join_type__.unwrap_or_default(),
left_key: left_key__.unwrap_or_default(),
right_key: right_key__.unwrap_or_default(),
direction: direction__.unwrap_or_default(),
output_indices: output_indices__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.SortMergeJoinNode", 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.column_orders.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.SortNode", len)?;
if !self.column_orders.is_empty() {
struct_ser.serialize_field("columnOrders", &self.column_orders)?;
}
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] = &[
"column_orders",
"columnOrders",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ColumnOrders,
}
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 {
"columnOrders" | "column_orders" => Ok(GeneratedField::ColumnOrders),
_ => 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 batch_plan.SortNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SortNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut column_orders__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ColumnOrders => {
if column_orders__.is_some() {
return Err(serde::de::Error::duplicate_field("columnOrders"));
}
column_orders__ = Some(map_.next_value()?);
}
}
}
Ok(SortNode {
column_orders: column_orders__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.SortNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SortOverWindowNode {
#[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;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.SortOverWindowNode", 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)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SortOverWindowNode {
#[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",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Calls,
PartitionBy,
OrderBy,
}
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),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SortOverWindowNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.SortOverWindowNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SortOverWindowNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut calls__ = None;
let mut partition_by__ = None;
let mut order_by__ = 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()?);
}
}
}
Ok(SortOverWindowNode {
calls: calls__.unwrap_or_default(),
partition_by: partition_by__.unwrap_or_default(),
order_by: order_by__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.SortOverWindowNode", 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_id != 0 {
len += 1;
}
if !self.columns.is_empty() {
len += 1;
}
if !self.with_properties.is_empty() {
len += 1;
}
if !self.split.is_empty() {
len += 1;
}
if self.info.is_some() {
len += 1;
}
if !self.secret_refs.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.SourceNode", len)?;
if self.source_id != 0 {
struct_ser.serialize_field("sourceId", &self.source_id)?;
}
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 !self.split.is_empty() {
struct_ser.serialize_field("split", &self.split.iter().map(pbjson::private::base64::encode).collect::<Vec<_>>())?;
}
if let Some(v) = self.info.as_ref() {
struct_ser.serialize_field("info", v)?;
}
if !self.secret_refs.is_empty() {
struct_ser.serialize_field("secretRefs", &self.secret_refs)?;
}
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_id",
"sourceId",
"columns",
"with_properties",
"withProperties",
"split",
"info",
"secret_refs",
"secretRefs",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SourceId,
Columns,
WithProperties,
Split,
Info,
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),
"columns" => Ok(GeneratedField::Columns),
"withProperties" | "with_properties" => Ok(GeneratedField::WithProperties),
"split" => Ok(GeneratedField::Split),
"info" => Ok(GeneratedField::Info),
"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 = SourceNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_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_id__ = None;
let mut columns__ = None;
let mut with_properties__ = None;
let mut split__ = None;
let mut info__ = 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::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::Split => {
if split__.is_some() {
return Err(serde::de::Error::duplicate_field("split"));
}
split__ =
Some(map_.next_value::<Vec<::pbjson::private::BytesDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::Info => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("info"));
}
info__ = 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(SourceNode {
source_id: source_id__.unwrap_or_default(),
columns: columns__.unwrap_or_default(),
with_properties: with_properties__.unwrap_or_default(),
split: split__.unwrap_or_default(),
info: info__,
secret_refs: secret_refs__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.SourceNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SysRowSeqScanNode {
#[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_descs.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.SysRowSeqScanNode", len)?;
if self.table_id != 0 {
struct_ser.serialize_field("tableId", &self.table_id)?;
}
if !self.column_descs.is_empty() {
struct_ser.serialize_field("columnDescs", &self.column_descs)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SysRowSeqScanNode {
#[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_descs",
"columnDescs",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableId,
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),
"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 = SysRowSeqScanNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.SysRowSeqScanNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SysRowSeqScanNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_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::ColumnDescs => {
if column_descs__.is_some() {
return Err(serde::de::Error::duplicate_field("columnDescs"));
}
column_descs__ = Some(map_.next_value()?);
}
}
}
Ok(SysRowSeqScanNode {
table_id: table_id__.unwrap_or_default(),
column_descs: column_descs__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.SysRowSeqScanNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for TableFunctionNode {
#[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_function.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.TableFunctionNode", len)?;
if let Some(v) = self.table_function.as_ref() {
struct_ser.serialize_field("tableFunction", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TableFunctionNode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table_function",
"tableFunction",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableFunction,
}
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 {
"tableFunction" | "table_function" => Ok(GeneratedField::TableFunction),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TableFunctionNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.TableFunctionNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TableFunctionNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_function__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TableFunction => {
if table_function__.is_some() {
return Err(serde::de::Error::duplicate_field("tableFunction"));
}
table_function__ = map_.next_value()?;
}
}
}
Ok(TableFunctionNode {
table_function: table_function__,
})
}
}
deserializer.deserialize_struct("batch_plan.TableFunctionNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for TaskId {
#[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.query_id.is_empty() {
len += 1;
}
if self.stage_id != 0 {
len += 1;
}
if self.task_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.TaskId", len)?;
if !self.query_id.is_empty() {
struct_ser.serialize_field("queryId", &self.query_id)?;
}
if self.stage_id != 0 {
struct_ser.serialize_field("stageId", &self.stage_id)?;
}
if self.task_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("taskId", ToString::to_string(&self.task_id).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TaskId {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"query_id",
"queryId",
"stage_id",
"stageId",
"task_id",
"taskId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
QueryId,
StageId,
TaskId,
}
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 {
"queryId" | "query_id" => Ok(GeneratedField::QueryId),
"stageId" | "stage_id" => Ok(GeneratedField::StageId),
"taskId" | "task_id" => Ok(GeneratedField::TaskId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TaskId;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.TaskId")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TaskId, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut query_id__ = None;
let mut stage_id__ = None;
let mut task_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::QueryId => {
if query_id__.is_some() {
return Err(serde::de::Error::duplicate_field("queryId"));
}
query_id__ = Some(map_.next_value()?);
}
GeneratedField::StageId => {
if stage_id__.is_some() {
return Err(serde::de::Error::duplicate_field("stageId"));
}
stage_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TaskId => {
if task_id__.is_some() {
return Err(serde::de::Error::duplicate_field("taskId"));
}
task_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(TaskId {
query_id: query_id__.unwrap_or_default(),
stage_id: stage_id__.unwrap_or_default(),
task_id: task_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.TaskId", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for TaskOutputId {
#[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.task_id.is_some() {
len += 1;
}
if self.output_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.TaskOutputId", len)?;
if let Some(v) = self.task_id.as_ref() {
struct_ser.serialize_field("taskId", v)?;
}
if self.output_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("outputId", ToString::to_string(&self.output_id).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TaskOutputId {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"task_id",
"taskId",
"output_id",
"outputId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TaskId,
OutputId,
}
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 {
"taskId" | "task_id" => Ok(GeneratedField::TaskId),
"outputId" | "output_id" => Ok(GeneratedField::OutputId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TaskOutputId;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.TaskOutputId")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TaskOutputId, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut task_id__ = None;
let mut output_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TaskId => {
if task_id__.is_some() {
return Err(serde::de::Error::duplicate_field("taskId"));
}
task_id__ = map_.next_value()?;
}
GeneratedField::OutputId => {
if output_id__.is_some() {
return Err(serde::de::Error::duplicate_field("outputId"));
}
output_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(TaskOutputId {
task_id: task_id__,
output_id: output_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.TaskOutputId", 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.column_orders.is_empty() {
len += 1;
}
if self.limit != 0 {
len += 1;
}
if self.offset != 0 {
len += 1;
}
if self.with_ties {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.TopNNode", len)?;
if !self.column_orders.is_empty() {
struct_ser.serialize_field("columnOrders", &self.column_orders)?;
}
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.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] = &[
"column_orders",
"columnOrders",
"limit",
"offset",
"with_ties",
"withTies",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ColumnOrders,
Limit,
Offset,
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 {
"columnOrders" | "column_orders" => Ok(GeneratedField::ColumnOrders),
"limit" => Ok(GeneratedField::Limit),
"offset" => Ok(GeneratedField::Offset),
"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 batch_plan.TopNNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TopNNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut column_orders__ = None;
let mut limit__ = None;
let mut offset__ = None;
let mut with_ties__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ColumnOrders => {
if column_orders__.is_some() {
return Err(serde::de::Error::duplicate_field("columnOrders"));
}
column_orders__ = Some(map_.next_value()?);
}
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::WithTies => {
if with_ties__.is_some() {
return Err(serde::de::Error::duplicate_field("withTies"));
}
with_ties__ = Some(map_.next_value()?);
}
}
}
Ok(TopNNode {
column_orders: column_orders__.unwrap_or_default(),
limit: limit__.unwrap_or_default(),
offset: offset__.unwrap_or_default(),
with_ties: with_ties__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_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("batch_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 batch_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("batch_plan.UnionNode", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for UpdateNode {
#[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.old_exprs.is_empty() {
len += 1;
}
if !self.new_exprs.is_empty() {
len += 1;
}
if self.returning {
len += 1;
}
if self.session_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("batch_plan.UpdateNode", 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.old_exprs.is_empty() {
struct_ser.serialize_field("oldExprs", &self.old_exprs)?;
}
if !self.new_exprs.is_empty() {
struct_ser.serialize_field("newExprs", &self.new_exprs)?;
}
if self.returning {
struct_ser.serialize_field("returning", &self.returning)?;
}
if self.session_id != 0 {
struct_ser.serialize_field("sessionId", &self.session_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for UpdateNode {
#[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",
"old_exprs",
"oldExprs",
"new_exprs",
"newExprs",
"returning",
"session_id",
"sessionId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableId,
TableVersionId,
OldExprs,
NewExprs,
Returning,
SessionId,
}
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),
"oldExprs" | "old_exprs" => Ok(GeneratedField::OldExprs),
"newExprs" | "new_exprs" => Ok(GeneratedField::NewExprs),
"returning" => Ok(GeneratedField::Returning),
"sessionId" | "session_id" => Ok(GeneratedField::SessionId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = UpdateNode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct batch_plan.UpdateNode")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<UpdateNode, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_id__ = None;
let mut table_version_id__ = None;
let mut old_exprs__ = None;
let mut new_exprs__ = None;
let mut returning__ = None;
let mut session_id__ = 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::OldExprs => {
if old_exprs__.is_some() {
return Err(serde::de::Error::duplicate_field("oldExprs"));
}
old_exprs__ = Some(map_.next_value()?);
}
GeneratedField::NewExprs => {
if new_exprs__.is_some() {
return Err(serde::de::Error::duplicate_field("newExprs"));
}
new_exprs__ = Some(map_.next_value()?);
}
GeneratedField::Returning => {
if returning__.is_some() {
return Err(serde::de::Error::duplicate_field("returning"));
}
returning__ = Some(map_.next_value()?);
}
GeneratedField::SessionId => {
if session_id__.is_some() {
return Err(serde::de::Error::duplicate_field("sessionId"));
}
session_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(UpdateNode {
table_id: table_id__.unwrap_or_default(),
table_version_id: table_version_id__.unwrap_or_default(),
old_exprs: old_exprs__.unwrap_or_default(),
new_exprs: new_exprs__.unwrap_or_default(),
returning: returning__.unwrap_or_default(),
session_id: session_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("batch_plan.UpdateNode", 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("batch_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 batch_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("batch_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("batch_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 batch_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("batch_plan.ValuesNode.ExprTuple", FIELDS, GeneratedVisitor)
}
}