You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sedona.apache.org by ko...@apache.org on 2026/02/04 02:20:34 UTC

(sedona-db) branch main updated: feat(rust/sedona-spatial-join): Support spatial partitioned spatial join for non-knn predicates (#563)

This is an automated email from the ASF dual-hosted git repository.

kontinuation pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/sedona-db.git


The following commit(s) were added to refs/heads/main by this push:
     new 7a1df552 feat(rust/sedona-spatial-join): Support spatial partitioned spatial join for non-knn predicates (#563)
7a1df552 is described below

commit 7a1df5520a73b6edb90a7640790067ecc10088cf
Author: Kristin Cowalcijk <bo...@wherobots.com>
AuthorDate: Wed Feb 4 10:20:30 2026 +0800

    feat(rust/sedona-spatial-join): Support spatial partitioned spatial join for non-knn predicates (#563)
    
    This patch adds a probe-side partitioned stream provider for repartitioning the probe side, and create probe streams for specified partitions. This partitioned stream provider is integrated into the spatial join execution flow to support larger-than-memory dataset by breaking the data into smaller partitions, where each partition could be fully loaded into memory.
    
    Currently only non-knn joins are supported. We'll add larger-than-memory KNN join support in subsequent patches.
---
 rust/sedona-spatial-join/Cargo.toml                |   2 +-
 .../bench/partitioning/stream_repartitioner.rs     |  11 +-
 rust/sedona-spatial-join/src/exec.rs               | 256 ++++-----
 .../src/index/build_side_collector.rs              |  22 +-
 .../src/index/partitioned_index_provider.rs        |  24 +-
 rust/sedona-spatial-join/src/lib.rs                |   1 +
 rust/sedona-spatial-join/src/operand_evaluator.rs  |  10 +-
 .../src/partitioning/stream_repartitioner.rs       |  83 +--
 rust/sedona-spatial-join/src/prepare.rs            | 282 +++++++---
 rust/sedona-spatial-join/src/probe.rs              |  45 ++
 .../src/probe/first_pass_stream.rs                 | 247 +++++++++
 .../src/probe/non_partitioned_stream.rs            |  69 +++
 .../src/probe/partitioned_stream_provider.rs       | 528 +++++++++++++++++++
 rust/sedona-spatial-join/src/stream.rs             | 572 ++++++++++++++++-----
 rust/sedona-spatial-join/src/utils/join_utils.rs   | 322 ++++++++++++
 15 files changed, 2070 insertions(+), 404 deletions(-)

diff --git a/rust/sedona-spatial-join/Cargo.toml b/rust/sedona-spatial-join/Cargo.toml
index d34f7a6c..902f27f4 100644
--- a/rust/sedona-spatial-join/Cargo.toml
+++ b/rust/sedona-spatial-join/Cargo.toml
@@ -73,7 +73,7 @@ log = { workspace = true }
 criterion = { workspace = true }
 datafusion = { workspace = true, features = ["sql"] }
 rstest = { workspace = true }
-sedona-testing = { workspace = true}
+sedona-testing = { workspace = true }
 wkt = { workspace = true }
 tokio = { workspace = true, features = ["macros"] }
 rand = { workspace = true }
diff --git a/rust/sedona-spatial-join/bench/partitioning/stream_repartitioner.rs b/rust/sedona-spatial-join/bench/partitioning/stream_repartitioner.rs
index 62641a43..eb6453db 100644
--- a/rust/sedona-spatial-join/bench/partitioning/stream_repartitioner.rs
+++ b/rust/sedona-spatial-join/bench/partitioning/stream_repartitioner.rs
@@ -32,7 +32,7 @@ use datafusion_execution::runtime_env::RuntimeEnv;
 use datafusion_physical_plan::metrics::{ExecutionPlanMetricsSet, SpillMetrics};
 use futures::executor::block_on;
 use rand::{rngs::StdRng, Rng, SeedableRng};
-use sedona_geometry::{bounding_box::BoundingBox, interval::IntervalTrait};
+use sedona_geometry::{bounding_box::BoundingBox, interval::IntervalTrait, wkb_factory::wkb_point};
 use sedona_schema::datatypes::WKB_GEOMETRY;
 use sedona_spatial_join::evaluated_batch::{
     evaluated_batch_stream::{in_mem::InMemoryEvaluatedBatchStream, SendableEvaluatedBatchStream},
@@ -156,7 +156,7 @@ fn random_geometry_array(rows: usize, extent: &BoundingBox, rng: &mut StdRng) ->
         .map(|_| {
             let x = rng.random_range(extent.x().lo()..=extent.x().hi());
             let y = rng.random_range(extent.y().lo()..=extent.y().hi());
-            point_wkb(x, y)
+            wkb_point((x, y)).unwrap()
         })
         .collect();
 
@@ -218,13 +218,6 @@ fn default_extent() -> BoundingBox {
     BoundingBox::xy((0.0, 10_000.0), (0.0, 10_000.0))
 }
 
-fn point_wkb(x: f64, y: f64) -> Vec<u8> {
-    let mut buf = vec![1u8, 1, 0, 0, 0];
-    buf.extend_from_slice(&x.to_le_bytes());
-    buf.extend_from_slice(&y.to_le_bytes());
-    buf
-}
-
 criterion_group! {
     name = stream_partitioner;
     config = Criterion::default()
diff --git a/rust/sedona-spatial-join/src/exec.rs b/rust/sedona-spatial-join/src/exec.rs
index 2ed90d73..3b96489f 100644
--- a/rust/sedona-spatial-join/src/exec.rs
+++ b/rust/sedona-spatial-join/src/exec.rs
@@ -38,12 +38,11 @@ use sedona_common::{sedona_internal_err, SpatialJoinOptions};
 use crate::{
     prepare::{SpatialJoinComponents, SpatialJoinComponentsBuilder},
     spatial_predicate::{KNNPredicate, SpatialPredicate},
-    stream::{SpatialJoinProbeMetrics, SpatialJoinStream},
+    stream::SpatialJoinStream,
     utils::{
         join_utils::{asymmetric_join_output_partitioning, boundedness_from_children},
         once_fut::OnceAsync,
     },
-    SedonaOptions,
 };
 
 /// Type alias for build and probe execution plans
@@ -186,7 +185,6 @@ impl SpatialJoinExec {
             filter.as_ref(),
             converted_from_hash_join,
         )?;
-
         let seed = options
             .debug
             .random_seed
@@ -451,18 +449,11 @@ impl ExecutionPlan for SpatialJoinExec {
             _ => {
                 // Regular spatial join logic - standard left=build, right=probe semantics
                 let session_config = context.session_config();
-                let target_output_batch_size = session_config.options().execution.batch_size;
-                let sedona_options = session_config
-                    .options()
-                    .extensions
-                    .get::<SedonaOptions>()
-                    .cloned()
-                    .unwrap_or_default();
 
                 // Regular join semantics: left is build, right is probe
                 let (build_plan, probe_plan) = (&self.left, &self.right);
 
-                // Build the spatial index using shared OnceAsync
+                // A OnceFut for preparing the spatial join components once.
                 let once_fut_spatial_join_components = {
                     let mut once_async = self.once_async_spatial_join_components.lock();
                     once_async
@@ -500,7 +491,6 @@ impl ExecutionPlan for SpatialJoinExec {
                     None => self.column_indices.clone(),
                 };
 
-                let join_metrics = SpatialJoinProbeMetrics::new(partition, &self.metrics);
                 let probe_stream = probe_plan.execute(partition, Arc::clone(&context))?;
 
                 // For regular joins: probe is right side (index 1)
@@ -516,9 +506,9 @@ impl ExecutionPlan for SpatialJoinExec {
                     probe_stream,
                     column_indices_after_projection,
                     probe_side_ordered,
-                    join_metrics,
-                    sedona_options.spatial_join,
-                    target_output_batch_size,
+                    session_config,
+                    context.runtime_env(),
+                    &self.metrics,
                     once_fut_spatial_join_components,
                     Arc::clone(&self.once_async_spatial_join_components),
                 )))
@@ -535,13 +525,6 @@ impl SpatialJoinExec {
         context: Arc<TaskContext>,
     ) -> Result<SendableRecordBatchStream> {
         let session_config = context.session_config();
-        let target_output_batch_size = session_config.options().execution.batch_size;
-        let sedona_options = session_config
-            .options()
-            .extensions
-            .get::<SedonaOptions>()
-            .cloned()
-            .unwrap_or_default();
 
         // Extract KNN predicate for type safety
         let knn_pred = match &self.on {
@@ -556,7 +539,7 @@ impl SpatialJoinExec {
         // Determine if probe plan is the left execution plan (for column index swapping logic)
         let actual_probe_plan_is_left = std::ptr::eq(probe_plan.as_ref(), self.left.as_ref());
 
-        // Build the spatial index
+        // A OnceFut for preparing the spatial join components once.
         let once_fut_spatial_join_components = {
             let mut once_async = self.once_async_spatial_join_components.lock();
             once_async
@@ -593,7 +576,6 @@ impl SpatialJoinExec {
             None => self.column_indices.clone(),
         };
 
-        let join_metrics = SpatialJoinProbeMetrics::new(partition, &self.metrics);
         let probe_stream = probe_plan.execute(partition, Arc::clone(&context))?;
 
         // Determine if probe side ordering is maintained for KNN
@@ -614,9 +596,9 @@ impl SpatialJoinExec {
             probe_stream,
             column_indices_after_projection,
             probe_side_ordered,
-            join_metrics,
-            sedona_options.spatial_join,
-            target_output_batch_size,
+            session_config,
+            context.runtime_env(),
+            &self.metrics,
             once_fut_spatial_join_components,
             Arc::clone(&self.once_async_spatial_join_components),
         )))
@@ -638,6 +620,7 @@ mod tests {
     use geo::{Distance, Euclidean};
     use geo_types::{Coord, Rect};
     use rstest::rstest;
+    use sedona_common::SedonaOptions;
     use sedona_geo::to_geo::GeoTypesExecutor;
     use sedona_geometry::types::GeometryTypeId;
     use sedona_schema::datatypes::{SedonaType, WKB_GEOGRAPHY, WKB_GEOMETRY};
@@ -647,7 +630,7 @@ mod tests {
     use crate::register_spatial_join_optimizer;
     use sedona_common::{
         option::{add_sedona_option_extension, ExecutionMode, SpatialJoinOptions},
-        SpatialLibrary,
+        NumSpatialPartitionsConfig, SpatialJoinDebugOptions, SpatialLibrary,
     };
 
     use super::*;
@@ -786,10 +769,7 @@ mod tests {
 
         let test_data_vec = vec![vec![vec![]], vec![vec![], vec![]]];
 
-        let options = SpatialJoinOptions {
-            execution_mode: ExecutionMode::PrepareNone,
-            ..Default::default()
-        };
+        let options = SpatialJoinOptions::default();
         let ctx = setup_context(Some(options.clone()), 10)?;
         for test_data in test_data_vec {
             let left_partitions = test_data.clone();
@@ -973,10 +953,7 @@ mod tests {
             create_test_data_with_size_range((0.1, 10.0), WKB_GEOMETRY)?;
 
         for max_batch_size in [10, 30, 100] {
-            let options = SpatialJoinOptions {
-                execution_mode: ExecutionMode::PrepareNone,
-                ..Default::default()
-            };
+            let options = SpatialJoinOptions::default();
             test_spatial_join_query(&left_schema, &right_schema, left_partitions.clone(), right_partitions.clone(), &options, max_batch_size,
                 "SELECT * FROM L JOIN R ON ST_Intersects(L.geometry, R.geometry) AND L.dist < R.dist ORDER BY L.id, R.id").await?;
             test_spatial_join_query(&left_schema, &right_schema, left_partitions.clone(), right_partitions.clone(), &options, max_batch_size,
@@ -994,10 +971,7 @@ mod tests {
             create_test_data_with_empty_partitions()?;
 
         for max_batch_size in [10, 30, 1000] {
-            let options = SpatialJoinOptions {
-                execution_mode: ExecutionMode::PrepareNone,
-                ..Default::default()
-            };
+            let options = SpatialJoinOptions::default();
             test_spatial_join_query(&left_schema, &right_schema, left_partitions.clone(), right_partitions.clone(), &options, max_batch_size,
                 "SELECT L.id l_id, R.id r_id FROM L JOIN R ON ST_Intersects(L.geometry, R.geometry) ORDER BY l_id, r_id").await?;
             test_spatial_join_query(&left_schema, &right_schema, left_partitions.clone(), right_partitions.clone(), &options, max_batch_size,
@@ -1009,7 +983,8 @@ mod tests {
 
     #[tokio::test]
     async fn test_inner_join() -> Result<()> {
-        test_with_join_types(JoinType::Inner).await?;
+        let options = SpatialJoinOptions::default();
+        test_with_join_types(JoinType::Inner, options, 30).await?;
         Ok(())
     }
 
@@ -1018,7 +993,8 @@ mod tests {
     async fn test_left_joins(
         #[values(JoinType::Left, JoinType::LeftSemi, JoinType::LeftAnti)] join_type: JoinType,
     ) -> Result<()> {
-        test_with_join_types(join_type).await?;
+        let options = SpatialJoinOptions::default();
+        test_with_join_types(join_type, options, 30).await?;
         Ok(())
     }
 
@@ -1026,90 +1002,16 @@ mod tests {
     #[tokio::test]
     async fn test_right_joins(
         #[values(JoinType::Right, JoinType::RightSemi, JoinType::RightAnti)] join_type: JoinType,
-    ) -> Result<()> {
-        test_with_join_types(join_type).await?;
-        Ok(())
-    }
-
-    #[tokio::test]
-    async fn test_full_outer_join() -> Result<()> {
-        test_with_join_types(JoinType::Full).await?;
-        Ok(())
-    }
-
-    #[rstest]
-    #[tokio::test]
-    async fn test_mark_joins(
-        #[values(JoinType::LeftMark, JoinType::RightMark)] join_type: JoinType,
     ) -> Result<()> {
         let options = SpatialJoinOptions::default();
-        test_mark_join(join_type, options, 10).await?;
+        test_with_join_types(join_type, options, 30).await?;
         Ok(())
     }
 
     #[tokio::test]
-    async fn test_mark_join_via_correlated_exists_sql() -> Result<()> {
-        let ((left_schema, left_partitions), (right_schema, right_partitions)) =
-            create_test_data_with_size_range((0.1, 10.0), WKB_GEOMETRY)?;
-
-        let mem_table_left: Arc<dyn TableProvider> = Arc::new(MemTable::try_new(
-            left_schema.clone(),
-            left_partitions.clone(),
-        )?);
-        let mem_table_right: Arc<dyn TableProvider> = Arc::new(MemTable::try_new(
-            right_schema.clone(),
-            right_partitions.clone(),
-        )?);
-
-        // DataFusion doesn't have explicit SQL syntax for MARK joins. Predicate subqueries embedded
-        // in a more complex boolean expression (e.g. OR) are planned using a MARK join.
-        //
-        // Using EXISTS here (rather than IN) keeps the join filter as the pulled-up correlated
-        // predicate (ST_Intersects), which is what SpatialJoinExec can optimize.
-        let sql = "SELECT L.id FROM L WHERE L.id = 1 OR EXISTS (SELECT 1 FROM R WHERE ST_Intersects(L.geometry, R.geometry)) ORDER BY L.id";
-
-        let batch_size = 10;
+    async fn test_full_outer_join() -> Result<()> {
         let options = SpatialJoinOptions::default();
-
-        // Optimized plan should include a SpatialJoinExec with Mark join type.
-        let ctx = setup_context(Some(options), batch_size)?;
-        ctx.register_table("L", Arc::clone(&mem_table_left))?;
-        ctx.register_table("R", Arc::clone(&mem_table_right))?;
-        let df = ctx.sql(sql).await?;
-        let plan = df.clone().create_physical_plan().await?;
-        let spatial_join_execs = collect_spatial_join_exec(&plan)?;
-        assert!(
-            spatial_join_execs
-                .iter()
-                .any(|exec| matches!(*exec.join_type(), JoinType::LeftMark | JoinType::RightMark)),
-            "expected correlated IN-subquery to plan using a MARK join when optimized"
-        );
-        let actual_schema = df.schema().as_arrow().clone();
-        let actual_batches = df.collect().await?;
-        let actual_batch =
-            arrow::compute::concat_batches(&Arc::new(actual_schema), &actual_batches)?;
-
-        // Unoptimized plan should still contain a Mark join, but implemented as NestedLoopJoinExec.
-        let ctx_no_opt = setup_context(None, batch_size)?;
-        ctx_no_opt.register_table("L", mem_table_left)?;
-        ctx_no_opt.register_table("R", mem_table_right)?;
-        let df_no_opt = ctx_no_opt.sql(sql).await?;
-        let plan_no_opt = df_no_opt.clone().create_physical_plan().await?;
-        let nlj_execs = collect_nested_loop_join_exec(&plan_no_opt)?;
-        assert!(
-            nlj_execs
-                .iter()
-                .any(|exec| matches!(*exec.join_type(), JoinType::LeftMark | JoinType::RightMark)),
-            "expected correlated IN-subquery to plan using a MARK join when not optimized"
-        );
-        let expected_schema = df_no_opt.schema().as_arrow().clone();
-        let expected_batches = df_no_opt.collect().await?;
-        let expected_batch =
-            arrow::compute::concat_batches(&Arc::new(expected_schema), &expected_batches)?;
-
-        assert!(expected_batch.num_rows() > 0);
-        assert_eq!(expected_batch, actual_batch);
-
+        test_with_join_types(JoinType::Full, options, 30).await?;
         Ok(())
     }
 
@@ -1161,7 +1063,6 @@ mod tests {
 
         for max_batch_size in [10, 30, 100] {
             let options = SpatialJoinOptions {
-                execution_mode: ExecutionMode::PrepareNone,
                 parallel_refinement_chunk_size: 10,
                 ..Default::default()
             };
@@ -1172,15 +1073,120 @@ mod tests {
         Ok(())
     }
 
-    async fn test_with_join_types(join_type: JoinType) -> Result<RecordBatch> {
-        let ((left_schema, left_partitions), (right_schema, right_partitions)) =
-            create_test_data_with_empty_partitions()?;
+    #[rstest]
+    #[tokio::test]
+    async fn test_spatial_partitioned_range_join(
+        #[values(10, 30, 1000)] max_batch_size: usize,
+        #[values(
+            ExecutionMode::PrepareNone,
+            ExecutionMode::PrepareBuild,
+            ExecutionMode::PrepareProbe,
+            ExecutionMode::Speculative(20)
+        )]
+        execution_mode: ExecutionMode,
+        #[values(SpatialLibrary::Geo, SpatialLibrary::Geos, SpatialLibrary::Tg)]
+        spatial_library: SpatialLibrary,
+    ) -> Result<()> {
+        let test_data = get_default_test_data().await;
+        let expected_results = get_expected_range_join_results().await;
+        let ((left_schema, left_partitions), (right_schema, right_partitions)) = test_data;
 
+        let debug = SpatialJoinDebugOptions {
+            num_spatial_partitions: NumSpatialPartitionsConfig::Fixed(4),
+            force_spill: true,
+            memory_for_intermittent_usage: None,
+            ..Default::default()
+        };
         let options = SpatialJoinOptions {
-            execution_mode: ExecutionMode::PrepareNone,
+            spatial_library,
+            execution_mode,
+            debug,
+            ..Default::default()
+        };
+
+        for (idx, sql) in RANGE_JOIN_SQLS.iter().enumerate() {
+            let actual_result = run_spatial_join_query(
+                left_schema,
+                right_schema,
+                left_partitions.clone(),
+                right_partitions.clone(),
+                Some(options.clone()),
+                max_batch_size,
+                sql,
+            )
+            .await?;
+            assert_eq!(&actual_result, &expected_results[idx]);
+        }
+
+        Ok(())
+    }
+
+    #[rstest]
+    #[tokio::test]
+    async fn test_spatial_partitioned_outer_join(
+        #[values(10, 30, 1000)] batch_size: usize,
+        #[values(
+            JoinType::Left,
+            JoinType::Right,
+            JoinType::Full,
+            JoinType::LeftSemi,
+            JoinType::LeftAnti,
+            JoinType::RightSemi,
+            JoinType::RightAnti
+        )]
+        join_type: JoinType,
+    ) -> Result<()> {
+        let debug = SpatialJoinDebugOptions {
+            num_spatial_partitions: NumSpatialPartitionsConfig::Fixed(4),
+            force_spill: true,
+            memory_for_intermittent_usage: None,
             ..Default::default()
         };
-        let batch_size = 30;
+        let options = SpatialJoinOptions {
+            debug,
+            ..Default::default()
+        };
+
+        test_with_join_types(join_type, options, batch_size).await?;
+        Ok(())
+    }
+
+    #[rstest]
+    #[tokio::test]
+    async fn test_mark_joins(
+        #[values(JoinType::LeftMark, JoinType::RightMark)] join_type: JoinType,
+    ) -> Result<()> {
+        let options = SpatialJoinOptions::default();
+        test_mark_join(join_type, options, 10).await?;
+        Ok(())
+    }
+
+    #[rstest]
+    #[tokio::test]
+    async fn test_spatial_partitioned_mark_joins(
+        #[values(JoinType::LeftMark, JoinType::RightMark)] join_type: JoinType,
+    ) -> Result<()> {
+        let debug = SpatialJoinDebugOptions {
+            num_spatial_partitions: NumSpatialPartitionsConfig::Fixed(4),
+            force_spill: true,
+            memory_for_intermittent_usage: None,
+            ..Default::default()
+        };
+        let options = SpatialJoinOptions {
+            debug,
+            ..Default::default()
+        };
+        test_mark_join(join_type, options, 10).await?;
+        Ok(())
+    }
+
+    async fn test_with_join_types(
+        join_type: JoinType,
+        options: SpatialJoinOptions,
+        batch_size: usize,
+    ) -> Result<RecordBatch> {
+        let ((left_schema, left_partitions), (right_schema, right_partitions)) =
+            create_test_data_with_empty_partitions()?;
 
         let inner_sql = "SELECT L.id l_id, R.id r_id FROM L INNER JOIN R ON ST_Intersects(L.geometry, R.geometry) ORDER BY l_id, r_id";
         let sql = match join_type {
diff --git a/rust/sedona-spatial-join/src/index/build_side_collector.rs b/rust/sedona-spatial-join/src/index/build_side_collector.rs
index d888680f..3498575b 100644
--- a/rust/sedona-spatial-join/src/index/build_side_collector.rs
+++ b/rust/sedona-spatial-join/src/index/build_side_collector.rs
@@ -451,6 +451,7 @@ mod tests {
     use datafusion_physical_plan::metrics::ExecutionPlanMetricsSet;
     use futures::TryStreamExt;
     use sedona_common::SpatialJoinOptions;
+    use sedona_geometry::wkb_factory::wkb_point;
     use sedona_schema::datatypes::WKB_GEOMETRY;
 
     fn test_schema() -> Arc<Schema> {
@@ -473,13 +474,6 @@ mod tests {
         })
     }
 
-    fn point_wkb(x: f64, y: f64) -> Vec<u8> {
-        let mut buf = vec![1u8, 1, 0, 0, 0];
-        buf.extend_from_slice(&x.to_le_bytes());
-        buf.extend_from_slice(&y.to_le_bytes());
-        buf
-    }
-
     fn build_collector() -> BuildSideBatchesCollector {
         let expr: Arc<dyn datafusion_physical_expr::PhysicalExpr> =
             Arc::new(Literal::new(ScalarValue::Null));
@@ -534,9 +528,12 @@ mod tests {
         let sampler = BoundingBoxSampler::try_new(1, 4, 1.0, 7)?;
         let batch_a = sample_batch(
             &[0, 1],
-            vec![Some(point_wkb(0.0, 0.0)), Some(point_wkb(1.0, 1.0))],
+            vec![
+                Some(wkb_point((0.0, 0.0)).unwrap()),
+                Some(wkb_point((1.0, 1.0)).unwrap()),
+            ],
         )?;
-        let batch_b = sample_batch(&[2], vec![Some(point_wkb(2.0, 2.0))])?;
+        let batch_b = sample_batch(&[2], vec![Some(wkb_point((2.0, 2.0)).unwrap())])?;
         let stream = build_stream(vec![batch_a, batch_b]);
         let metrics_set = ExecutionPlanMetricsSet::new();
         let metrics = CollectBuildSideMetrics::new(0, &metrics_set);
@@ -565,9 +562,12 @@ mod tests {
         let (reservation, _pool) = memory_reservation(bbox_mem + 1);
         let batch_a = sample_batch(
             &[10, 11],
-            vec![Some(point_wkb(5.0, 5.0)), Some(point_wkb(6.0, 6.0))],
+            vec![
+                Some(wkb_point((5.0, 5.0)).unwrap()),
+                Some(wkb_point((6.0, 6.0)).unwrap()),
+            ],
         )?;
-        let batch_b = sample_batch(&[12], vec![Some(point_wkb(7.0, 7.0))])?;
+        let batch_b = sample_batch(&[12], vec![Some(wkb_point((7.0, 7.0)).unwrap())])?;
         let stream = build_stream(vec![batch_a, batch_b]);
         let metrics_set = ExecutionPlanMetricsSet::new();
         let metrics = CollectBuildSideMetrics::new(0, &metrics_set);
diff --git a/rust/sedona-spatial-join/src/index/partitioned_index_provider.rs b/rust/sedona-spatial-join/src/index/partitioned_index_provider.rs
index f9aeb893..c4e5e02a 100644
--- a/rust/sedona-spatial-join/src/index/partitioned_index_provider.rs
+++ b/rust/sedona-spatial-join/src/index/partitioned_index_provider.rs
@@ -237,7 +237,6 @@ impl PartitionedIndexProvider {
         }
     }
 
-    #[cfg(test)]
     pub async fn wait_for_index(&self, partition_id: u32) -> Option<Result<Arc<SpatialIndex>>> {
         let cell = match self.index_cells.get(partition_id as usize) {
             Some(cell) => cell,
@@ -390,6 +389,7 @@ mod tests {
     use sedona_expr::statistics::GeoStatistics;
     use sedona_functions::st_analyze_agg::AnalyzeAccumulator;
     use sedona_geometry::analyze::analyze_geometry;
+    use sedona_geometry::wkb_factory::wkb_point;
     use sedona_schema::datatypes::WKB_GEOMETRY;
 
     use crate::evaluated_batch::spill::EvaluatedBatchSpillWriter;
@@ -403,13 +403,6 @@ mod tests {
         ]))
     }
 
-    fn point_wkb(x: f64, y: f64) -> Vec<u8> {
-        let mut buf = vec![1u8, 1, 0, 0, 0];
-        buf.extend_from_slice(&x.to_le_bytes());
-        buf.extend_from_slice(&y.to_le_bytes());
-        buf
-    }
-
     fn sample_batch(ids: &[i32], wkbs: Vec<Option<Vec<u8>>>) -> Result<EvaluatedBatch> {
         assert_eq!(ids.len(), wkbs.len());
         let geom_values: Vec<Option<&[u8]>> = wkbs
@@ -532,7 +525,10 @@ mod tests {
         let memory_pool: Arc<dyn MemoryPool> = Arc::new(GreedyMemoryPool::new(1 << 20));
         let batches = vec![sample_batch(
             &[1, 2],
-            vec![Some(point_wkb(10.0, 10.0)), Some(point_wkb(20.0, 20.0))],
+            vec![
+                Some(wkb_point((10.0, 10.0)).unwrap()),
+                Some(wkb_point((20.0, 20.0)).unwrap()),
+            ],
         )?];
         let build_partition = build_partition_from_batches(Arc::clone(&memory_pool), batches)?;
         let metrics = ExecutionPlanMetricsSet::new();
@@ -566,8 +562,14 @@ mod tests {
         let memory_pool: Arc<dyn MemoryPool> = Arc::new(GreedyMemoryPool::new(1 << 20));
         let runtime_env = Arc::new(RuntimeEnv::default());
         let partition_batches = vec![
-            vec![sample_batch(&[10], vec![Some(point_wkb(0.0, 0.0))])?],
-            vec![sample_batch(&[20], vec![Some(point_wkb(50.0, 50.0))])?],
+            vec![sample_batch(
+                &[10],
+                vec![Some(wkb_point((0.0, 0.0)).unwrap())],
+            )?],
+            vec![sample_batch(
+                &[20],
+                vec![Some(wkb_point((50.0, 50.0)).unwrap())],
+            )?],
         ];
         let spilled_partitions = make_spilled_partitions(runtime_env, partition_batches)?;
         let metrics = ExecutionPlanMetricsSet::new();
diff --git a/rust/sedona-spatial-join/src/lib.rs b/rust/sedona-spatial-join/src/lib.rs
index 2abaf3c4..7961e621 100644
--- a/rust/sedona-spatial-join/src/lib.rs
+++ b/rust/sedona-spatial-join/src/lib.rs
@@ -22,6 +22,7 @@ pub mod operand_evaluator;
 pub mod optimizer;
 pub mod partitioning;
 mod prepare;
+mod probe;
 pub mod refine;
 pub mod spatial_predicate;
 mod stream;
diff --git a/rust/sedona-spatial-join/src/operand_evaluator.rs b/rust/sedona-spatial-join/src/operand_evaluator.rs
index 792d1957..efcf2a43 100644
--- a/rust/sedona-spatial-join/src/operand_evaluator.rs
+++ b/rust/sedona-spatial-join/src/operand_evaluator.rs
@@ -243,10 +243,9 @@ impl DistanceOperandEvaluator {
         match &distance_columnar_value {
             ColumnarValue::Scalar(ScalarValue::Float64(Some(distance))) => {
                 result.rects.iter_mut().for_each(|rect_opt| {
-                    let Some(rect) = rect_opt else {
-                        return;
+                    if let Some(rect) = rect_opt {
+                        expand_rect_in_place(rect, *distance);
                     };
-                    expand_rect_in_place(rect, *distance);
                 });
             }
             ColumnarValue::Scalar(ScalarValue::Float64(None)) => {
@@ -258,10 +257,9 @@ impl DistanceOperandEvaluator {
                     for (geom_idx, rect_opt) in result.rects.iter_mut().enumerate() {
                         if !array.is_null(geom_idx) {
                             let dist = array.value(geom_idx);
-                            let Some(rect) = rect_opt else {
-                                continue;
+                            if let Some(rect) = rect_opt {
+                                expand_rect_in_place(rect, dist);
                             };
-                            expand_rect_in_place(rect, dist);
                         }
                     }
                 } else {
diff --git a/rust/sedona-spatial-join/src/partitioning/stream_repartitioner.rs b/rust/sedona-spatial-join/src/partitioning/stream_repartitioner.rs
index 038530b1..8d98d8f1 100644
--- a/rust/sedona-spatial-join/src/partitioning/stream_repartitioner.rs
+++ b/rust/sedona-spatial-join/src/partitioning/stream_repartitioner.rs
@@ -758,6 +758,7 @@ mod tests {
     use datafusion_physical_plan::metrics::ExecutionPlanMetricsSet;
     use sedona_geometry::bounding_box::BoundingBox;
     use sedona_geometry::interval::IntervalTrait;
+    use sedona_geometry::wkb_factory::wkb_point;
     use sedona_schema::datatypes::WKB_GEOMETRY;
 
     use crate::{
@@ -791,13 +792,6 @@ mod tests {
         })
     }
 
-    fn point_wkb(x: f64, y: f64) -> Vec<u8> {
-        let mut buf = vec![1u8, 1, 0, 0, 0];
-        buf.extend_from_slice(&x.to_le_bytes());
-        buf.extend_from_slice(&y.to_le_bytes());
-        buf
-    }
-
     fn rect_wkb(min_x: f64, min_y: f64, max_x: f64, max_y: f64) -> Vec<u8> {
         assert!(min_x <= max_x, "min_x must be <= max_x");
         assert!(min_y <= max_y, "min_y must be <= max_y");
@@ -855,9 +849,9 @@ mod tests {
     #[tokio::test]
     async fn repartition_basic() -> Result<()> {
         let wkbs = vec![
-            Some(point_wkb(10.0, 10.0)),
-            Some(point_wkb(60.0, 10.0)),
-            Some(point_wkb(150.0, 10.0)),
+            Some(wkb_point((10.0, 10.0)).unwrap()),
+            Some(wkb_point((60.0, 10.0)).unwrap()),
+            Some(wkb_point((150.0, 10.0)).unwrap()),
         ];
         let batch = sample_batch(&[0, 1, 2], wkbs)?;
         let schema = batch.schema();
@@ -1009,7 +1003,10 @@ mod tests {
 
     #[test]
     fn streaming_repartitioner_finishes_partitions() -> Result<()> {
-        let wkbs = vec![Some(point_wkb(10.0, 10.0)), Some(point_wkb(60.0, 10.0))];
+        let wkbs = vec![
+            Some(wkb_point((10.0, 10.0)).unwrap()),
+            Some(wkb_point((60.0, 10.0)).unwrap()),
+        ];
         let batch = sample_batch(&[0, 1], wkbs)?;
         let partitions = vec![
             BoundingBox::xy((0.0, 50.0), (0.0, 50.0)),
@@ -1057,8 +1054,8 @@ mod tests {
 
     #[test]
     fn streaming_repartitioner_buffers_until_threshold() -> Result<()> {
-        let batch_a = sample_batch(&[0], vec![Some(point_wkb(10.0, 10.0))])?;
-        let batch_b = sample_batch(&[1], vec![Some(point_wkb(20.0, 10.0))])?;
+        let batch_a = sample_batch(&[0], vec![Some(wkb_point((10.0, 10.0)).unwrap())])?;
+        let batch_b = sample_batch(&[1], vec![Some(wkb_point((20.0, 10.0)).unwrap())])?;
         let partitions = vec![BoundingBox::xy((0.0, 50.0), (0.0, 50.0))];
         let partitioner = Arc::new(FlatPartitioner::try_new(partitions)?);
         let runtime_env = Arc::new(RuntimeEnv::default());
@@ -1091,8 +1088,8 @@ mod tests {
 
     #[test]
     fn streaming_repartitioner_respects_target_batch_size() -> Result<()> {
-        let batch_a = sample_batch(&[0], vec![Some(point_wkb(10.0, 10.0))])?;
-        let batch_b = sample_batch(&[1], vec![Some(point_wkb(20.0, 10.0))])?;
+        let batch_a = sample_batch(&[0], vec![Some(wkb_point((10.0, 10.0)).unwrap())])?;
+        let batch_b = sample_batch(&[1], vec![Some(wkb_point((20.0, 10.0)).unwrap())])?;
         let partitions = vec![BoundingBox::xy((0.0, 50.0), (0.0, 50.0))];
         let partitioner = Arc::new(FlatPartitioner::try_new(partitions)?);
         let runtime_env = Arc::new(RuntimeEnv::default());
@@ -1137,8 +1134,11 @@ mod tests {
 
     #[test]
     fn interleave_distance_none() -> Result<()> {
-        let wkbs1 = vec![point_wkb(10.0, 10.0), point_wkb(20.0, 20.0)];
-        let wkbs2 = vec![point_wkb(30.0, 30.0)];
+        let wkbs1 = vec![
+            wkb_point((10.0, 10.0)).unwrap(),
+            wkb_point((20.0, 20.0)).unwrap(),
+        ];
+        let wkbs2 = vec![wkb_point((30.0, 30.0)).unwrap()];
 
         let geom1 = make_geom_array_with_distance(wkbs1, None)?;
         let geom2 = make_geom_array_with_distance(wkbs2, None)?;
@@ -1153,8 +1153,11 @@ mod tests {
 
     #[test]
     fn interleave_distance_uniform_scalar() -> Result<()> {
-        let wkbs1 = vec![point_wkb(10.0, 10.0), point_wkb(20.0, 20.0)];
-        let wkbs2 = vec![point_wkb(30.0, 30.0)];
+        let wkbs1 = vec![
+            wkb_point((10.0, 10.0)).unwrap(),
+            wkb_point((20.0, 20.0)).unwrap(),
+        ];
+        let wkbs2 = vec![wkb_point((30.0, 30.0)).unwrap()];
 
         let scalar = ScalarValue::Float64(Some(5.0));
         let geom1 =
@@ -1177,8 +1180,11 @@ mod tests {
     fn interleave_distance_different_scalars() -> Result<()> {
         use arrow_array::Float64Array;
 
-        let wkbs1 = vec![point_wkb(10.0, 10.0), point_wkb(20.0, 20.0)];
-        let wkbs2 = vec![point_wkb(30.0, 30.0)];
+        let wkbs1 = vec![
+            wkb_point((10.0, 10.0)).unwrap(),
+            wkb_point((20.0, 20.0)).unwrap(),
+        ];
+        let wkbs2 = vec![wkb_point((30.0, 30.0)).unwrap()];
 
         let scalar1 = ScalarValue::Float64(Some(5.0));
         let scalar2 = ScalarValue::Float64(Some(10.0));
@@ -1204,8 +1210,11 @@ mod tests {
     fn interleave_distance_arrays() -> Result<()> {
         use arrow_array::Float64Array;
 
-        let wkbs1 = vec![point_wkb(10.0, 10.0), point_wkb(20.0, 20.0)];
-        let wkbs2 = vec![point_wkb(30.0, 30.0)];
+        let wkbs1 = vec![
+            wkb_point((10.0, 10.0)).unwrap(),
+            wkb_point((20.0, 20.0)).unwrap(),
+        ];
+        let wkbs2 = vec![wkb_point((30.0, 30.0)).unwrap()];
 
         let array1: ArrayRef = Arc::new(Float64Array::from(vec![1.0, 2.0]));
         let array2: ArrayRef = Arc::new(Float64Array::from(vec![3.0]));
@@ -1231,8 +1240,11 @@ mod tests {
     fn interleave_distance_mixed_scalar_and_array() -> Result<()> {
         use arrow_array::Float64Array;
 
-        let wkbs1 = vec![point_wkb(10.0, 10.0), point_wkb(20.0, 20.0)];
-        let wkbs2 = vec![point_wkb(30.0, 30.0)];
+        let wkbs1 = vec![
+            wkb_point((10.0, 10.0)).unwrap(),
+            wkb_point((20.0, 20.0)).unwrap(),
+        ];
+        let wkbs2 = vec![wkb_point((30.0, 30.0)).unwrap()];
 
         let scalar = ScalarValue::Float64(Some(5.0));
         let array: ArrayRef = Arc::new(Float64Array::from(vec![10.0]));
@@ -1256,8 +1268,8 @@ mod tests {
 
     #[test]
     fn interleave_evaluated_batch_empty_assignments() -> Result<()> {
-        let batch_a = sample_batch(&[0], vec![Some(point_wkb(10.0, 10.0))])?;
-        let batch_b = sample_batch(&[1], vec![Some(point_wkb(20.0, 20.0))])?;
+        let batch_a = sample_batch(&[0], vec![Some(wkb_point((10.0, 10.0)).unwrap())])?;
+        let batch_b = sample_batch(&[1], vec![Some(wkb_point((20.0, 20.0)).unwrap())])?;
         let record_batches = vec![&batch_a.batch, &batch_b.batch];
         let geom_arrays = vec![&batch_a.geom_array, &batch_b.geom_array];
 
@@ -1271,8 +1283,8 @@ mod tests {
 
     #[test]
     fn interleave_distance_inconsistent_metadata() -> Result<()> {
-        let wkbs1 = vec![point_wkb(10.0, 10.0)];
-        let wkbs2 = vec![point_wkb(20.0, 20.0)];
+        let wkbs1 = vec![wkb_point((10.0, 10.0)).unwrap()];
+        let wkbs2 = vec![wkb_point((20.0, 20.0)).unwrap()];
 
         let scalar = ScalarValue::Float64(Some(5.0));
         let geom1 = make_geom_array_with_distance(wkbs1, Some(ColumnarValue::Scalar(scalar)))?;
@@ -1296,8 +1308,11 @@ mod tests {
         use sedona_schema::datatypes::{Edges, SedonaType};
         let wkb_view_geometry = SedonaType::WkbView(Edges::Planar, Crs::None);
 
-        let wkbs1 = [point_wkb(10.0, 10.0), point_wkb(20.0, 20.0)];
-        let wkbs2 = [point_wkb(30.0, 30.0)];
+        let wkbs1 = [
+            wkb_point((10.0, 10.0)).unwrap(),
+            wkb_point((20.0, 20.0)).unwrap(),
+        ];
+        let wkbs2 = [wkb_point((30.0, 30.0)).unwrap()];
 
         // Create BinaryViewArray
         let array1 = BinaryViewArray::from_iter(wkbs1.iter().map(|w| Some(w.as_slice())));
@@ -1344,9 +1359,9 @@ mod tests {
     fn interleave_distance_mixed_none_and_null() -> Result<()> {
         use arrow_array::Float64Array;
 
-        let wkbs1 = vec![point_wkb(10.0, 10.0)];
-        let wkbs2 = vec![point_wkb(20.0, 20.0)];
-        let wkbs3 = vec![point_wkb(30.0, 30.0)];
+        let wkbs1 = vec![wkb_point((10.0, 10.0)).unwrap()];
+        let wkbs2 = vec![wkb_point((20.0, 20.0)).unwrap()];
+        let wkbs3 = vec![wkb_point((30.0, 30.0)).unwrap()];
 
         let null_array = Arc::new(Float64Array::new_null(1));
         let ega1 = make_geom_array_with_distance(wkbs1, Some(ColumnarValue::Array(null_array)))?;
diff --git a/rust/sedona-spatial-join/src/prepare.rs b/rust/sedona-spatial-join/src/prepare.rs
index 76e825b3..7198c2e5 100644
--- a/rust/sedona-spatial-join/src/prepare.rs
+++ b/rust/sedona-spatial-join/src/prepare.rs
@@ -21,8 +21,9 @@ use arrow_schema::SchemaRef;
 use datafusion_common::Result;
 use datafusion_common_runtime::JoinSet;
 use datafusion_execution::{
-    disk_manager::RefCountedTempFile, memory_pool::MemoryConsumer, SendableRecordBatchStream,
-    TaskContext,
+    disk_manager::RefCountedTempFile,
+    memory_pool::{MemoryConsumer, MemoryReservation},
+    SendableRecordBatchStream, TaskContext,
 };
 use datafusion_expr::JoinType;
 use datafusion_physical_plan::metrics::ExecutionPlanMetricsSet;
@@ -39,16 +40,19 @@ use crate::{
         SpatialJoinBuildMetrics,
     },
     partitioning::{
+        flat::FlatPartitioner,
         kdb::KDBPartitioner,
         stream_repartitioner::{SpilledPartition, SpilledPartitions, StreamRepartitioner},
         PartitionedSide, SpatialPartition, SpatialPartitioner,
     },
+    probe::partitioned_stream_provider::ProbeStreamOptions,
     spatial_predicate::SpatialPredicate,
     utils::bbox_sampler::BoundingBoxSamples,
 };
 
 pub(crate) struct SpatialJoinComponents {
     pub partitioned_index_provider: Arc<PartitionedIndexProvider>,
+    pub probe_stream_options: ProbeStreamOptions,
 }
 
 /// Builder for constructing `SpatialJoinComponents` from build-side streams.
@@ -110,17 +114,7 @@ impl SpatialJoinComponentsBuilder {
         let num_partitions = build_streams.len();
         if num_partitions == 0 {
             log::debug!("Build side has no data. Creating empty spatial index.");
-            let partitioned_index_provider = PartitionedIndexProvider::new_empty(
-                self.build_schema,
-                self.spatial_predicate,
-                self.sedona_options.spatial_join,
-                self.join_type,
-                self.probe_threads_count,
-                SpatialJoinBuildMetrics::new(0, &self.metrics),
-            );
-            return Ok(SpatialJoinComponents {
-                partitioned_index_provider: Arc::new(partitioned_index_provider),
-            });
+            return self.create_spatial_join_components_for_empty_build_side();
         }
 
         let mut rng = Rng::with_seed(self.seed);
@@ -133,33 +127,11 @@ impl SpatialJoinComponentsBuilder {
         let memory_plan =
             compute_memory_plan(build_partitions.iter().map(PartitionMemorySummary::from))?;
         log::debug!("Computed memory plan for spatial join:\n{:#?}", memory_plan);
-        let num_partitions = match self
-            .sedona_options
-            .spatial_join
-            .debug
-            .num_spatial_partitions
-        {
-            NumSpatialPartitionsConfig::Auto => memory_plan.num_partitions,
-            NumSpatialPartitionsConfig::Fixed(n) => {
-                log::debug!("Override number of spatial partitions to {}", n);
-                n
-            }
-        };
+        let num_partitions = self.num_spatial_partitions(&memory_plan);
 
         if num_partitions == 1 {
             log::debug!("Running single-partitioned in-memory spatial join");
-            let partitioned_index_provider = PartitionedIndexProvider::new_single_partition(
-                self.build_schema,
-                self.spatial_predicate,
-                self.sedona_options.spatial_join,
-                self.join_type,
-                self.probe_threads_count,
-                build_partitions,
-                SpatialJoinBuildMetrics::new(0, &self.metrics),
-            );
-            Ok(SpatialJoinComponents {
-                partitioned_index_provider: Arc::new(partitioned_index_provider),
-            })
+            self.create_single_partitioned_spatial_join_components(build_partitions)
         } else {
             // Collect all memory reservations grown during build side collection
             let mut reservations = Vec::with_capacity(build_partitions.len());
@@ -167,13 +139,19 @@ impl SpatialJoinComponentsBuilder {
                 reservations.push(partition.reservation.take());
             }
 
-            // Partition the build side into multiple spatial partitions, each partition can be fully
-            // loaded into an in-memory spatial index
-            let build_partitioner = self.build_spatial_partitioner(
+            // Create the spatial partitioner for partitioning the build side. The actual number of
+            // spatial partitions may be different from the requested number of partitions due to the
+            // characteristics of the spatial partitioner (e.g., KDB).
+            let build_partitioner = self.create_spatial_partitioner_for_build_side(
                 num_partitions,
                 &mut build_partitions,
                 rng.u64(0..0xFFFF),
             )?;
+            let num_partitions = build_partitioner.num_regular_partitions();
+            log::debug!("Actual number of spatial partitions: {}", num_partitions);
+
+            // Partition the build side into multiple spatial partitions, each partition can be fully
+            // loaded into an in-memory spatial index
             let partitioned_spill_files_vec = self
                 .repartition_build_side(build_partitions, build_partitioner, &memory_plan)
                 .await?;
@@ -196,20 +174,18 @@ impl SpatialJoinComponentsBuilder {
                 }
             }
 
-            let partitioned_index_provider = PartitionedIndexProvider::new_multi_partition(
-                self.build_schema,
-                self.spatial_predicate,
-                self.sedona_options.spatial_join,
-                self.join_type,
-                self.probe_threads_count,
+            // Create the probe side partitioner matching the build side partitioner
+            let probe_partitioner = self.create_spatial_partitioner_for_probe_side(
+                num_partitions,
+                &merged_spilled_partitions,
+            )?;
+
+            self.create_multi_partitioned_spatial_join_components(
                 merged_spilled_partitions,
-                SpatialJoinBuildMetrics::new(0, &self.metrics),
+                probe_partitioner,
                 reservations,
-            );
-
-            Ok(SpatialJoinComponents {
-                partitioned_index_provider: Arc::new(partitioned_index_provider),
-            })
+                &memory_plan,
+            )
         }
     }
 
@@ -261,7 +237,7 @@ impl SpatialJoinComponentsBuilder {
     /// Construct a `SpatialPartitioner` (e.g. KDB) from collected samples so
     /// the build and probe sides can be partitioned spatially across
     /// `num_partitions`.
-    fn build_spatial_partitioner(
+    fn create_spatial_partitioner_for_build_side(
         &self,
         num_partitions: usize,
         build_partitions: &mut Vec<BuildPartition>,
@@ -316,6 +292,30 @@ impl SpatialJoinComponentsBuilder {
         Ok(build_partitioner)
     }
 
+    /// Construct a `SpatialPartitioner` (e.g. Flat) from the statistics of partitioned build
+    /// side for partitioning the probe side.
+    fn create_spatial_partitioner_for_probe_side(
+        &self,
+        num_partitions: usize,
+        merged_spilled_partitions: &SpilledPartitions,
+    ) -> Result<Arc<dyn SpatialPartitioner>> {
+        let probe_partitioner: Arc<dyn SpatialPartitioner> = {
+            // Build a flat partitioner using these partitions
+            let mut partition_bounds = Vec::with_capacity(num_partitions);
+            for k in 0..num_partitions {
+                let partition = SpatialPartition::Regular(k as u32);
+                let partition_bound = merged_spilled_partitions
+                    .spilled_partition(partition)?
+                    .bounding_box()
+                    .cloned()
+                    .unwrap_or(BoundingBox::empty());
+                partition_bounds.push(partition_bound);
+            }
+            Arc::new(FlatPartitioner::try_new(partition_bounds)?)
+        };
+        Ok(probe_partitioner)
+    }
+
     /// Repartition the collected build-side partitions using the provided
     /// `SpatialPartitioner`. Returns the spilled partitions for each spatial partition.
     async fn repartition_build_side(
@@ -330,33 +330,8 @@ impl SpatialJoinComponentsBuilder {
         let session_config = self.context.session_config();
         let target_batch_size = session_config.batch_size();
         let spill_compression = session_config.spill_compression();
-        let spilled_batch_in_memory_size_threshold = if self
-            .sedona_options
-            .spatial_join
-            .spilled_batch_in_memory_size_threshold
-            == 0
-        {
-            None
-        } else {
-            Some(
-                self.sedona_options
-                    .spatial_join
-                    .spilled_batch_in_memory_size_threshold,
-            )
-        };
-
-        let memory_for_intermittent_usage = match self
-            .sedona_options
-            .spatial_join
-            .debug
-            .memory_for_intermittent_usage
-        {
-            Some(value) => {
-                log::debug!("Override memory for intermittent usage to {}", value);
-                value
-            }
-            None => memory_plan.memory_for_intermittent_usage,
-        };
+        let spilled_batch_in_memory_size_threshold = self.spilled_batch_in_memory_size_threshold();
+        let memory_for_intermittent_usage = self.memory_for_intermittent_usage(memory_plan);
 
         let mut join_set = JoinSet::new();
         let buffer_bytes_threshold = memory_for_intermittent_usage / build_partitions.len();
@@ -388,6 +363,153 @@ impl SpatialJoinComponentsBuilder {
         let partitioned_spill_files_vec = results.into_iter().collect::<Result<Vec<_>>>()?;
         Ok(partitioned_spill_files_vec)
     }
+
+    fn create_spatial_join_components_for_empty_build_side(self) -> Result<SpatialJoinComponents> {
+        let session_config = self.context.session_config();
+        let target_batch_size = session_config.batch_size();
+        let spilled_batch_in_memory_size_threshold = self.spilled_batch_in_memory_size_threshold();
+
+        let partitioned_index_provider = PartitionedIndexProvider::new_empty(
+            self.build_schema,
+            self.spatial_predicate,
+            self.sedona_options.spatial_join,
+            self.join_type,
+            self.probe_threads_count,
+            SpatialJoinBuildMetrics::new(0, &self.metrics),
+        );
+
+        let probe_stream_options = ProbeStreamOptions {
+            partitioner: None,
+            target_batch_rows: target_batch_size,
+            spill_compression: session_config.spill_compression(),
+            buffer_bytes_threshold: 0,
+            spilled_batch_in_memory_size_threshold,
+        };
+
+        Ok(SpatialJoinComponents {
+            partitioned_index_provider: Arc::new(partitioned_index_provider),
+            probe_stream_options,
+        })
+    }
+
+    fn create_single_partitioned_spatial_join_components(
+        self,
+        build_partitions: Vec<BuildPartition>,
+    ) -> Result<SpatialJoinComponents> {
+        let session_config = self.context.session_config();
+        let target_batch_size = session_config.batch_size();
+        let spilled_batch_in_memory_size_threshold = self.spilled_batch_in_memory_size_threshold();
+        let spill_compression = session_config.spill_compression();
+
+        let partitioned_index_provider = PartitionedIndexProvider::new_single_partition(
+            self.build_schema,
+            self.spatial_predicate,
+            self.sedona_options.spatial_join,
+            self.join_type,
+            self.probe_threads_count,
+            build_partitions,
+            SpatialJoinBuildMetrics::new(0, &self.metrics),
+        );
+
+        let probe_stream_options = ProbeStreamOptions {
+            partitioner: None,
+            target_batch_rows: target_batch_size,
+            spill_compression,
+            buffer_bytes_threshold: 0,
+            spilled_batch_in_memory_size_threshold,
+        };
+
+        Ok(SpatialJoinComponents {
+            partitioned_index_provider: Arc::new(partitioned_index_provider),
+            probe_stream_options,
+        })
+    }
+
+    fn create_multi_partitioned_spatial_join_components(
+        self,
+        merged_spilled_partitions: SpilledPartitions,
+        probe_partitioner: Arc<dyn SpatialPartitioner>,
+        reservations: Vec<MemoryReservation>,
+        memory_plan: &MemoryPlan,
+    ) -> Result<SpatialJoinComponents> {
+        let session_config = self.context.session_config();
+        let target_batch_size = session_config.batch_size();
+        let spilled_batch_in_memory_size_threshold = self.spilled_batch_in_memory_size_threshold();
+        let spill_compression = session_config.spill_compression();
+        let memory_for_intermittent_usage = self.memory_for_intermittent_usage(memory_plan);
+
+        let partitioned_index_provider = PartitionedIndexProvider::new_multi_partition(
+            self.build_schema,
+            self.spatial_predicate,
+            self.sedona_options.spatial_join,
+            self.join_type,
+            self.probe_threads_count,
+            merged_spilled_partitions,
+            SpatialJoinBuildMetrics::new(0, &self.metrics),
+            reservations,
+        );
+
+        let buffer_bytes_threshold = memory_for_intermittent_usage / self.probe_threads_count;
+        let probe_stream_options = ProbeStreamOptions {
+            partitioner: Some(probe_partitioner),
+            target_batch_rows: target_batch_size,
+            spill_compression,
+            buffer_bytes_threshold,
+            spilled_batch_in_memory_size_threshold,
+        };
+
+        Ok(SpatialJoinComponents {
+            partitioned_index_provider: Arc::new(partitioned_index_provider),
+            probe_stream_options,
+        })
+    }
+
+    fn num_spatial_partitions(&self, memory_plan: &MemoryPlan) -> usize {
+        match self
+            .sedona_options
+            .spatial_join
+            .debug
+            .num_spatial_partitions
+        {
+            NumSpatialPartitionsConfig::Auto => memory_plan.num_partitions,
+            NumSpatialPartitionsConfig::Fixed(n) => {
+                log::debug!("Override number of spatial partitions to {}", n);
+                n
+            }
+        }
+    }
+
+    fn spilled_batch_in_memory_size_threshold(&self) -> Option<usize> {
+        if self
+            .sedona_options
+            .spatial_join
+            .spilled_batch_in_memory_size_threshold
+            == 0
+        {
+            None
+        } else {
+            Some(
+                self.sedona_options
+                    .spatial_join
+                    .spilled_batch_in_memory_size_threshold,
+            )
+        }
+    }
+
+    fn memory_for_intermittent_usage(&self, memory_plan: &MemoryPlan) -> usize {
+        match self
+            .sedona_options
+            .spatial_join
+            .debug
+            .memory_for_intermittent_usage
+        {
+            Some(value) => {
+                log::debug!("Override memory for intermittent usage to {}", value);
+                value
+            }
+            None => memory_plan.memory_for_intermittent_usage,
+        }
+    }
 }
 
 /// Aggregate the spill files and bounds of each spatial partition collected from all build partitions
diff --git a/rust/sedona-spatial-join/src/probe.rs b/rust/sedona-spatial-join/src/probe.rs
new file mode 100644
index 00000000..6f749b8f
--- /dev/null
+++ b/rust/sedona-spatial-join/src/probe.rs
@@ -0,0 +1,45 @@
+// 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 datafusion_physical_plan::metrics::{
+    self, ExecutionPlanMetricsSet, MetricBuilder, SpillMetrics,
+};
+
+#[derive(Clone, Debug)]
+pub(crate) struct ProbeStreamMetrics {
+    pub probe_input_batches: metrics::Count,
+    pub probe_input_rows: metrics::Count,
+    pub repartition_time: metrics::Time,
+    pub spill_metrics: SpillMetrics,
+}
+
+impl ProbeStreamMetrics {
+    pub fn new(partition: usize, metrics: &ExecutionPlanMetricsSet) -> Self {
+        Self {
+            probe_input_batches: MetricBuilder::new(metrics)
+                .counter("probe_input_batches", partition),
+            probe_input_rows: MetricBuilder::new(metrics).counter("probe_input_rows", partition),
+            repartition_time: MetricBuilder::new(metrics)
+                .subset_time("partition_probe_time", partition),
+            spill_metrics: SpillMetrics::new(metrics, partition),
+        }
+    }
+}
+
+pub(crate) mod first_pass_stream;
+pub(crate) mod non_partitioned_stream;
+pub(crate) mod partitioned_stream_provider;
diff --git a/rust/sedona-spatial-join/src/probe/first_pass_stream.rs b/rust/sedona-spatial-join/src/probe/first_pass_stream.rs
new file mode 100644
index 00000000..7e75b344
--- /dev/null
+++ b/rust/sedona-spatial-join/src/probe/first_pass_stream.rs
@@ -0,0 +1,247 @@
+// 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::VecDeque,
+    pin::Pin,
+    sync::Arc,
+    task::{Context, Poll},
+};
+
+use datafusion_common::{DataFusionError, Result};
+use futures::{Stream, StreamExt};
+use sedona_common::sedona_internal_err;
+
+use crate::probe::ProbeStreamMetrics;
+use crate::{
+    evaluated_batch::{
+        evaluated_batch_stream::{EvaluatedBatchStream, SendableEvaluatedBatchStream},
+        EvaluatedBatch,
+    },
+    partitioning::{
+        stream_repartitioner::{
+            assign_rows, interleave_evaluated_batch, SpilledPartitions, StreamRepartitioner,
+        },
+        PartitionedSide, SpatialPartition, SpatialPartitioner,
+    },
+};
+
+/// A stream that handles the first pass of partitioned spatial join probing.
+/// It splits incoming evaluated batches into produced batches and spilled batches,
+/// updating probe stream metrics accordingly. Once the source stream is exhausted,
+/// it finalizes the repartitioner and invokes a callback with the spilled partitions.
+///
+/// The stream produces only the rows assigned to Regular(0) or None partitions.
+/// The rows assigned to other partitions are spilled and will be handled by the
+/// subsequent passes for those partitions.
+pub(crate) struct FirstPassStream<C: FirstPassStreamCallback> {
+    source: SendableEvaluatedBatchStream,
+    repartitioner: Option<StreamRepartitioner>,
+    partitioner: Arc<dyn SpatialPartitioner>,
+    pending_output: VecDeque<Result<EvaluatedBatch>>,
+    metrics: ProbeStreamMetrics,
+    callback: Option<C>,
+}
+
+pub(crate) trait FirstPassStreamCallback {
+    fn call(self, result: Result<SpilledPartitions>) -> Result<()>;
+}
+
+impl<F: FnOnce(Result<SpilledPartitions>) -> Result<()>> FirstPassStreamCallback for F {
+    fn call(self, result: Result<SpilledPartitions>) -> Result<()> {
+        self(result)
+    }
+}
+
+impl<C: FirstPassStreamCallback> FirstPassStream<C> {
+    pub fn new(
+        source: SendableEvaluatedBatchStream,
+        repartitioner: StreamRepartitioner,
+        partitioner: Arc<dyn SpatialPartitioner>,
+        metrics: ProbeStreamMetrics,
+        callback: C,
+    ) -> Self {
+        Self {
+            source,
+            repartitioner: Some(repartitioner),
+            partitioner,
+            pending_output: VecDeque::new(),
+            metrics,
+            callback: Some(callback),
+        }
+    }
+
+    fn finish_first_pass(&mut self) -> Result<()> {
+        let repartitioner = self.repartitioner.take().ok_or_else(|| {
+            DataFusionError::Internal("First pass repartitioner already finished".into())
+        })?;
+        let parts = repartitioner.finish()?;
+        let callback_opt = self.callback.take();
+        match callback_opt {
+            Some(callback) => callback.call(Ok(parts)),
+            None => sedona_internal_err!("Callback has already been called"),
+        }
+    }
+
+    fn transition_to_failed(&mut self, err: DataFusionError) -> DataFusionError {
+        let err_arc = Arc::new(err);
+        let callback_opt = self.callback.take();
+        if let Some(callback) = callback_opt {
+            if let Err(e) = callback.call(Err(DataFusionError::Shared(err_arc.clone()))) {
+                log::warn!(
+                    "Failed to invoke first pass stream callback on error: {}",
+                    e
+                );
+            }
+        }
+        DataFusionError::Shared(err_arc)
+    }
+}
+
+impl<C: FirstPassStreamCallback + Unpin> EvaluatedBatchStream for FirstPassStream<C> {
+    fn is_external(&self) -> bool {
+        false
+    }
+
+    fn schema(&self) -> arrow_schema::SchemaRef {
+        self.source.schema()
+    }
+}
+
+impl<C: FirstPassStreamCallback + Unpin> Stream for FirstPassStream<C> {
+    type Item = Result<EvaluatedBatch>;
+
+    fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
+        let this = self.get_mut();
+
+        loop {
+            if let Some(result) = this.pending_output.pop_front() {
+                return Poll::Ready(Some(result));
+            }
+
+            match this.source.poll_next_unpin(cx) {
+                Poll::Ready(Some(Ok(batch))) => {
+                    this.metrics.probe_input_batches.add(1);
+                    this.metrics.probe_input_rows.add(batch.num_rows());
+
+                    let first_pass_split_result = {
+                        let _timer = this.metrics.repartition_time.timer();
+                        split_for_first_pass(batch, this.partitioner.as_ref())
+                    };
+
+                    let split = match first_pass_split_result {
+                        Ok(split) => split,
+                        Err(err) => {
+                            let err = this.transition_to_failed(err);
+                            return Poll::Ready(Some(Err(err)));
+                        }
+                    };
+
+                    if let Some(batch) = split.produced {
+                        this.pending_output.push_back(Ok(batch));
+                    }
+
+                    if let Some((spill_batch, assignments)) = split.spilled {
+                        if let Some(repartitioner) = this.repartitioner.as_mut() {
+                            if let Err(err) =
+                                repartitioner.insert_repartitioned_batch(spill_batch, &assignments)
+                            {
+                                let err = this.transition_to_failed(err);
+                                return Poll::Ready(Some(Err(err)));
+                            }
+                        }
+                    }
+                }
+                Poll::Ready(Some(Err(e))) => {
+                    let err = this.transition_to_failed(e);
+                    return Poll::Ready(Some(Err(err)));
+                }
+                Poll::Ready(None) => {
+                    if let Err(err) = this.finish_first_pass() {
+                        let err = this.transition_to_failed(err);
+                        return Poll::Ready(Some(Err(err)));
+                    }
+                    return Poll::Ready(None);
+                }
+                Poll::Pending => return Poll::Pending,
+            }
+        }
+    }
+}
+
+/// The result of splitting an evaluated batch for producing batches for the first pass.
+/// Some rows are produced directly, while others are spilled for further processing.
+struct FirstPassSplit {
+    /// Rows assigned to Regular(0) or None partition are produced directly
+    produced: Option<EvaluatedBatch>,
+    /// Rows assigned to other partitions are spilled for further passes
+    spilled: Option<(EvaluatedBatch, Vec<SpatialPartition>)>,
+}
+
+fn split_for_first_pass(
+    batch: EvaluatedBatch,
+    partitioner: &dyn SpatialPartitioner,
+) -> Result<FirstPassSplit> {
+    let mut assignments = Vec::new();
+    assign_rows(
+        &batch,
+        partitioner,
+        PartitionedSide::ProbeSide,
+        &mut assignments,
+    )?;
+
+    let record_batches = vec![&batch.batch];
+    let geom_arrays = vec![&batch.geom_array];
+
+    let mut regular_assignments = Vec::new();
+    let mut spill_assignments = Vec::new();
+    let mut spill_partitions = Vec::new();
+
+    for (row_idx, partition) in assignments.into_iter().enumerate() {
+        match partition {
+            SpatialPartition::Regular(0) | SpatialPartition::None => {
+                regular_assignments.push((0, row_idx))
+            }
+            other => {
+                spill_assignments.push((0, row_idx));
+                spill_partitions.push(other);
+            }
+        }
+    }
+
+    let regular0 = if regular_assignments.is_empty() {
+        None
+    } else {
+        Some(interleave_evaluated_batch(
+            &record_batches,
+            &geom_arrays,
+            &regular_assignments,
+        )?)
+    };
+
+    let spill_batch = if spill_assignments.is_empty() {
+        None
+    } else {
+        let batch = interleave_evaluated_batch(&record_batches, &geom_arrays, &spill_assignments)?;
+        Some((batch, spill_partitions))
+    };
+
+    Ok(FirstPassSplit {
+        produced: regular0,
+        spilled: spill_batch,
+    })
+}
diff --git a/rust/sedona-spatial-join/src/probe/non_partitioned_stream.rs b/rust/sedona-spatial-join/src/probe/non_partitioned_stream.rs
new file mode 100644
index 00000000..6280fd91
--- /dev/null
+++ b/rust/sedona-spatial-join/src/probe/non_partitioned_stream.rs
@@ -0,0 +1,69 @@
+// 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::{
+    pin::Pin,
+    task::{Context, Poll},
+};
+
+use datafusion_common::Result;
+use futures::{Stream, StreamExt};
+
+use crate::evaluated_batch::{
+    evaluated_batch_stream::{EvaluatedBatchStream, SendableEvaluatedBatchStream},
+    EvaluatedBatch,
+};
+use crate::probe::ProbeStreamMetrics;
+
+/// A non-partitioned evaluated batch stream that simply forwards batches from an inner stream,
+/// while updating probe stream metrics. This is for running non-partitioned fully in-memory
+/// spatial joins.
+pub(crate) struct NonPartitionedStream {
+    inner: SendableEvaluatedBatchStream,
+    metrics: ProbeStreamMetrics,
+}
+
+impl NonPartitionedStream {
+    pub fn new(inner: SendableEvaluatedBatchStream, metrics: ProbeStreamMetrics) -> Self {
+        Self { inner, metrics }
+    }
+}
+
+impl Stream for NonPartitionedStream {
+    type Item = Result<EvaluatedBatch>;
+
+    fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
+        match self.inner.poll_next_unpin(cx) {
+            Poll::Ready(Some(Ok(batch))) => {
+                self.metrics.probe_input_batches.add(1);
+                self.metrics.probe_input_rows.add(batch.num_rows());
+                Poll::Ready(Some(Ok(batch)))
+            }
+            other => other,
+        }
+    }
+}
+
+impl EvaluatedBatchStream for NonPartitionedStream {
+    fn is_external(&self) -> bool {
+        self.inner.as_ref().get_ref().is_external()
+    }
+
+    fn schema(&self) -> arrow_schema::SchemaRef {
+        self.inner.schema()
+    }
+}
diff --git a/rust/sedona-spatial-join/src/probe/partitioned_stream_provider.rs b/rust/sedona-spatial-join/src/probe/partitioned_stream_provider.rs
new file mode 100644
index 00000000..1a23379c
--- /dev/null
+++ b/rust/sedona-spatial-join/src/probe/partitioned_stream_provider.rs
@@ -0,0 +1,528 @@
+// 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::ops::DerefMut;
+use std::sync::Arc;
+
+use arrow_schema::SchemaRef;
+use datafusion::config::SpillCompression;
+use datafusion_common::{DataFusionError, Result};
+use datafusion_execution::runtime_env::RuntimeEnv;
+use parking_lot::Mutex;
+use sedona_common::sedona_internal_err;
+
+use crate::probe::first_pass_stream::FirstPassStream;
+use crate::probe::non_partitioned_stream::NonPartitionedStream;
+use crate::probe::ProbeStreamMetrics;
+use crate::{
+    evaluated_batch::evaluated_batch_stream::{
+        external::ExternalEvaluatedBatchStream, SendableEvaluatedBatchStream,
+    },
+    partitioning::{
+        stream_repartitioner::{SpilledPartitions, StreamRepartitioner},
+        PartitionedSide, SpatialPartition, SpatialPartitioner,
+    },
+};
+
+#[derive(Clone)]
+/// Configuration options for creating a probe-side stream provider.
+///
+/// When a `partitioner` is provided, the provider performs an initial first pass that
+/// repartitions and spills the probe-side input into per-partition spill files. Subsequent
+/// calls can then open a stream for a specific [`SpatialPartition`].
+pub(crate) struct ProbeStreamOptions {
+    /// Optional spatial partitioner.
+    ///
+    /// - `None` means the probe side is treated as a single, non-partitioned stream and only
+    ///   [`SpatialPartition::Regular(0)`] is supported.
+    /// - `Some(_)` enables partitioned streaming with a warm-up (first) pass.
+    pub partitioner: Option<Arc<dyn SpatialPartitioner>>,
+    /// Target number of rows per output batch produced by the partitioning stream.
+    pub target_batch_rows: usize,
+    /// Spill compression to use when writing partition spill files.
+    pub spill_compression: SpillCompression,
+    /// Threshold (in bytes) before buffered repartitioned data is spilled.
+    pub buffer_bytes_threshold: usize,
+    /// Optional upper bound for the size of spilled batches. Large spilled batches will be split
+    /// into smaller ones to avoid excessive memory usage during re-reading.
+    pub spilled_batch_in_memory_size_threshold: Option<usize>,
+}
+
+/// Provides probe-side streams for a given [`SpatialPartition`].
+///
+/// For partitioned joins this provider is a small state machine:
+/// it first runs the first pass to materialize per-partition spill files, then serves
+/// per-partition streams from those spill files.
+pub(crate) struct PartitionedProbeStreamProvider {
+    state: Arc<Mutex<ProbeStreamState>>,
+    runtime_env: Arc<RuntimeEnv>,
+    options: ProbeStreamOptions,
+    schema: SchemaRef,
+    metrics: ProbeStreamMetrics,
+}
+
+enum ProbeStreamState {
+    /// Initial state: we still own the original source stream and have not started consuming it.
+    Pending {
+        source: SendableEvaluatedBatchStream,
+    },
+    /// First pass is currently running.
+    ///
+    /// The provider is consuming the source stream and repartitioning/spilling it into
+    /// per-partition spill files.
+    FirstPass,
+    /// First pass completed successfully and per-partition spill files are available.
+    SubsequentPass { manifest: ProbePartitionManifest },
+    /// Non-partitioned mode: the single probe stream has been consumed and cannot be replayed.
+    NonPartitionedConsumed,
+    /// Terminal failure state.
+    ///
+    /// Any later interaction with the provider will surface this error.
+    Failed(Arc<DataFusionError>),
+}
+
+impl PartitionedProbeStreamProvider {
+    /// Create a new provider from a probe-side evaluated batch stream.
+    pub fn new(
+        runtime_env: Arc<RuntimeEnv>,
+        options: ProbeStreamOptions,
+        source: SendableEvaluatedBatchStream,
+        metrics: ProbeStreamMetrics,
+    ) -> Self {
+        let schema = source.schema();
+        Self {
+            state: Arc::new(Mutex::new(ProbeStreamState::Pending { source })),
+            runtime_env,
+            options,
+            schema,
+            metrics,
+        }
+    }
+
+    /// Return a probe-side stream for the requested [`SpatialPartition`].
+    ///
+    /// - In non-partitioned mode (`options.partitioner == None`), only
+    ///   [`SpatialPartition::Regular(0)`] is supported.
+    /// - In partitioned mode, `Regular(0)` triggers the warm-up (first) pass; all other partitions
+    ///   are served from the spill manifest created by the first pass.
+    pub fn stream_for(&self, partition: SpatialPartition) -> Result<SendableEvaluatedBatchStream> {
+        match partition {
+            SpatialPartition::None => sedona_internal_err!(
+                "SpatialPartition::None should be handled via outer join logic"
+            ),
+            SpatialPartition::Regular(0) => self.first_pass_stream(),
+            SpatialPartition::Regular(_) | SpatialPartition::Multi => {
+                if self.options.partitioner.is_none() {
+                    sedona_internal_err!("Non-partitioned probe stream only supports Regular(0)")
+                } else {
+                    self.subsequent_pass_stream(partition)
+                }
+            }
+        }
+    }
+
+    fn first_pass_stream(&self) -> Result<SendableEvaluatedBatchStream> {
+        if self.options.partitioner.is_none() {
+            return self.non_partitioned_first_pass_stream();
+        }
+
+        let schema = Arc::clone(&self.schema);
+        let mut state_guard = self.state.lock();
+        match std::mem::replace(&mut *state_guard, ProbeStreamState::FirstPass) {
+            ProbeStreamState::Pending { source } => {
+                let partitioner = Arc::clone(
+                    self.options
+                        .partitioner
+                        .as_ref()
+                        .expect("Partitioned first pass requires a partitioner"),
+                );
+                let repartitioner = StreamRepartitioner::builder(
+                    Arc::clone(&self.runtime_env),
+                    Arc::clone(&partitioner),
+                    PartitionedSide::ProbeSide,
+                    self.metrics.spill_metrics.clone(),
+                )
+                .spill_compression(self.options.spill_compression)
+                .buffer_bytes_threshold(self.options.buffer_bytes_threshold)
+                .target_batch_size(self.options.target_batch_rows)
+                .spilled_batch_in_memory_size_threshold(
+                    self.options.spilled_batch_in_memory_size_threshold,
+                )
+                .build();
+
+                let state = Arc::clone(&self.state);
+                let callback = move |res: Result<SpilledPartitions>| {
+                    let mut guard = state.lock();
+                    *guard = match res {
+                        Ok(mut spills) => {
+                            let mut s = String::new();
+                            if spills.debug_print(&mut s).is_ok() {
+                                log::debug!("Probe side spilled partitions:\n{}", s);
+                            }
+
+                            // Sanity check: Regular(0) and None should be empty
+                            let mut check_empty = |partition: SpatialPartition| -> Result<()> {
+                                let spilled = spills.take_spilled_partition(partition)?;
+                                if !spilled.into_spill_files().is_empty() {
+                                    return sedona_internal_err!(
+                                        "{:?} partition should not have spilled data",
+                                        partition
+                                    );
+                                }
+                                Ok(())
+                            };
+
+                            match check_empty(SpatialPartition::Regular(0))
+                                .and_then(|_| check_empty(SpatialPartition::None))
+                            {
+                                Ok(_) => ProbeStreamState::SubsequentPass {
+                                    manifest: ProbePartitionManifest::new(schema, spills),
+                                },
+                                Err(err) => ProbeStreamState::Failed(Arc::new(err)),
+                            }
+                        }
+                        Err(err) => {
+                            let err_arc = Arc::new(err);
+                            ProbeStreamState::Failed(Arc::clone(&err_arc))
+                        }
+                    };
+                    Ok(())
+                };
+
+                let first_pass = FirstPassStream::new(
+                    source,
+                    repartitioner,
+                    partitioner,
+                    self.metrics.clone(),
+                    callback,
+                );
+                Ok(Box::pin(first_pass))
+            }
+            ProbeStreamState::FirstPass => {
+                sedona_internal_err!("First pass already running for partitioned probe stream")
+            }
+            ProbeStreamState::SubsequentPass { .. } => {
+                sedona_internal_err!("First pass already completed")
+            }
+            ProbeStreamState::NonPartitionedConsumed => {
+                sedona_internal_err!("Non-partitioned probe stream already consumed")
+            }
+            ProbeStreamState::Failed(err) => Err(DataFusionError::Shared(err)),
+        }
+    }
+
+    fn non_partitioned_first_pass_stream(&self) -> Result<SendableEvaluatedBatchStream> {
+        let mut state_guard = self.state.lock();
+        match std::mem::replace(&mut *state_guard, ProbeStreamState::NonPartitionedConsumed) {
+            ProbeStreamState::Pending { source } => Ok(Box::pin(NonPartitionedStream::new(
+                source,
+                self.metrics.clone(),
+            ))),
+            ProbeStreamState::NonPartitionedConsumed => {
+                sedona_internal_err!("Non-partitioned probe stream already consumed")
+            }
+            ProbeStreamState::Failed(err) => Err(DataFusionError::Shared(err)),
+            _ => sedona_internal_err!("Non-partitioned probe stream is not available"),
+        }
+    }
+
+    fn subsequent_pass_stream(
+        &self,
+        partition: SpatialPartition,
+    ) -> Result<SendableEvaluatedBatchStream> {
+        if self.options.partitioner.is_none() {
+            return sedona_internal_err!(
+                "Non-partitioned probe stream cannot serve additional partitions"
+            );
+        }
+        let mut locked = self.state.lock();
+        let manifest = match locked.deref_mut() {
+            ProbeStreamState::SubsequentPass { manifest } => manifest,
+            ProbeStreamState::Failed(err) => return Err(DataFusionError::Shared(Arc::clone(err))),
+            _ => return sedona_internal_err!("Partitioned probe stream first pass not finished"),
+        };
+
+        {
+            // let mut manifest = manifest.lock();
+            manifest.stream_for(partition)
+        }
+    }
+
+    /// Return the number of rows available for `partition`.
+    ///
+    /// This is only available after the first pass has completed.
+    pub fn get_partition_row_count(&self, partition: SpatialPartition) -> Result<usize> {
+        let mut locked = self.state.lock();
+        let manifest = match locked.deref_mut() {
+            ProbeStreamState::SubsequentPass { manifest } => manifest,
+            ProbeStreamState::Failed(err) => return Err(DataFusionError::Shared(Arc::clone(err))),
+            _ => return sedona_internal_err!("Partitioned probe stream first pass not finished"),
+        };
+        manifest.get_partition_row_count(partition)
+    }
+}
+
+/// Spill manifest produced by the probe-side first pass.
+///
+/// Stores (and hands out) per-partition spill files that can be replayed as
+/// [`SendableEvaluatedBatchStream`]s.
+struct ProbePartitionManifest {
+    schema: SchemaRef,
+    slots: SpilledPartitions,
+}
+
+impl ProbePartitionManifest {
+    fn new(schema: SchemaRef, spills: SpilledPartitions) -> Self {
+        Self {
+            schema,
+            slots: spills,
+        }
+    }
+
+    fn get_partition_row_count(&self, partition: SpatialPartition) -> Result<usize> {
+        let spilled = self.slots.get_spilled_partition(partition)?;
+        Ok(spilled.num_rows())
+    }
+
+    fn stream_for(&mut self, partition: SpatialPartition) -> Result<SendableEvaluatedBatchStream> {
+        match partition {
+            SpatialPartition::Regular(0) => {
+                sedona_internal_err!("Partition 0 is only available during the first pass")
+            }
+            SpatialPartition::None => {
+                sedona_internal_err!("Should not request a probe stream for SpatialPartition::None")
+            }
+            SpatialPartition::Regular(_) => {
+                let spilled = self.slots.take_spilled_partition(partition)?;
+                Ok(Box::pin(
+                    ExternalEvaluatedBatchStream::try_from_spill_files(
+                        Arc::clone(&self.schema),
+                        spilled.into_spill_files(),
+                    )?,
+                ))
+            }
+            SpatialPartition::Multi => {
+                let spilled = self.slots.get_spilled_partition(partition)?;
+                Ok(Box::pin(
+                    ExternalEvaluatedBatchStream::try_from_spill_files(
+                        Arc::clone(&self.schema),
+                        spilled.into_spill_files(),
+                    )?,
+                ))
+            }
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::evaluated_batch::EvaluatedBatch;
+    use crate::operand_evaluator::EvaluatedGeometryArray;
+    use crate::partitioning::flat::FlatPartitioner;
+    use crate::{
+        evaluated_batch::evaluated_batch_stream::in_mem::InMemoryEvaluatedBatchStream,
+        probe::ProbeStreamMetrics,
+    };
+    use arrow_array::{ArrayRef, BinaryArray, Int32Array, RecordBatch};
+    use arrow_schema::{DataType, Field, Schema, SchemaRef};
+    use datafusion::config::SpillCompression;
+    use datafusion_physical_plan::metrics::ExecutionPlanMetricsSet;
+    use futures::TryStreamExt;
+    use sedona_geometry::bounding_box::BoundingBox;
+    use sedona_geometry::wkb_factory::wkb_point;
+    use sedona_schema::datatypes::WKB_GEOMETRY;
+    use std::sync::Arc;
+
+    fn sample_schema() -> SchemaRef {
+        Arc::new(Schema::new(vec![Field::new("id", DataType::Int32, false)]))
+    }
+
+    fn sample_batch(ids: &[i32], wkbs: Vec<Option<Vec<u8>>>) -> Result<EvaluatedBatch> {
+        assert_eq!(ids.len(), wkbs.len());
+        let id_array = Arc::new(Int32Array::from(ids.to_vec())) as ArrayRef;
+        let batch = RecordBatch::try_new(sample_schema(), vec![id_array])?;
+        let geom_values: Vec<Option<&[u8]>> = wkbs
+            .iter()
+            .map(|maybe_wkb| maybe_wkb.as_ref().map(|buf| buf.as_slice()))
+            .collect();
+        let geom_array: ArrayRef = Arc::new(BinaryArray::from(geom_values));
+        let geom_array = EvaluatedGeometryArray::try_new(geom_array, &WKB_GEOMETRY)?;
+        Ok(EvaluatedBatch { batch, geom_array })
+    }
+
+    fn rect_wkb(min_x: f64, min_y: f64, max_x: f64, max_y: f64) -> Vec<u8> {
+        let mut buf = Vec::with_capacity(1 + 4 + 4 + 4 + 5 * 16);
+        buf.push(1u8);
+        buf.extend_from_slice(&3u32.to_le_bytes());
+        buf.extend_from_slice(&1u32.to_le_bytes());
+        buf.extend_from_slice(&5u32.to_le_bytes());
+        let coords = [
+            (min_x, min_y),
+            (max_x, min_y),
+            (max_x, max_y),
+            (min_x, max_y),
+            (min_x, min_y),
+        ];
+        for (x, y) in coords {
+            buf.extend_from_slice(&x.to_le_bytes());
+            buf.extend_from_slice(&y.to_le_bytes());
+        }
+        buf
+    }
+
+    fn ids_from_batches(batches: &[EvaluatedBatch]) -> Vec<Vec<i32>> {
+        batches
+            .iter()
+            .map(|batch| {
+                let array = batch
+                    .batch
+                    .column(0)
+                    .as_any()
+                    .downcast_ref::<Int32Array>()
+                    .unwrap();
+                (0..array.len())
+                    .map(|idx| array.value(idx))
+                    .collect::<Vec<_>>()
+            })
+            .collect::<Vec<_>>()
+    }
+
+    fn create_probe_stream(
+        batches: Vec<EvaluatedBatch>,
+        partitioner: Option<Arc<dyn SpatialPartitioner>>,
+    ) -> PartitionedProbeStreamProvider {
+        let runtime_env = Arc::new(RuntimeEnv::default());
+        assert!(!batches.is_empty(), "test batches should not be empty");
+        let schema = batches[0].schema();
+        let stream: SendableEvaluatedBatchStream =
+            Box::pin(InMemoryEvaluatedBatchStream::new(schema, batches));
+        PartitionedProbeStreamProvider::new(
+            runtime_env,
+            ProbeStreamOptions {
+                partitioner,
+                target_batch_rows: 1024,
+                spill_compression: SpillCompression::Uncompressed,
+                buffer_bytes_threshold: 0,
+                spilled_batch_in_memory_size_threshold: None,
+            },
+            stream,
+            ProbeStreamMetrics::new(0, &ExecutionPlanMetricsSet::new()),
+        )
+    }
+
+    fn sample_partitioner() -> Result<Arc<dyn SpatialPartitioner>> {
+        let partitions = vec![
+            BoundingBox::xy((0.0, 50.0), (0.0, 50.0)),
+            BoundingBox::xy((50.0, 100.0), (0.0, 50.0)),
+        ];
+        Ok(Arc::new(FlatPartitioner::try_new(partitions)?))
+    }
+
+    #[tokio::test]
+    async fn first_pass_emits_partition_zero_and_spills_rest() -> Result<()> {
+        let partitioner = sample_partitioner()?;
+        let batch = sample_batch(
+            &[0, 1, 2, 3],
+            vec![
+                Some(wkb_point((10.0, 10.0)).unwrap()),
+                Some(wkb_point((60.0, 10.0)).unwrap()),
+                Some(wkb_point((70.0, 20.0)).unwrap()),
+                Some(wkb_point((200.0, 200.0)).unwrap()),
+            ],
+        )?;
+        let probe_stream = create_probe_stream(vec![batch], Some(Arc::clone(&partitioner)));
+
+        let first_pass = probe_stream.stream_for(SpatialPartition::Regular(0))?;
+        let batches = first_pass.try_collect::<Vec<_>>().await?;
+        assert_eq!(ids_from_batches(&batches), vec![vec![0, 3]]);
+
+        let regular_one = probe_stream.stream_for(SpatialPartition::Regular(1))?;
+        let replay_batches = regular_one.try_collect::<Vec<_>>().await?;
+        assert_eq!(ids_from_batches(&replay_batches), vec![vec![1, 2]]);
+
+        assert!(probe_stream
+            .stream_for(SpatialPartition::Regular(1))
+            .is_err());
+        assert!(probe_stream
+            .stream_for(SpatialPartition::Regular(0))
+            .is_err());
+        Ok(())
+    }
+
+    #[tokio::test]
+    async fn requesting_regular_partition_before_first_pass_fails() -> Result<()> {
+        let partitioner = sample_partitioner()?;
+        let batch = sample_batch(&[0], vec![Some(wkb_point((60.0, 10.0)).unwrap())])?;
+        let probe_stream = create_probe_stream(vec![batch], Some(Arc::clone(&partitioner)));
+        assert!(probe_stream
+            .stream_for(SpatialPartition::Regular(1))
+            .is_err());
+
+        // After running first pass, subsequent requests should succeed once.
+        let first_pass = probe_stream.stream_for(SpatialPartition::Regular(0))?;
+        first_pass.try_collect::<Vec<_>>().await?;
+        let replay = probe_stream.stream_for(SpatialPartition::Regular(1))?;
+        let batches = replay.try_collect::<Vec<_>>().await?;
+        assert_eq!(ids_from_batches(&batches), vec![vec![0]]);
+        Ok(())
+    }
+
+    #[tokio::test]
+    async fn multi_partition_stream_consumed_multiple_times() -> Result<()> {
+        let partitioner = sample_partitioner()?;
+        let batch = sample_batch(&[0], vec![Some(rect_wkb(25.0, 0.0, 75.0, 20.0))])?;
+        let probe_stream = create_probe_stream(vec![batch], Some(partitioner));
+
+        let first_pass = probe_stream.stream_for(SpatialPartition::Regular(0))?;
+        first_pass.try_collect::<Vec<_>>().await?;
+
+        let multi_stream = probe_stream.stream_for(SpatialPartition::Multi)?;
+        let multi_batches = multi_stream.try_collect::<Vec<_>>().await?;
+        assert_eq!(ids_from_batches(&multi_batches), vec![vec![0]]);
+
+        let multi_stream_2 = probe_stream.stream_for(SpatialPartition::Multi)?;
+        let multi_batches_2 = multi_stream_2.try_collect::<Vec<_>>().await?;
+        assert_eq!(ids_from_batches(&multi_batches_2), vec![vec![0]]);
+        Ok(())
+    }
+
+    #[tokio::test]
+    async fn non_partitioned_stream_exposes_only_partition_zero() -> Result<()> {
+        let batch = sample_batch(
+            &[0, 1],
+            vec![
+                Some(wkb_point((10.0, 10.0)).unwrap()),
+                Some(wkb_point((12.0, 12.0)).unwrap()),
+            ],
+        )?;
+        let probe_stream = create_probe_stream(vec![batch], None);
+
+        let first_pass = probe_stream.stream_for(SpatialPartition::Regular(0))?;
+        let batches = first_pass.try_collect::<Vec<_>>().await?;
+        assert_eq!(ids_from_batches(&batches), vec![vec![0, 1]]);
+
+        assert!(probe_stream
+            .stream_for(SpatialPartition::Regular(0))
+            .is_err());
+        assert!(probe_stream
+            .stream_for(SpatialPartition::Regular(1))
+            .is_err());
+        assert!(probe_stream.stream_for(SpatialPartition::Multi).is_err());
+        Ok(())
+    }
+}
diff --git a/rust/sedona-spatial-join/src/stream.rs b/rust/sedona-spatial-join/src/stream.rs
index edbb41dd..177e7b0f 100644
--- a/rust/sedona-spatial-join/src/stream.rs
+++ b/rust/sedona-spatial-join/src/stream.rs
@@ -17,7 +17,9 @@
 use arrow::array::BooleanBufferBuilder;
 use arrow::compute::interleave_record_batch;
 use arrow_array::{UInt32Array, UInt64Array};
+use datafusion::prelude::SessionConfig;
 use datafusion_common::{JoinSide, Result};
+use datafusion_execution::runtime_env::RuntimeEnv;
 use datafusion_expr::JoinType;
 use datafusion_physical_plan::joins::utils::StatefulStreamResult;
 use datafusion_physical_plan::joins::utils::{ColumnIndex, JoinFilter};
@@ -25,10 +27,9 @@ use datafusion_physical_plan::metrics::{self, ExecutionPlanMetricsSet, MetricBui
 use datafusion_physical_plan::{handle_state, RecordBatchStream, SendableRecordBatchStream};
 use futures::future::BoxFuture;
 use futures::stream::StreamExt;
-use futures::FutureExt;
-use futures::{ready, task::Poll};
+use futures::{ready, task::Poll, FutureExt};
 use parking_lot::Mutex;
-use sedona_common::sedona_internal_err;
+use sedona_common::{sedona_internal_err, SedonaOptions};
 use sedona_functions::st_analyze_agg::AnalyzeAccumulator;
 use sedona_schema::datatypes::WKB_GEOMETRY;
 use std::collections::HashMap;
@@ -38,14 +39,17 @@ use std::sync::Arc;
 use crate::evaluated_batch::evaluated_batch_stream::evaluate::create_evaluated_probe_stream;
 use crate::evaluated_batch::evaluated_batch_stream::SendableEvaluatedBatchStream;
 use crate::evaluated_batch::EvaluatedBatch;
-use crate::index::partitioned_index_provider::PartitionedIndexProvider;
-use crate::index::SpatialIndex;
+use crate::index::{partitioned_index_provider::PartitionedIndexProvider, SpatialIndex};
 use crate::operand_evaluator::create_operand_evaluator;
+use crate::partitioning::SpatialPartition;
 use crate::prepare::SpatialJoinComponents;
+use crate::probe::partitioned_stream_provider::PartitionedProbeStreamProvider;
+use crate::probe::ProbeStreamMetrics;
 use crate::spatial_predicate::SpatialPredicate;
 use crate::utils::join_utils::{
-    adjust_indices_by_join_type, apply_join_filter_to_indices, build_batch_from_indices,
-    get_final_indices_from_bit_map, need_produce_result_in_final,
+    adjust_indices_with_visited_info, apply_join_filter_to_indices, build_batch_from_indices,
+    get_final_indices_from_bit_map, need_probe_multi_partition_bitmap,
+    need_produce_result_in_final,
 };
 use crate::utils::once_fut::{OnceAsync, OnceFut};
 use arrow::array::RecordBatch;
@@ -63,7 +67,9 @@ pub(crate) struct SpatialJoinStream {
     /// type of the join
     join_type: JoinType,
     /// The stream of the probe side
-    probe_stream: SendableEvaluatedBatchStream,
+    probe_stream: Option<SendableEvaluatedBatchStream>,
+    /// The schema of the probe side
+    probe_stream_schema: SchemaRef,
     /// Information of index and left / right placement of columns
     column_indices: Vec<ColumnIndex>,
     /// Maintains the order of the probe side
@@ -72,8 +78,9 @@ pub(crate) struct SpatialJoinStream {
     join_metrics: SpatialJoinProbeMetrics,
     /// Current state of the stream
     state: SpatialJoinStreamState,
+    /// DataFusion runtime environment
+    runtime_env: Arc<RuntimeEnv>,
     /// Options for the spatial join
-    #[allow(unused)]
     options: SpatialJoinOptions,
     /// Target output batch size
     target_output_batch_size: usize,
@@ -83,18 +90,33 @@ pub(crate) struct SpatialJoinStream {
     once_async_spatial_join_components: Arc<Mutex<Option<OnceAsync<SpatialJoinComponents>>>>,
     /// Cached index provider reference after it becomes available
     index_provider: Option<Arc<PartitionedIndexProvider>>,
-    /// The spatial index
+    /// Probe side evaluated batch stream provider
+    probe_stream_provider: Option<PartitionedProbeStreamProvider>,
+    /// The spatial index for the current partition
     spatial_index: Option<Arc<SpatialIndex>>,
+    /// The probe-side evaluated batch stream for the current partition
+    probe_evaluated_stream: Option<SendableEvaluatedBatchStream>,
     /// Pending future for building or waiting on a partitioned index
     pending_index_future: Option<BoxFuture<'static, Option<Result<Arc<SpatialIndex>>>>>,
     /// Total number of regular partitions produced by the provider
     num_regular_partitions: Option<u32>,
     /// The spatial predicate being evaluated
     spatial_predicate: SpatialPredicate,
+    /// Bitmap for tracking visited rows in the Multi partition of the probe side.
+    /// This is used for outer joins to ensure that we only emit unmatched rows from the Multi
+    /// partition once, after all regular partitions have been processed.
+    visited_multi_probe_side: Option<Arc<Mutex<BooleanBufferBuilder>>>,
+    /// Current offset in the probe side partition
+    probe_offset: usize,
 }
 
 impl SpatialJoinStream {
     #[allow(clippy::too_many_arguments)]
+    /// Create a new [`SpatialJoinStream`] for a single probe-side input partition.
+    ///
+    /// This wraps the incoming probe stream with expression evaluation (geometry extraction,
+    /// envelopes, etc.) and initializes the stream state machine to wait for shared
+    /// `SpatialJoinComponents` (index provider + probe stream provider).
     pub(crate) fn new(
         probe_partition_id: usize,
         schema: Arc<Schema>,
@@ -104,51 +126,66 @@ impl SpatialJoinStream {
         probe_stream: SendableRecordBatchStream,
         column_indices: Vec<ColumnIndex>,
         probe_side_ordered: bool,
-        join_metrics: SpatialJoinProbeMetrics,
-        options: SpatialJoinOptions,
-        target_output_batch_size: usize,
+        session_config: &SessionConfig,
+        runtime_env: Arc<RuntimeEnv>,
+        metrics: &ExecutionPlanMetricsSet,
         once_fut_spatial_join_components: OnceFut<SpatialJoinComponents>,
         once_async_spatial_join_components: Arc<Mutex<Option<OnceAsync<SpatialJoinComponents>>>>,
     ) -> Self {
-        let evaluator = create_operand_evaluator(on, options.clone());
+        let target_output_batch_size = session_config.batch_size();
+        let sedona_options = session_config
+            .options()
+            .extensions
+            .get::<SedonaOptions>()
+            .cloned()
+            .unwrap_or_default();
+
+        let evaluator = create_operand_evaluator(on, sedona_options.spatial_join.clone());
+        let join_metrics = SpatialJoinProbeMetrics::new(probe_partition_id, metrics);
         let probe_stream = create_evaluated_probe_stream(
             probe_stream,
             Arc::clone(&evaluator),
             join_metrics.join_time.clone(),
         );
+        let probe_stream_schema = probe_stream.schema();
+
         Self {
             probe_partition_id,
-            schema,
+            schema: schema.clone(),
             filter,
             join_type,
-            probe_stream,
+            probe_stream: Some(probe_stream),
+            probe_stream_schema,
             column_indices,
             probe_side_ordered,
             join_metrics,
             state: SpatialJoinStreamState::WaitPrepareSpatialJoinComponents,
-            options,
+            runtime_env,
+            options: sedona_options.spatial_join,
             target_output_batch_size,
             once_fut_spatial_join_components,
             once_async_spatial_join_components,
             index_provider: None,
+            probe_stream_provider: None,
             spatial_index: None,
+            probe_evaluated_stream: None,
             pending_index_future: None,
             num_regular_partitions: None,
             spatial_predicate: on.clone(),
+            visited_multi_probe_side: None,
+            probe_offset: 0,
         }
     }
 }
 
 /// Metrics for the probe phase of the spatial join.
-#[derive(Clone, Debug, Default)]
+#[derive(Clone, Debug)]
 pub(crate) struct SpatialJoinProbeMetrics {
+    /// Metrics produced while scanning/partitioning the probe stream.
+    pub(crate) probe_stream_metrics: ProbeStreamMetrics,
     /// Total time for joining probe-side batches to the build-side batches
     pub(crate) join_time: metrics::Time,
-    /// Number of batches consumed by probe-side of this operator
-    pub(crate) probe_input_batches: metrics::Count,
-    /// Number of rows consumed by probe-side this operator
-    pub(crate) probe_input_rows: metrics::Count,
-    /// Number of batches produced by this operator
+    /// Number of output batches produced by this stream.
     pub(crate) output_batches: metrics::Count,
     /// Number of rows produced by this operator
     pub(crate) output_rows: metrics::Count,
@@ -163,12 +200,11 @@ pub(crate) struct SpatialJoinProbeMetrics {
 }
 
 impl SpatialJoinProbeMetrics {
+    /// Create a new set of probe metrics for the given output partition.
     pub fn new(partition: usize, metrics: &ExecutionPlanMetricsSet) -> Self {
         Self {
+            probe_stream_metrics: ProbeStreamMetrics::new(partition, metrics),
             join_time: MetricBuilder::new(metrics).subset_time("join_time", partition),
-            probe_input_batches: MetricBuilder::new(metrics)
-                .counter("probe_input_batches", partition),
-            probe_input_rows: MetricBuilder::new(metrics).counter("probe_input_rows", partition),
             output_batches: MetricBuilder::new(metrics).counter("output_batches", partition),
             output_rows: MetricBuilder::new(metrics).output_rows(partition),
             join_result_candidates: MetricBuilder::new(metrics)
@@ -185,49 +221,155 @@ impl SpatialJoinProbeMetrics {
 pub(crate) enum SpatialJoinStreamState {
     /// The initial mode: waiting for the spatial join components to become available
     WaitPrepareSpatialJoinComponents,
-    /// The initial mode: waiting for the spatial index to be built
-    WaitBuildIndex,
+    /// Wait for a specific partition's index. The boolean denotes whether this stream should kick
+    /// off building the index (`true`) or simply wait for someone else to build it (`false`).
+    WaitBuildIndex(u32, bool),
     /// Indicates that build-side has been collected, and stream is ready for
-    /// fetching probe-side
-    FetchProbeBatch,
+    /// fetching probe-side batches
+    FetchProbeBatch(PartitionDescriptor),
     /// Indicates that we're processing a probe batch using the batch iterator
     ProcessProbeBatch(
+        PartitionDescriptor,
         BoxFuture<'static, (Box<SpatialJoinBatchIterator>, Result<Option<RecordBatch>>)>,
     ),
-    /// Indicates that probe-side has been fully processed
-    ExhaustedProbeSide,
+    /// Indicates that we have exhausted the current probe stream, move to the Multi partition
+    /// or prepare for emitting unmatched build batch
+    ExhaustedProbeStream(PartitionDescriptor),
+    /// Indicates that probe-side has been fully processed, prepare iterator for producing
+    /// unmatched build side batches for outer join
+    PrepareUnmatchedBuildBatch(PartitionDescriptor),
     /// Indicates that we're processing unmatched build-side batches using an iterator
-    ProcessUnmatchedBuildBatch(UnmatchedBuildBatchIterator),
+    ProcessUnmatchedBuildBatch(PartitionDescriptor, UnmatchedBuildBatchIterator),
+    /// Prepare for processing the next partition.
+    /// If the last partition has been processed, simply transfer to [`SpatialJoinStreamState::Completed`];
+    /// If the there's still more partitions to process, then transfer to [`SpatialJoinStreamState::WaitBuildIndex`] state.
+    /// If we are the last one finishing processing the current partition, we can safely
+    /// drop the current index and kick off the building of the index for the next partition.
+    PrepareForNextPartition(u32, bool),
     /// Indicates that SpatialJoinStream execution is completed
     Completed,
 }
 
+impl std::fmt::Debug for SpatialJoinStreamState {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        match self {
+            Self::WaitPrepareSpatialJoinComponents => write!(f, "WaitPrepareSpatialJoinComponents"),
+            Self::WaitBuildIndex(id, build) => f
+                .debug_tuple("WaitBuildIndex")
+                .field(id)
+                .field(build)
+                .finish(),
+            Self::FetchProbeBatch(desc) => f.debug_tuple("FetchProbeBatch").field(desc).finish(),
+            Self::ProcessProbeBatch(desc, _) => {
+                f.debug_tuple("ProcessProbeBatch").field(desc).finish()
+            }
+            Self::ExhaustedProbeStream(desc) => {
+                f.debug_tuple("ExhaustedProbeStream").field(desc).finish()
+            }
+            Self::PrepareUnmatchedBuildBatch(desc) => f
+                .debug_tuple("PrepareUnmatchedBuildBatch")
+                .field(desc)
+                .finish(),
+            Self::ProcessUnmatchedBuildBatch(desc, iter) => f
+                .debug_tuple("ProcessUnmatchedBuildBatch")
+                .field(desc)
+                .field(iter)
+                .finish(),
+            Self::PrepareForNextPartition(id, last) => f
+                .debug_tuple("PrepareForNextPartition")
+                .field(id)
+                .field(last)
+                .finish(),
+            Self::Completed => write!(f, "Completed"),
+        }
+    }
+}
+
+#[derive(Debug, Clone, Copy)]
+pub(crate) struct PartitionDescriptor {
+    partition_id: u32,
+    partition: SpatialPartition,
+}
+
+impl PartitionDescriptor {
+    fn regular(partition_id: u32) -> Self {
+        Self {
+            partition_id,
+            partition: SpatialPartition::Regular(partition_id),
+        }
+    }
+
+    fn multi(partition_id: u32) -> Self {
+        Self {
+            partition_id,
+            partition: SpatialPartition::Multi,
+        }
+    }
+}
+
 impl SpatialJoinStream {
     fn poll_next_impl(
         &mut self,
         cx: &mut std::task::Context<'_>,
     ) -> Poll<Option<Result<RecordBatch>>> {
         loop {
-            return match &mut self.state {
+            return match &self.state {
                 SpatialJoinStreamState::WaitPrepareSpatialJoinComponents => {
                     handle_state!(ready!(self.wait_create_spatial_join_components(cx)))
                 }
-                SpatialJoinStreamState::WaitBuildIndex => {
-                    handle_state!(ready!(self.wait_build_index(cx)))
+                SpatialJoinStreamState::WaitBuildIndex(partition_id, should_build) => {
+                    handle_state!(ready!(self.wait_build_index(
+                        *partition_id,
+                        *should_build,
+                        cx
+                    )))
                 }
-                SpatialJoinStreamState::FetchProbeBatch => {
-                    handle_state!(ready!(self.fetch_probe_batch(cx)))
+                SpatialJoinStreamState::FetchProbeBatch(desc) => {
+                    handle_state!(ready!(self.fetch_probe_batch(*desc, cx)))
                 }
-                SpatialJoinStreamState::ProcessProbeBatch(_) => {
+                SpatialJoinStreamState::ProcessProbeBatch(_, _) => {
                     handle_state!(ready!(self.process_probe_batch(cx)))
                 }
-                SpatialJoinStreamState::ExhaustedProbeSide => {
-                    handle_state!(ready!(self.setup_unmatched_build_batch_processing()))
+                SpatialJoinStreamState::ExhaustedProbeStream(desc) => {
+                    self.probe_evaluated_stream = None;
+                    match desc.partition {
+                        SpatialPartition::Regular(_) => {
+                            if self.num_regular_partitions == Some(1) {
+                                // Single-partition spatial join does not have to process the Multi partition.
+                                self.state =
+                                    SpatialJoinStreamState::PrepareUnmatchedBuildBatch(*desc);
+                            } else {
+                                log::debug!(
+                                    "[Partition {}] Start probing the Multi partition",
+                                    self.probe_partition_id
+                                );
+                                self.state = SpatialJoinStreamState::FetchProbeBatch(
+                                    PartitionDescriptor::multi(desc.partition_id),
+                                );
+                            }
+                        }
+                        SpatialPartition::Multi => {
+                            self.state = SpatialJoinStreamState::PrepareUnmatchedBuildBatch(*desc);
+                        }
+                        _ => unreachable!(),
+                    }
+                    continue;
+                }
+                SpatialJoinStreamState::PrepareUnmatchedBuildBatch(desc) => {
+                    handle_state!(ready!(self.setup_unmatched_build_batch_processing(*desc)))
                 }
-                SpatialJoinStreamState::ProcessUnmatchedBuildBatch(_) => {
+                SpatialJoinStreamState::ProcessUnmatchedBuildBatch(_, _) => {
                     handle_state!(ready!(self.process_unmatched_build_batch()))
                 }
-                SpatialJoinStreamState::Completed => Poll::Ready(None),
+                SpatialJoinStreamState::PrepareForNextPartition(partition_id, is_last_stream) => {
+                    handle_state!(ready!(
+                        self.prepare_for_next_partition(*partition_id, *is_last_stream)
+                    ))
+                }
+                SpatialJoinStreamState::Completed => {
+                    log::debug!("[Partition {}] Completed", self.probe_partition_id);
+                    Poll::Ready(None)
+                }
             };
         }
     }
@@ -242,6 +384,21 @@ impl SpatialJoinStream {
             let provider = Arc::clone(&spatial_join_components.partitioned_index_provider);
             self.num_regular_partitions = Some(provider.num_regular_partitions() as u32);
             self.index_provider = Some(provider);
+
+            match self.probe_stream.take() {
+                Some(probe_stream) => {
+                    let probe_stream_provider = PartitionedProbeStreamProvider::new(
+                        Arc::clone(&self.runtime_env),
+                        spatial_join_components.probe_stream_options.clone(),
+                        probe_stream,
+                        self.join_metrics.probe_stream_metrics.clone(),
+                    );
+                    self.probe_stream_provider = Some(probe_stream_provider);
+                }
+                None => {
+                    return Poll::Ready(sedona_internal_err!("Probe stream should be available"));
+                }
+            }
         }
 
         let num_partitions = self
@@ -253,24 +410,19 @@ impl SpatialJoinStream {
             return Poll::Ready(Ok(StatefulStreamResult::Continue));
         }
 
-        if num_partitions > 1 {
-            return Poll::Ready(sedona_internal_err!(
-                "Multi-partitioned spatial join is not supported yet"
-            ));
-        }
-
-        self.state = SpatialJoinStreamState::WaitBuildIndex;
+        self.state = SpatialJoinStreamState::WaitBuildIndex(0, true);
         Poll::Ready(Ok(StatefulStreamResult::Continue))
     }
 
     fn wait_build_index(
         &mut self,
+        partition_id: u32,
+        should_build: bool,
         cx: &mut std::task::Context<'_>,
     ) -> Poll<Result<StatefulStreamResult<Option<RecordBatch>>>> {
         let num_partitions = self
             .num_regular_partitions
             .expect("num_regular_partitions should be available");
-        let partition_id = 0;
         if partition_id >= num_partitions {
             self.state = SpatialJoinStreamState::Completed;
             return Poll::Ready(Ok(StatefulStreamResult::Continue));
@@ -282,13 +434,20 @@ impl SpatialJoinStream {
                     .as_ref()
                     .expect("Partitioned index provider should be available"),
             );
-            let future = {
+            let future = if should_build {
                 log::debug!(
                     "[Partition {}] Building index for spatial partition {}",
                     self.probe_partition_id,
                     partition_id
                 );
                 async move { provider.build_or_wait_for_index(partition_id).await }.boxed()
+            } else {
+                log::debug!(
+                    "[Partition {}] Waiting for index for spatial partition {}",
+                    self.probe_partition_id,
+                    partition_id
+                );
+                async move { provider.wait_for_index(partition_id).await }.boxed()
             };
             self.pending_index_future = Some(future);
         }
@@ -307,7 +466,9 @@ impl SpatialJoinStream {
                     self.probe_partition_id,
                     partition_id
                 );
-                self.state = SpatialJoinStreamState::FetchProbeBatch;
+                self.state = SpatialJoinStreamState::FetchProbeBatch(PartitionDescriptor::regular(
+                    partition_id,
+                ));
                 Poll::Ready(Ok(StatefulStreamResult::Continue))
             }
             Poll::Ready(Some(Err(err))) => {
@@ -325,25 +486,60 @@ impl SpatialJoinStream {
 
     fn fetch_probe_batch(
         &mut self,
+        partition_desc: PartitionDescriptor,
         cx: &mut std::task::Context<'_>,
     ) -> Poll<Result<StatefulStreamResult<Option<RecordBatch>>>> {
-        let result = self.probe_stream.poll_next_unpin(cx);
+        if self.probe_evaluated_stream.is_none() {
+            let probe_stream_provider = self
+                .probe_stream_provider
+                .as_mut()
+                .expect("Probe stream provider should be available");
+
+            // Initialize visited_multi_probe_side if needed
+            if matches!(partition_desc.partition, SpatialPartition::Multi) {
+                let need_probe_bitmap = need_probe_multi_partition_bitmap(self.join_type);
+
+                if self.visited_multi_probe_side.is_none() && need_probe_bitmap {
+                    let num_rows =
+                        probe_stream_provider.get_partition_row_count(partition_desc.partition)?;
+                    let mut buffer = BooleanBufferBuilder::new(num_rows);
+                    buffer.append_n(num_rows, false);
+                    self.visited_multi_probe_side = Some(Arc::new(Mutex::new(buffer)));
+                }
+            }
+
+            let evaluated_stream = probe_stream_provider.stream_for(partition_desc.partition)?;
+            self.probe_evaluated_stream = Some(evaluated_stream);
+            self.probe_offset = 0;
+        }
+
+        let probe_evaluated_stream = self
+            .probe_evaluated_stream
+            .as_mut()
+            .expect("Probe evaluated stream should be available");
+
+        let result = probe_evaluated_stream.poll_next_unpin(cx);
         match result {
-            Poll::Ready(Some(Ok(batch))) => match self.create_spatial_join_iterator(batch) {
-                Ok(mut iterator) => {
-                    let future = async move {
-                        let result = iterator.next_batch().await;
-                        (iterator, result)
+            Poll::Ready(Some(Ok(batch))) => {
+                let num_rows = batch.num_rows();
+                match self.create_spatial_join_iterator(partition_desc, batch, self.probe_offset) {
+                    Ok(mut iterator) => {
+                        self.probe_offset += num_rows;
+                        let future = async move {
+                            let result = iterator.next_batch().await;
+                            (iterator, result)
+                        }
+                        .boxed();
+                        self.state =
+                            SpatialJoinStreamState::ProcessProbeBatch(partition_desc, future);
+                        Poll::Ready(Ok(StatefulStreamResult::Continue))
                     }
-                    .boxed();
-                    self.state = SpatialJoinStreamState::ProcessProbeBatch(future);
-                    Poll::Ready(Ok(StatefulStreamResult::Continue))
+                    Err(e) => Poll::Ready(Err(e)),
                 }
-                Err(e) => Poll::Ready(Err(e)),
-            },
+            }
             Poll::Ready(Some(Err(e))) => Poll::Ready(Err(e)),
             Poll::Ready(None) => {
-                self.state = SpatialJoinStreamState::ExhaustedProbeSide;
+                self.state = SpatialJoinStreamState::ExhaustedProbeStream(partition_desc);
                 Poll::Ready(Ok(StatefulStreamResult::Continue))
             }
             Poll::Pending => Poll::Pending,
@@ -357,27 +553,32 @@ impl SpatialJoinStream {
         let _timer = self.join_metrics.join_time.timer();
 
         // Extract the necessary data first to avoid borrowing conflicts
-        let (mut iterator, batch_opt) = match &mut self.state {
-            SpatialJoinStreamState::ProcessProbeBatch(future) => match future.poll_unpin(cx) {
-                Poll::Ready((iterator, result)) => {
-                    let batch_opt = match result {
-                        Ok(opt) => opt,
-                        Err(e) => {
-                            return Poll::Ready(Err(e));
-                        }
-                    };
-                    (iterator, batch_opt)
+        let (partition_desc, mut iterator, batch_opt) = match &mut self.state {
+            SpatialJoinStreamState::ProcessProbeBatch(desc, future) => {
+                match future.poll_unpin(cx) {
+                    Poll::Ready((iterator, result)) => {
+                        let batch_opt = match result {
+                            Ok(opt) => opt,
+                            Err(e) => {
+                                return Poll::Ready(Err(e));
+                            }
+                        };
+                        (*desc, iterator, batch_opt)
+                    }
+                    Poll::Pending => return Poll::Pending,
                 }
-                Poll::Pending => return Poll::Pending,
-            },
+            }
             _ => unreachable!(),
         };
 
         match batch_opt {
             Some(batch) => {
+                self.join_metrics.output_batches.add(1);
+                self.join_metrics.output_rows.add(batch.num_rows());
+
                 // Check if iterator is complete
                 if iterator.is_complete() {
-                    self.state = SpatialJoinStreamState::FetchProbeBatch;
+                    self.state = SpatialJoinStreamState::FetchProbeBatch(partition_desc);
                 } else {
                     // Iterator is not complete, continue processing the current probe batch
                     let future = async move {
@@ -385,13 +586,13 @@ impl SpatialJoinStream {
                         (iterator, result)
                     }
                     .boxed();
-                    self.state = SpatialJoinStreamState::ProcessProbeBatch(future);
+                    self.state = SpatialJoinStreamState::ProcessProbeBatch(partition_desc, future);
                 }
                 Poll::Ready(Ok(StatefulStreamResult::Ready(Some(batch))))
             }
             None => {
-                // Iterator finished, move to next probe batch
-                self.state = SpatialJoinStreamState::FetchProbeBatch;
+                // Iterator finished, move to the next probe batch
+                self.state = SpatialJoinStreamState::FetchProbeBatch(partition_desc);
                 Poll::Ready(Ok(StatefulStreamResult::Continue))
             }
         }
@@ -399,6 +600,7 @@ impl SpatialJoinStream {
 
     fn setup_unmatched_build_batch_processing(
         &mut self,
+        partition_desc: PartitionDescriptor,
     ) -> Poll<Result<StatefulStreamResult<Option<RecordBatch>>>> {
         let Some(spatial_index) = self.spatial_index.as_ref() else {
             return Poll::Ready(sedona_internal_err!(
@@ -411,20 +613,10 @@ impl SpatialJoinStream {
             // Update the memory used by refiner and execution mode used to the metrics
             self.join_metrics
                 .refiner_mem_used
-                .set(spatial_index.get_refiner_mem_usage());
+                .set_max(spatial_index.get_refiner_mem_usage());
             self.join_metrics
                 .execution_mode
                 .set(spatial_index.get_actual_execution_mode().to_usize());
-
-            // Drop the once async to avoid holding a long-living reference to the spatial index.
-            // The spatial index will be dropped when this stream is dropped.
-            let mut once_async = self.once_async_spatial_join_components.lock();
-            once_async.take();
-
-            if let Some(provider) = self.index_provider.as_ref() {
-                provider.dispose_index(0);
-                assert!(provider.num_loaded_indexes() == 0);
-            }
         }
 
         // Initial setup for processing unmatched build batches
@@ -432,32 +624,46 @@ impl SpatialJoinStream {
             // Only produce left-outer batches if this is the last partition that finished probing.
             // This mechanism is similar to the one in NestedLoopJoinStream.
             if !is_last_stream {
-                self.state = SpatialJoinStreamState::Completed;
-                return Poll::Ready(Ok(StatefulStreamResult::Ready(None)));
+                self.state = SpatialJoinStreamState::PrepareForNextPartition(
+                    partition_desc.partition_id,
+                    is_last_stream,
+                );
+                return Poll::Ready(Ok(StatefulStreamResult::Continue));
             }
 
-            let empty_right_batch = RecordBatch::new_empty(self.probe_stream.schema());
+            log::debug!(
+                "[Partition {}] Producing unmatched build side for spatial partition {}",
+                self.probe_partition_id,
+                partition_desc.partition_id
+            );
+
+            let empty_right_batch = RecordBatch::new_empty(Arc::clone(&self.probe_stream_schema));
 
-            match UnmatchedBuildBatchIterator::new(spatial_index.clone(), empty_right_batch) {
+            match UnmatchedBuildBatchIterator::try_new(spatial_index.clone(), empty_right_batch) {
                 Ok(iterator) => {
-                    self.state = SpatialJoinStreamState::ProcessUnmatchedBuildBatch(iterator);
+                    self.state = SpatialJoinStreamState::ProcessUnmatchedBuildBatch(
+                        partition_desc,
+                        iterator,
+                    );
                     Poll::Ready(Ok(StatefulStreamResult::Continue))
                 }
                 Err(e) => Poll::Ready(Err(e)),
             }
         } else {
             // end of the join loop
-            self.state = SpatialJoinStreamState::Completed;
-            Poll::Ready(Ok(StatefulStreamResult::Ready(None)))
+            self.state = SpatialJoinStreamState::PrepareForNextPartition(
+                partition_desc.partition_id,
+                is_last_stream,
+            );
+            Poll::Ready(Ok(StatefulStreamResult::Continue))
         }
     }
 
     fn process_unmatched_build_batch(
         &mut self,
     ) -> Poll<Result<StatefulStreamResult<Option<RecordBatch>>>> {
-        // Extract the iterator from the state to avoid borrowing conflicts
-        let (batch_opt, is_complete) = match &mut self.state {
-            SpatialJoinStreamState::ProcessUnmatchedBuildBatch(iterator) => {
+        let (partition_desc, batch_opt, is_complete) = match &mut self.state {
+            SpatialJoinStreamState::ProcessUnmatchedBuildBatch(desc, iterator) => {
                 let batch_opt = match iterator.next_batch(
                     &self.schema,
                     self.join_type,
@@ -468,7 +674,7 @@ impl SpatialJoinStream {
                     Err(e) => return Poll::Ready(Err(e)),
                 };
                 let is_complete = iterator.is_complete();
-                (batch_opt, is_complete)
+                (*desc, batch_opt, is_complete)
             }
             _ => {
                 return Poll::Ready(sedona_internal_err!(
@@ -485,27 +691,64 @@ impl SpatialJoinStream {
 
                 // Check if iterator is complete
                 if is_complete {
-                    self.state = SpatialJoinStreamState::Completed;
+                    self.state = SpatialJoinStreamState::PrepareForNextPartition(
+                        partition_desc.partition_id,
+                        true,
+                    );
                 }
 
                 Poll::Ready(Ok(StatefulStreamResult::Ready(Some(batch))))
             }
             None => {
-                // Iterator finished, complete the stream
-                self.state = SpatialJoinStreamState::Completed;
-                Poll::Ready(Ok(StatefulStreamResult::Ready(None)))
+                // Iterator finished, advance to the next spatial partition
+                self.state = SpatialJoinStreamState::PrepareForNextPartition(
+                    partition_desc.partition_id,
+                    true,
+                );
+                Poll::Ready(Ok(StatefulStreamResult::Continue))
+            }
+        }
+    }
+
+    fn prepare_for_next_partition(
+        &mut self,
+        current_partition_id: u32,
+        is_last_stream: bool,
+    ) -> Poll<Result<StatefulStreamResult<Option<RecordBatch>>>> {
+        self.spatial_index = None;
+        if is_last_stream {
+            if let Some(provider) = self.index_provider.as_ref() {
+                provider.dispose_index(current_partition_id);
+                assert!(provider.num_loaded_indexes() == 0);
+            }
+        }
+
+        let num_regular_partitions = self
+            .num_regular_partitions
+            .expect("num_regular_partitions should be available");
+
+        let next_partition_id = current_partition_id + 1;
+
+        if next_partition_id >= num_regular_partitions {
+            if is_last_stream {
+                let mut once_async = self.once_async_spatial_join_components.lock();
+                once_async.take();
             }
+
+            self.state = SpatialJoinStreamState::Completed;
+            Poll::Ready(Ok(StatefulStreamResult::Continue))
+        } else {
+            self.state = SpatialJoinStreamState::WaitBuildIndex(next_partition_id, is_last_stream);
+            Poll::Ready(Ok(StatefulStreamResult::Continue))
         }
     }
 
     fn create_spatial_join_iterator(
-        &self,
+        &mut self,
+        partition_desc: PartitionDescriptor,
         probe_evaluated_batch: EvaluatedBatch,
+        probe_offset: usize,
     ) -> Result<Box<SpatialJoinBatchIterator>> {
-        let num_rows = probe_evaluated_batch.num_rows();
-        self.join_metrics.probe_input_batches.add(1);
-        self.join_metrics.probe_input_rows.add(num_rows);
-
         // Get the spatial index
         let spatial_index = self
             .spatial_index
@@ -524,6 +767,19 @@ impl SpatialJoinStream {
             spatial_index.merge_probe_stats(stats);
         }
 
+        let visited_probe_side = if matches!(partition_desc.partition, SpatialPartition::Multi) {
+            self.visited_multi_probe_side.clone()
+        } else {
+            None
+        };
+
+        // Produce unmatched probe rows when processing the last build partition's Multi partition
+        let num_regular_partitions = self
+            .num_regular_partitions
+            .expect("num_regular_partitions should be available");
+        let is_last_build_partition = matches!(partition_desc.partition, SpatialPartition::Multi)
+            && (partition_desc.partition_id + 1) == num_regular_partitions;
+
         // For KNN joins, we may have swapped build/probe sides, so build_side might be Right;
         // For regular joins, build_side is always Left.
         let build_side = match &self.spatial_predicate {
@@ -538,12 +794,15 @@ impl SpatialJoinStream {
             column_indices: self.column_indices.clone(),
             build_side,
             spatial_index: spatial_index.clone(),
-            probe_evaluated_batch: Arc::new(probe_evaluated_batch),
             join_metrics: self.join_metrics.clone(),
             max_batch_size: self.target_output_batch_size,
             probe_side_ordered: self.probe_side_ordered,
             spatial_predicate: self.spatial_predicate.clone(),
             options: self.options.clone(),
+            visited_probe_side,
+            probe_offset,
+            produce_unmatched_probe_rows: is_last_build_partition,
+            probe_evaluated_batch: Arc::new(probe_evaluated_batch),
         })?;
         Ok(Box::new(iterator))
     }
@@ -575,7 +834,11 @@ struct PartialBuildBatch {
     interleave_indices_map: HashMap<(i32, i32), usize>,
 }
 
-/// Iterator that produces spatial join results for one probe batch
+/// Iterator that produces spatial join results for a single probe batch.
+///
+/// This iterator incrementally probes a [`SpatialIndex`] with rows from an evaluated probe batch,
+/// accumulates matched build/probe indices, applies an optional join filter, and finally builds
+/// joined [`RecordBatch`]es of up to `max_batch_size` rows.
 pub(crate) struct SpatialJoinBatchIterator {
     /// Schema of the output record batches
     schema: SchemaRef,
@@ -601,6 +864,14 @@ pub(crate) struct SpatialJoinBatchIterator {
     spatial_predicate: SpatialPredicate,
     /// The spatial join options
     options: SpatialJoinOptions,
+    /// Bitmap for tracking visited rows in the probe side. This will only be `Some`
+    /// when processing the Multi partition for spatial-partitioned right outer joins.
+    visited_probe_side: Option<Arc<Mutex<BooleanBufferBuilder>>>,
+    /// Offset of the probe batch in the partition
+    offset_in_partition: usize,
+    /// Whether produce unmatched probe rows for right outer joins. This is only effective
+    /// when [Self::visited_probe_side] is `Some`.
+    produce_unmatched_probe_rows: bool,
     /// Progress of probing
     progress: Option<ProbeProgress>,
 }
@@ -708,23 +979,42 @@ impl ProbeProgress {
     }
 }
 
-/// Parameters for creating a SpatialJoinBatchIterator
+/// Parameters for creating a [`SpatialJoinBatchIterator`].
 pub(crate) struct SpatialJoinBatchIteratorParams {
+    /// Output schema of the joined record batches.
     pub schema: SchemaRef,
+    /// Optional post-join filter to apply.
     pub filter: Option<JoinFilter>,
+    /// Join type (inner/outer/semi/anti/mark).
     pub join_type: JoinType,
+    /// Column placement mapping for assembling output rows.
     pub column_indices: Vec<ColumnIndex>,
+    /// Which input side is treated as the build side.
     pub build_side: JoinSide,
+    /// Spatial index for the build side.
     pub spatial_index: Arc<SpatialIndex>,
+    /// Probe-side batch with any required pre-evaluated columns.
     pub probe_evaluated_batch: Arc<EvaluatedBatch>,
+    /// Metrics instance used to report probe work.
     pub join_metrics: SpatialJoinProbeMetrics,
+    /// Maximum output batch size produced per iterator step.
     pub max_batch_size: usize,
+    /// Whether to preserve probe-side row ordering when producing output.
     pub probe_side_ordered: bool,
+    /// Spatial predicate used to query the index.
     pub spatial_predicate: SpatialPredicate,
+    /// Spatial join options affecting behavior (KNN tie-breakers, execution mode, etc.).
     pub options: SpatialJoinOptions,
+    /// Optional visited bitmap for multi-partition probe side outer join bookkeeping.
+    pub visited_probe_side: Option<Arc<Mutex<BooleanBufferBuilder>>>,
+    /// Offset of this probe batch within its partition.
+    pub probe_offset: usize,
+    /// Whether to emit unmatched probe rows (used for right outer joins).
+    pub produce_unmatched_probe_rows: bool,
 }
 
 impl SpatialJoinBatchIterator {
+    /// Create a new iterator for a single probe-side evaluated batch.
     pub(crate) fn new(params: SpatialJoinBatchIteratorParams) -> Result<Self> {
         Ok(Self {
             schema: params.schema,
@@ -739,6 +1029,9 @@ impl SpatialJoinBatchIterator {
             probe_side_ordered: params.probe_side_ordered,
             spatial_predicate: params.spatial_predicate,
             options: params.options,
+            visited_probe_side: params.visited_probe_side,
+            offset_in_partition: params.probe_offset,
+            produce_unmatched_probe_rows: params.produce_unmatched_probe_rows,
             progress: Some(ProbeProgress {
                 current_probe_idx: 0,
                 last_produced_probe_idx: -1,
@@ -749,6 +1042,7 @@ impl SpatialJoinBatchIterator {
         })
     }
 
+    /// Produce the next joined output batch, or `Ok(None)` when this probe batch is fully processed.
     pub async fn next_batch(&mut self) -> Result<Option<RecordBatch>> {
         let progress_opt = std::mem::take(&mut self.progress);
         let mut progress = progress_opt.expect("Progress should be available");
@@ -1020,13 +1314,22 @@ impl SpatialJoinBatchIterator {
         probe_range: Range<usize>,
     ) -> Result<RecordBatch> {
         // adjust the two side indices based on the join type
-        let (build_indices, probe_indices) = adjust_indices_by_join_type(
-            build_indices,
-            probe_indices,
-            probe_range,
-            self.join_type,
-            self.probe_side_ordered,
-        )?;
+        let (build_indices, probe_indices) = {
+            let mut visited_probe_side_guard = self.visited_probe_side.as_ref().map(|v| v.lock());
+            let visited_info = visited_probe_side_guard
+                .as_mut()
+                .map(|buffer| (&mut **buffer, self.offset_in_partition));
+
+            adjust_indices_with_visited_info(
+                build_indices,
+                probe_indices,
+                probe_range,
+                self.join_type,
+                self.probe_side_ordered,
+                visited_info,
+                self.produce_unmatched_probe_rows,
+            )?
+        };
 
         // Build the final result batch
         build_batch_from_indices(
@@ -1158,7 +1461,10 @@ impl std::fmt::Debug for SpatialJoinBatchIterator {
     }
 }
 
-/// Iterator that processes unmatched build-side batches for outer joins
+/// Iterator that produces unmatched build-side rows for outer joins.
+///
+/// This consumes the build-side visited bitmap(s) attached to the [`SpatialIndex`] and emits
+/// rows that were never matched by any probe row.
 pub(crate) struct UnmatchedBuildBatchIterator {
     /// The spatial index reference
     spatial_index: Arc<SpatialIndex>,
@@ -1173,7 +1479,10 @@ pub(crate) struct UnmatchedBuildBatchIterator {
 }
 
 impl UnmatchedBuildBatchIterator {
-    pub(crate) fn new(
+    /// Create an iterator for emitting unmatched build-side rows.
+    ///
+    /// Fails if the spatial index has not been configured to track visited build-side rows.
+    pub(crate) fn try_new(
         spatial_index: Arc<SpatialIndex>,
         empty_right_batch: RecordBatch,
     ) -> Result<Self> {
@@ -1196,6 +1505,9 @@ impl UnmatchedBuildBatchIterator {
         })
     }
 
+    /// Produce the next batch of unmatched build-side rows.
+    ///
+    /// Returns `Ok(None)` when all build-side batches have been scanned.
     pub fn next_batch(
         &mut self,
         schema: &Schema,
@@ -1579,12 +1891,14 @@ mod tests {
         let build_indices = UInt64Array::from(vec![0; probe_indices.len()]);
         let probe_indices_array = UInt32Array::from(probe_indices.to_vec());
         let probe_range = 0..num_rows;
-        let (_, result_probe_indices) = adjust_indices_by_join_type(
+        let (_, result_probe_indices) = adjust_indices_with_visited_info(
             build_indices,
             probe_indices_array,
             probe_range,
             join_type,
             false,
+            None,
+            true,
         )
         .unwrap();
         let mut expected_probe_indices = result_probe_indices.values().to_vec();
@@ -1617,12 +1931,14 @@ mod tests {
             let adjust_range = progress.next_probe_range(&probe_indices);
             let build_indices = UInt64Array::from(vec![0; probe_indices.len()]);
             let probe_indices = UInt32Array::from(probe_indices);
-            let (_, result_probe_indices) = adjust_indices_by_join_type(
+            let (_, result_probe_indices) = adjust_indices_with_visited_info(
                 build_indices,
                 probe_indices,
                 adjust_range,
                 join_type,
                 false,
+                None,
+                true,
             )
             .unwrap();
             produced_probe_indices.extend(result_probe_indices.values().as_ref());
@@ -1630,12 +1946,14 @@ mod tests {
         if let Some(last_range) = progress.last_probe_range(num_rows) {
             let build_indices = UInt64Array::from(Vec::<u64>::new());
             let probe_indices = UInt32Array::from(Vec::<u32>::new());
-            let (_, result_probe_indices) = adjust_indices_by_join_type(
+            let (_, result_probe_indices) = adjust_indices_with_visited_info(
                 build_indices,
                 probe_indices,
                 last_range,
                 join_type,
                 false,
+                None,
+                true,
             )
             .unwrap();
             produced_probe_indices.extend(result_probe_indices.values().as_ref());
diff --git a/rust/sedona-spatial-join/src/utils/join_utils.rs b/rust/sedona-spatial-join/src/utils/join_utils.rs
index 87aaa9ae..fcfa576f 100644
--- a/rust/sedona-spatial-join/src/utils/join_utils.rs
+++ b/rust/sedona-spatial-join/src/utils/join_utils.rs
@@ -53,6 +53,28 @@ pub(crate) fn need_produce_result_in_final(join_type: JoinType) -> bool {
     )
 }
 
+/// Determines if a bitmap is needed to track matched rows in the probe side's "Multi" partition.
+///
+/// In a spatial partitioned join, the "Multi" partition of the probe side overlaps with multiple
+/// partitions of the build side. Consequently, rows in the probe "Multi" partition are processed
+/// against multiple build partitions.
+///
+/// For `Right`, `RightSemi`, `RightAnti`, and `Full` joins, we must track whether a probe row
+/// has been matched across *any* of these interactions to correctly produce results:
+/// - **Right/Full Outer**: Emit probe rows that never matched any build partition (checked at the last build partition).
+/// - **Right Semi**: Emit a probe row the first time it matches, and suppress subsequent matches (deduplication).
+/// - **Right Anti**: Emit probe rows only if they never match any build partition (checked at the last build partition).
+pub(crate) fn need_probe_multi_partition_bitmap(join_type: JoinType) -> bool {
+    matches!(
+        join_type,
+        JoinType::Right
+            | JoinType::RightAnti
+            | JoinType::RightSemi
+            | JoinType::RightMark
+            | JoinType::Full
+    )
+}
+
 /// In the end of join execution, need to use bit map of the matched
 /// indices to generate the final left and right indices.
 ///
@@ -93,6 +115,161 @@ pub(crate) fn get_final_indices_from_bit_map(
     (left_indices, right_indices)
 }
 
+pub(crate) fn adjust_indices_with_visited_info(
+    left_indices: UInt64Array,
+    right_indices: UInt32Array,
+    adjust_range: Range<usize>,
+    join_type: JoinType,
+    preserve_order_for_right: bool,
+    visited_info: Option<(&mut BooleanBufferBuilder, usize)>,
+    produce_unmatched_probe_rows: bool,
+) -> Result<(UInt64Array, UInt32Array)> {
+    let Some((bitmap, offset)) = visited_info else {
+        return adjust_indices_by_join_type(
+            left_indices,
+            right_indices,
+            adjust_range,
+            join_type,
+            preserve_order_for_right,
+        );
+    };
+
+    // Update the bitmap with the current matches first
+    for idx in right_indices.values() {
+        bitmap.set_bit(offset + (*idx as usize), true);
+    }
+
+    match join_type {
+        JoinType::Right | JoinType::Full => {
+            if !produce_unmatched_probe_rows {
+                Ok((left_indices, right_indices))
+            } else {
+                let unmatched_count = adjust_range
+                    .clone()
+                    .filter(|&i| !bitmap.get_bit(i + offset))
+                    .count();
+
+                if unmatched_count == 0 {
+                    return Ok((left_indices, right_indices));
+                }
+
+                let mut unmatched_indices = UInt32Builder::with_capacity(unmatched_count);
+                for i in adjust_range.clone() {
+                    if !bitmap.get_bit(i + offset) {
+                        unmatched_indices.append_value(i as u32);
+                    }
+                }
+                let unmatched_right = unmatched_indices.finish();
+
+                let total_len = left_indices.len() + unmatched_count;
+                let mut new_left_builder =
+                    left_indices.into_builder().unwrap_or_else(|left_indices| {
+                        let mut builder = UInt64Builder::with_capacity(total_len);
+                        builder.append_slice(left_indices.values());
+                        builder
+                    });
+                new_left_builder.append_nulls(unmatched_count);
+
+                let mut new_right_builder =
+                    right_indices
+                        .into_builder()
+                        .unwrap_or_else(|right_indices| {
+                            let mut builder = UInt32Builder::with_capacity(total_len);
+                            builder.append_slice(right_indices.values());
+                            builder
+                        });
+                new_right_builder.append_slice(unmatched_right.values());
+
+                Ok((
+                    UInt64Array::from(new_left_builder.finish()),
+                    UInt32Array::from(new_right_builder.finish()),
+                ))
+            }
+        }
+        JoinType::RightSemi => {
+            if !produce_unmatched_probe_rows {
+                Ok((
+                    UInt64Array::from_iter_values(vec![]),
+                    UInt32Array::from_iter_values(vec![]),
+                ))
+            } else {
+                let matched_count = adjust_range
+                    .clone()
+                    .filter(|&i| bitmap.get_bit(i + offset))
+                    .count();
+
+                let mut final_right = UInt32Builder::with_capacity(matched_count);
+                for i in adjust_range.clone() {
+                    if bitmap.get_bit(i + offset) {
+                        final_right.append_value(i as u32);
+                    }
+                }
+
+                let mut final_left = UInt64Builder::with_capacity(matched_count);
+                final_left.append_nulls(matched_count);
+
+                Ok((final_left.finish(), final_right.finish()))
+            }
+        }
+        JoinType::RightAnti => {
+            if !produce_unmatched_probe_rows {
+                Ok((
+                    UInt64Array::from_iter_values(vec![]),
+                    UInt32Array::from_iter_values(vec![]),
+                ))
+            } else {
+                let unmatched_count = adjust_range
+                    .clone()
+                    .filter(|&i| !bitmap.get_bit(i + offset))
+                    .count();
+
+                let mut unmatched_indices = UInt32Builder::with_capacity(unmatched_count);
+                for i in adjust_range.clone() {
+                    if !bitmap.get_bit(i + offset) {
+                        unmatched_indices.append_value(i as u32);
+                    }
+                }
+
+                let mut final_left = UInt64Builder::with_capacity(unmatched_count);
+                final_left.append_nulls(unmatched_count);
+
+                Ok((final_left.finish(), unmatched_indices.finish()))
+            }
+        }
+        JoinType::RightMark => {
+            if !produce_unmatched_probe_rows {
+                Ok((
+                    UInt64Array::from_iter_values(vec![]),
+                    UInt32Array::from_iter_values(vec![]),
+                ))
+            } else {
+                let range_len = adjust_range.len();
+                let mut mark_bitmap = BooleanBufferBuilder::new(range_len);
+
+                for i in adjust_range.clone() {
+                    mark_bitmap.append(bitmap.get_bit(i + offset));
+                }
+
+                let right_indices = UInt32Array::from_iter_values(adjust_range.map(|i| i as u32));
+
+                let left_indices = PrimitiveArray::new(
+                    vec![0; range_len].into(),
+                    Some(NullBuffer::new(mark_bitmap.finish())),
+                );
+
+                Ok((left_indices, right_indices))
+            }
+        }
+        _ => adjust_indices_by_join_type(
+            left_indices,
+            right_indices,
+            adjust_range,
+            join_type,
+            preserve_order_for_right,
+        ),
+    }
+}
+
 pub(crate) fn apply_join_filter_to_indices(
     build_input_buffer: &RecordBatch,
     probe_batch: &RecordBatch,
@@ -517,3 +694,148 @@ pub(crate) fn boundedness_from_children<'a>(
         Boundedness::Bounded
     }
 }
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use arrow::array::{UInt32Array, UInt64Array};
+    use datafusion_expr::JoinType;
+    use rstest::rstest;
+
+    fn setup_and_run(
+        join_type: JoinType,
+        offset: usize,
+    ) -> (UInt64Array, UInt32Array, BooleanBufferBuilder) {
+        // adjust_range: 0..5
+        let adjust_range = 0..5;
+
+        // Logical visited info for the range 0..5: [true, false, false, true, false]
+        // Indices 0 and 3 are already visited.
+        let logical_bitmap = vec![true, false, false, true, false];
+
+        let mut bitmap_builder = BooleanBufferBuilder::new(offset + 5);
+        // Prepend offset
+        bitmap_builder.append_n(offset, false);
+        bitmap_builder.append_slice(&logical_bitmap);
+
+        // Current matches: right_indices: [1, 4]
+        // This means index 1 and 4 are matched in this batch.
+        // Index 2 remains unmatched.
+        let right_indices = UInt32Array::from(vec![1, 4]);
+        let left_indices = UInt64Array::from(vec![10, 11]); // Corresponding left indices
+
+        // Case: Last partition (produce_unmatched_probe_rows = true)
+        let (l, r) = adjust_indices_with_visited_info(
+            left_indices.clone(),
+            right_indices.clone(),
+            adjust_range.clone(),
+            join_type,
+            false,
+            Some((&mut bitmap_builder, offset)),
+            true,
+        )
+        .unwrap();
+
+        (l, r, bitmap_builder)
+    }
+
+    fn verify_bitmap(bitmap_builder: &BooleanBufferBuilder, offset: usize) {
+        // Verify Bitmap updates
+        // Offset + 1 should be set to true (was false)
+        // Offset + 4 should be set to true (was false)
+        assert!(bitmap_builder.get_bit(offset + 1));
+        assert!(bitmap_builder.get_bit(offset + 4));
+        // Offset + 0 was true, stays true
+        assert!(bitmap_builder.get_bit(offset));
+        // Offset + 3 was true, stays true
+        assert!(bitmap_builder.get_bit(offset + 3));
+        // Offset + 2 was false, stays false (unmatched)
+        assert!(!bitmap_builder.get_bit(offset + 2));
+    }
+
+    #[rstest]
+    #[case(0)]
+    #[case(10)]
+    fn test_adjust_indices_with_visited_info_right_outer(#[case] offset: usize) {
+        let (l, r, bitmap_builder) = setup_and_run(JoinType::Right, offset);
+        verify_bitmap(&bitmap_builder, offset);
+
+        // Expected result:
+        // Original: (10, 1), (11, 4)
+        // Unmatched: (null, 2) (since 0 and 3 were visited before, 1 and 4 are visited now)
+        // Total: 3 rows.
+        assert_eq!(l.len(), 3);
+        assert_eq!(r.len(), 3);
+
+        // Check values
+        // Original parts
+        assert_eq!(l.value(0), 10);
+        assert_eq!(r.value(0), 1);
+        assert_eq!(l.value(1), 11);
+        assert_eq!(r.value(1), 4);
+
+        // Unmatched part
+        assert!(l.is_null(2));
+        assert_eq!(r.value(2), 2);
+    }
+
+    #[rstest]
+    #[case(0)]
+    #[case(10)]
+    fn test_adjust_indices_with_visited_info_right_semi(#[case] offset: usize) {
+        let (l, r, bitmap_builder) = setup_and_run(JoinType::RightSemi, offset);
+        verify_bitmap(&bitmap_builder, offset);
+
+        // Expected: 0, 1, 3, 4 (all visited)
+        // 0 (pre-visited), 1 (matched now), 3 (pre-visited), 4 (matched now)
+        assert_eq!(r.len(), 4);
+        let r_values: Vec<u32> = r.values().iter().copied().collect();
+        assert!(r_values.contains(&0));
+        assert!(r_values.contains(&1));
+        assert!(r_values.contains(&3));
+        assert!(r_values.contains(&4));
+
+        // Left side should be all nulls
+        assert_eq!(l.null_count(), 4);
+    }
+
+    #[rstest]
+    #[case(0)]
+    #[case(10)]
+    fn test_adjust_indices_with_visited_info_right_anti(#[case] offset: usize) {
+        let (l, r, bitmap_builder) = setup_and_run(JoinType::RightAnti, offset);
+        verify_bitmap(&bitmap_builder, offset);
+
+        // Expected: 2 (unvisited)
+        assert_eq!(r.len(), 1);
+        assert_eq!(r.value(0), 2);
+        assert_eq!(l.null_count(), 1);
+    }
+
+    #[rstest]
+    #[case(0)]
+    #[case(10)]
+    fn test_adjust_indices_with_visited_info_right_mark(#[case] offset: usize) {
+        let (l, r, bitmap_builder) = setup_and_run(JoinType::RightMark, offset);
+        verify_bitmap(&bitmap_builder, offset);
+
+        // Expected left: validity [true, true, false, true, true]
+        // 0: visited (T)
+        // 1: matched now (T)
+        // 2: unvisited (F)
+        // 3: visited (T)
+        // 4: matched now (T)
+        assert_eq!(l.len(), 5);
+        assert!(l.is_valid(0));
+        assert!(l.is_valid(1));
+        assert!(l.is_null(2));
+        assert!(l.is_valid(3));
+        assert!(l.is_valid(4));
+
+        // Expected right: [0, 1, 2, 3, 4]
+        assert_eq!(r.len(), 5);
+        for i in 0..5 {
+            assert_eq!(r.value(i), i as u32);
+        }
+    }
+}