Kontinuation commented on code in PR #562:
URL: https://github.com/apache/sedona-db/pull/562#discussion_r2797635681


##########
rust/sedona-spatial-join/src/planner/physical_planner.rs:
##########
@@ -0,0 +1,263 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use std::collections::HashMap;
+use std::fmt;
+use std::sync::Arc;
+
+use async_trait::async_trait;
+
+use arrow_schema::Schema;
+
+use datafusion::execution::context::QueryPlanner;
+use datafusion::execution::session_state::{SessionState, SessionStateBuilder};
+use datafusion::physical_plan::ExecutionPlan;
+use datafusion::physical_planner::{DefaultPhysicalPlanner, ExtensionPlanner, 
PhysicalPlanner};
+use datafusion_common::{plan_err, DFSchema, Result};
+use datafusion_expr::logical_plan::UserDefinedLogicalNode;
+use datafusion_expr::LogicalPlan;
+use datafusion_physical_expr::create_physical_expr;
+use datafusion_physical_plan::joins::utils::JoinFilter;
+use datafusion_physical_plan::joins::NestedLoopJoinExec;
+use sedona_common::sedona_internal_err;
+
+use crate::exec::SpatialJoinExec;
+use crate::planner::logical_plan_node::SpatialJoinPlanNode;
+use crate::planner::spatial_expr_utils::{is_spatial_predicate_supported, 
transform_join_filter};
+use crate::spatial_predicate::SpatialPredicate;
+use sedona_common::option::SedonaOptions;
+
+/// Registers a query planner that can produce [`SpatialJoinExec`] from a 
logical extension node.
+pub fn register_spatial_join_planner(builder: SessionStateBuilder) -> 
SessionStateBuilder {
+    builder.with_query_planner(Arc::new(SedonaSpatialQueryPlanner))
+}
+
+/// Query planner that enables Sedona's spatial join planning.
+///
+/// Installs an [`ExtensionPlanner`] that recognizes `SpatialJoinPlanNode` and 
produces
+/// `SpatialJoinExec` when supported and enabled.
+pub struct SedonaSpatialQueryPlanner;

Review Comment:
   Good idea. I have added `extension_planner` and also made 
`SedonaSpatialQueryPlanner` private.



-- 
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]

Reply via email to