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


##########
rust/sedona-spatial-join/src/stream.rs:
##########
@@ -896,10 +941,20 @@ struct ProbeProgress {
     /// Cursor of the position in the `build_batch_positions` and 
`probe_indices` vectors
     /// for tracking the progress of producing joined batches
     pos: usize,
+    /// KNN-specific progress. Only used for KNN join.
+    knn: Option<KNNProbeProgress>,
+}
+
+struct KNNProbeProgress {
+    /// Accumulated comparable (e.g. squared) distances of the KNN results.
+    /// Should have the same length as `build_batch_positions`.
+    distances: Vec<f64>,

Review Comment:
   No, it is local to one probe batch, the size won't exceed probe_batch_size * 
K.



##########
rust/sedona-spatial-join/src/partitioning/broadcast.rs:
##########
@@ -0,0 +1,72 @@
+// 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_common::Result;
+use sedona_common::sedona_internal_err;
+use sedona_geometry::bounding_box::BoundingBox;
+
+use crate::partitioning::{SpatialPartition, SpatialPartitioner};
+
+/// A partitioner that assigns everything to the Multi partition.
+///
+/// This partitioner is useful when we want to broadcast the data to all 
partitions.

Review Comment:
   Improved the comment.



##########
rust/sedona-spatial-join/src/index/spatial_index.rs:
##########
@@ -213,13 +215,33 @@ impl SpatialIndex {
     /// # Returns
     ///
     /// * `JoinResultMetrics` containing the number of actual matches and 
candidates processed
+    #[allow(unused)]

Review Comment:
   No. I think I should replace it using `query_knn_with_distance`.



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