paleolimbot commented on code in PR #799:
URL: https://github.com/apache/sedona-db/pull/799#discussion_r3161960204


##########
rust/sedona-spatial-join/src/partitioning/stream_repartitioner.rs:
##########
@@ -601,26 +600,27 @@ pub(crate) fn assign_rows(
         PartitionedSide::BuildSide => {
             let mut cnt = 0;
             let num_regular_partitions = partitioner.num_regular_partitions() 
as u32;
-            for rect_opt in batch.geom_array.rects() {
-                let partition = match rect_opt {
-                    Some(rect) => 
partitioner.partition_no_multi(&geo_rect_to_bbox(rect))?,
-                    None => {
-                        // Round-robin empty geometries through regular 
partitions to avoid
-                        // overloading a single slot when the build side is 
mostly empty.
-                        let p = SpatialPartition::Regular(cnt);
-                        cnt = (cnt + 1) % num_regular_partitions;
-                        p
-                    }
+            for rect in batch.geom_array.rects() {
+                let partition = if rect.is_empty() {
+                    // Round-robin empty geometries through regular partitions 
to avoid
+                    // overloading a single slot when the build side is mostly 
empty.
+                    let p = SpatialPartition::Regular(cnt);
+                    cnt = (cnt + 1) % num_regular_partitions;
+                    p
+                } else {
+                    partitioner.partition_no_multi(&BoundingBox::xy(rect.x(), 
rect.y()))?
                 };
                 assignments.push(partition);
             }
         }
         PartitionedSide::ProbeSide => {
-            for rect_opt in batch.geom_array.rects() {
-                let partition = match rect_opt {
-                    Some(rect) => 
partitioner.partition(&geo_rect_to_bbox(rect))?,
-                    None => SpatialPartition::None,
+            for rect in batch.geom_array.rects() {
+                let partition = if rect.is_empty() {
+                    SpatialPartition::None
+                } else {
+                    partitioner.partition(&BoundingBox::xy(rect.x(), 
rect.y()))?
                 };

Review Comment:
   This is valid...if a partition ends up with wraparound bounds, the out of 
core join will currently error. I opened 
https://github.com/apache/sedona-db/issues/800 to track.



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

To unsubscribe, e-mail: [email protected]

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

Reply via email to