rluvaton commented on code in PR #23560:
URL: https://github.com/apache/datafusion/pull/23560#discussion_r3578764721
##########
datafusion/physical-plan/src/common.rs:
##########
@@ -554,4 +556,59 @@ mod tests {
let err = project_plan_to_schema(input, &expected_schema).unwrap_err();
assert!(err.to_string().contains("schema metadata differ"));
}
+
+ /// Verifies that `spawn_buffered` holds exactly `buffer + 1` record
batches in memory
+ /// when no receiver is polling: `buffer` slots in the channel and 1 held
in the
+ /// suspended `send()` future.
+ #[tokio::test(flavor = "multi_thread")]
+ async fn test_spawn_buffered_max_in_flight_batches() {
+ use crate::stream::RecordBatchStreamAdapter;
+ use arrow::array::Int32Array;
+ use futures::stream;
+ use std::sync::atomic::{AtomicUsize, Ordering};
+
+ let schema = Arc::new(Schema::new(vec![Field::new("a",
DataType::Int32, false)]));
+ let buffer_size = 1;
Review Comment:
can you have the same test but with buffer_size 2 as well? (just extract the
test code and get an argument for `buffer_size`)
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]