jiacai2050 commented on code in PR #1303:
URL: 
https://github.com/apache/incubator-horaedb/pull/1303#discussion_r1436943844


##########
query_engine/src/datafusion_impl/physical_planner.rs:
##########
@@ -59,21 +59,17 @@ impl DatafusionPhysicalPlannerImpl {
 impl PhysicalPlanner for DatafusionPhysicalPlannerImpl {
     // TODO: we should modify `QueryPlan` to support create remote plan here.
     async fn plan(&self, ctx: &Context, logical_plan: QueryPlan) -> 
Result<PhysicalPlanPtr> {
-        // Register catalogs to datafusion execution context.
-        let catalogs = 
CatalogProviderAdapter::new_adapters(logical_plan.tables.clone());
         // TODO: maybe we should not build `SessionContext` in each physical 
plan's
         // building. We need to do so because we place some dynamic
         // information(such as `timeout`) in `SessionConfig`, maybe it is 
better
         // to remove it to `TaskContext`.
         let df_ctx = self.df_ctx_builder.build(ctx);
-        for (name, catalog) in catalogs {
-            df_ctx.register_catalog(&name, Arc::new(catalog));
-        }
+        let state = df_ctx.state();
 
-        // Generate physical plan.
-        let exec_plan = df_ctx
-            .state()
-            .create_physical_plan(&logical_plan.df_plan)
+        let exec_plan = self
+            .df_ctx_builder
+            .physical_planner
+            .create_physical_plan(&logical_plan.df_plan, &state)

Review Comment:
   Fixed, move to `DatafusionPhysicalPlannerImpl`



##########
query_engine/src/datafusion_impl/task_context.rs:
##########
@@ -130,7 +131,7 @@ impl Preprocessor {
 
         let resolver = self.dist_query_resolver_builder.build(ctx);
         resolver
-            .resolve_sub_scan(plan)
+            .resolve_sub_scan(plan, ctx.priority)

Review Comment:
   Fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to