pwrliang commented on code in PR #645:
URL: https://github.com/apache/sedona-db/pull/645#discussion_r2918027324
##########
rust/sedona-spatial-join/src/index/partitioned_index_provider.rs:
##########
@@ -342,23 +344,54 @@ impl PartitionedIndexProvider {
return Err(DataFusionError::External(Box::new(e)));
}
}
-
- index_builder.merge_stats(geo_statistics);
-
- let index = index_builder.finish()?;
- Ok(Arc::new(index))
+ builder.finish()
}
}
async fn get_index_from_cell(
- cell: &DisposableAsyncCell<SharedResult<Arc<SpatialIndex>>>,
-) -> Option<Result<Arc<SpatialIndex>>> {
+ cell: &DisposableAsyncCell<SharedResult<SpatialIndexRef>>,
+) -> Option<Result<SpatialIndexRef>> {
match cell.get().await {
Some(Ok(index)) => Some(Ok(index)),
Some(Err(shared_err)) =>
Some(Err(DataFusionError::Shared(shared_err))),
None => None,
}
}
+struct ReceiverBatchStream {
+ rx: Receiver<Result<EvaluatedBatch>>, // Or Result<EvaluatedBatch,
DataFusionError>
+ schema: SchemaRef,
+ is_external: bool,
+}
+
+impl ReceiverBatchStream {
+ pub fn new(rx: Receiver<Result<EvaluatedBatch>>, schema: SchemaRef,
is_external: bool) -> Self {
+ Self {
+ rx,
+ schema,
+ is_external,
+ }
+ }
+}
+
+impl Stream for ReceiverBatchStream {
+ type Item = Result<EvaluatedBatch>;
+
+ fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) ->
Poll<Option<Self::Item>> {
+ println!("Polling KNN Join Stream...");
Review Comment:
This was for debugging, I have removed it now.
--
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]