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


##########
rust/sedona-spatial-join/src/exec.rs:
##########
@@ -212,61 +180,89 @@ impl SpatialJoinExec {
         &self.join_type
     }
 
-    /// Returns a vector indicating whether the left and right inputs maintain 
their order.
-    /// The first element corresponds to the left input, and the second to the 
right.
-    ///
-    /// The left (build-side) input's order may change, but the right 
(probe-side) input's
-    /// order is maintained for INNER, RIGHT, RIGHT ANTI, and RIGHT SEMI joins.
+    /// Does this join has a projection on the joined columns
+    pub fn contains_projection(&self) -> bool {
+        self.projection.is_some()
+    }
+
+    /// Returns a new `ExecutionPlan` that runs NestedLoopsJoins with the left
+    /// and right inputs swapped.
     ///
-    /// Maintaining the right input's order helps optimize the nodes down the 
pipeline
-    /// (See [`ExecutionPlan::maintains_input_order`]).
+    /// # Notes:
     ///
-    /// This is a separate method because it is also called when computing 
properties, before
-    /// a [`NestedLoopJoinExec`] is created. It also takes [`JoinType`] as an 
argument, as
-    /// opposed to `Self`, for the same reason.
-    fn maintains_input_order(join_type: JoinType) -> Vec<bool> {
-        vec![
-            false,
-            matches!(
-                join_type,
-                JoinType::Inner | JoinType::Right | JoinType::RightAnti | 
JoinType::RightSemi
-            ),
-        ]
+    /// This function should be called BEFORE inserting any repartitioning
+    /// operators on the join's children. Check 
[`super::HashJoinExec::swap_inputs`]
+    /// for more details.
+    pub fn swap_inputs(&self) -> Result<Arc<dyn ExecutionPlan>> {

Review Comment:
   Now we have a `swap_inputs` function. @zhangfengcdt 



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