@@ -119,7 +119,13 @@ impl QueryPlanner {
119119 /// distributed plan, and distributed stages, but it does not yet contain
120120 /// worker addresses or tasks, as they are filled in later by `distribute_plan()`.
121121 pub async fn prepare_substrait ( & self , substrait_plan : Plan ) -> Result < QueryPlan > {
122- let ctx = get_ctx ( ) . map_err ( |e| anyhow ! ( "Could not create context: {e}" ) ) ?;
122+ let mut ctx = get_ctx ( ) . map_err ( |e| anyhow ! ( "Could not create context: {e}" ) ) ?;
123+ if let Some ( customizer) = & self . customizer {
124+ customizer
125+ . customize ( & mut ctx)
126+ . await
127+ . map_err ( |e| anyhow ! ( "Customization failed: {e:#?}" ) ) ?;
128+ }
123129
124130 let logical_plan = from_substrait_plan ( & ctx. state ( ) , & substrait_plan) . await ?;
125131
@@ -257,7 +263,7 @@ impl QueryPlanner {
257263 } )
258264 }
259265
260- /// Performs worker discovery, and distributes the query plan to workers.
266+ /// Performs worker discovery, and distributes the query plan to workers,
261267 /// also sets the final worker addresses and distributed tasks in the query plan.
262268 pub async fn distribute_plan ( & self , initial_plan : & mut QueryPlan ) -> Result < ( ) > {
263269 // Perform worker discovery
@@ -267,7 +273,7 @@ impl QueryPlanner {
267273 // into chunks of partitions (partition_groups)
268274 let ( final_workers, tasks) = distribute_stages (
269275 & initial_plan. query_id ,
270- initial_plan. distributed_stages . clone ( ) ,
276+ & initial_plan. distributed_stages ,
271277 worker_addrs,
272278 self . codec . as_ref ( ) ,
273279 )
0 commit comments