diff --git a/src/frontend/src/catalog/system_catalog/rw_catalog/rw_fragments.rs b/src/frontend/src/catalog/system_catalog/rw_catalog/rw_fragments.rs index ebe7369e46485..91f818e7919f7 100644 --- a/src/frontend/src/catalog/system_catalog/rw_catalog/rw_fragments.rs +++ b/src/frontend/src/catalog/system_catalog/rw_catalog/rw_fragments.rs @@ -14,7 +14,6 @@ use risingwave_common::types::Fields; use risingwave_frontend_macro::system_catalog; -use risingwave_pb::meta::table_fragments::fragment::FragmentDistributionType; use risingwave_pb::stream_plan::FragmentTypeFlag; use crate::catalog::system_catalog::SysCatalogReaderImpl; @@ -53,36 +52,27 @@ async fn read_rw_fragment(reader: &SysCatalogReaderImpl) -> Result 1, - FragmentDistributionType::Hash => distribution.vnode_count as i32, - FragmentDistributionType::Unspecified => unreachable!(), - }; - - RwFragment { - fragment_id: distribution.fragment_id as i32, - table_id: distribution.table_id as i32, - distribution_type: distribution.distribution_type().as_str_name().into(), - state_table_ids: distribution - .state_table_ids - .into_iter() - .map(|id| id as i32) - .collect(), - upstream_fragment_ids: distribution - .upstream_fragment_ids - .into_iter() - .map(|id| id as i32) - .collect(), - flags: extract_fragment_type_flag(distribution.fragment_type_mask) - .into_iter() - .flat_map(|t| t.as_str_name().strip_prefix("FRAGMENT_TYPE_FLAG_")) - .map(|s| s.into()) - .collect(), - parallelism: distribution.parallelism as i32, - max_parallelism, - } + .map(|distribution| RwFragment { + fragment_id: distribution.fragment_id as i32, + table_id: distribution.table_id as i32, + distribution_type: distribution.distribution_type().as_str_name().into(), + state_table_ids: distribution + .state_table_ids + .into_iter() + .map(|id| id as i32) + .collect(), + upstream_fragment_ids: distribution + .upstream_fragment_ids + .into_iter() + .map(|id| id as i32) + .collect(), + flags: extract_fragment_type_flag(distribution.fragment_type_mask) + .into_iter() + .flat_map(|t| t.as_str_name().strip_prefix("FRAGMENT_TYPE_FLAG_")) + .map(|s| s.into()) + .collect(), + parallelism: distribution.parallelism as i32, + max_parallelism: distribution.vnode_count as i32, }) .collect()) }