@@ -40,9 +40,11 @@ use strum::AsRefStr;
4040use table:: table_reference:: TableReference ;
4141use uuid:: Uuid ;
4242
43- use crate :: ddl:: repartition:: { PartitionRuleDiff , PlanGroup , PlanGroupId , RepartitionPlan , ResourceDemand } ;
44- use crate :: ddl:: utils:: map_to_procedure_error;
4543use crate :: ddl:: DdlContext ;
44+ use crate :: ddl:: repartition:: {
45+ PartitionRuleDiff , PlanGroup , PlanGroupId , RepartitionPlan , ResourceDemand ,
46+ } ;
47+ use crate :: ddl:: utils:: map_to_procedure_error;
4648use crate :: error:: Result ;
4749use crate :: lock_key:: { CatalogLock , SchemaLock , TableLock } ;
4850
@@ -138,7 +140,7 @@ impl RepartitionProcedure {
138140 async fn on_collect_subprocedures ( & mut self , _ctx : & ProcedureContext ) -> Result < Status > {
139141 self . data
140142 . succeeded_groups
141- . extend ( self . data . pending_groups . drain ( .. ) ) ;
143+ . append ( & mut self . data . pending_groups ) ;
142144
143145 self . data . state = RepartitionState :: Finalize ;
144146 Ok ( Status :: executing ( true ) )
@@ -162,8 +164,10 @@ impl RepartitionProcedure {
162164 plan. groups . push ( PlanGroup :: new ( group_id) ) ;
163165 }
164166
165- let mut demand = ResourceDemand :: default ( ) ;
166- demand. new_regions = plan. groups . len ( ) as u32 ;
167+ let demand = ResourceDemand {
168+ new_regions : plan. groups . len ( ) as u32 ,
169+ ..Default :: default ( )
170+ } ;
167171 plan. resource_demand = demand;
168172
169173 Ok ( ( plan, diff, demand) )
@@ -207,9 +211,7 @@ impl Procedure for RepartitionProcedure {
207211 RepartitionState :: Prepare => self . on_prepare ( ) . await ,
208212 RepartitionState :: AllocateResources => self . on_allocate_resources ( ) . await ,
209213 RepartitionState :: DispatchSubprocedures => self . on_dispatch_subprocedures ( ) . await ,
210- RepartitionState :: CollectSubprocedures => {
211- self . on_collect_subprocedures ( ctx) . await
212- }
214+ RepartitionState :: CollectSubprocedures => self . on_collect_subprocedures ( ctx) . await ,
213215 RepartitionState :: Finalize => self . on_finalize ( ) . await ,
214216 RepartitionState :: Finished => Ok ( Status :: done ( ) ) ,
215217 } ;
@@ -298,7 +300,7 @@ pub struct RepartitionTask {
298300}
299301
300302impl RepartitionTask {
301- fn table_ref ( & self ) -> TableReference {
303+ fn table_ref ( & self ) -> TableReference < ' _ > {
302304 TableReference {
303305 catalog : & self . catalog_name ,
304306 schema : & self . schema_name ,
0 commit comments