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


##########
rust/sedona/src/record_batch_reader_provider.rs:
##########
@@ -208,12 +266,40 @@ mod test {
 
     use arrow_array::{RecordBatch, RecordBatchIterator};
     use arrow_schema::{DataType, Field, Schema};
-    use datafusion::prelude::SessionContext;
+    use datafusion::prelude::{DataFrame, SessionContext};
+    use rstest::rstest;
     use sedona_schema::datatypes::WKB_GEOMETRY;
     use sedona_testing::create::create_array_storage;
 
     use super::*;
 
+    fn create_test_batch(size: usize, start_id: i32) -> RecordBatch {
+        let schema = Schema::new(vec![Field::new("id", DataType::Int32, 
false)]);
+        let ids: Vec<i32> = (start_id..start_id + size as i32).collect();
+        RecordBatch::try_new(
+            Arc::new(schema),
+            vec![Arc::new(arrow_array::Int32Array::from(ids))],
+        )
+        .unwrap()
+    }
+
+    fn create_test_reader(batch_sizes: Vec<usize>) -> Box<dyn 
RecordBatchReader + Send> {
+        let mut start_id = 0i32;
+        let batches: Vec<RecordBatch> = batch_sizes
+            .into_iter()
+            .map(|size| {
+                let batch = create_test_batch(size, start_id);
+                start_id += size as i32;
+                batch
+            })
+            .collect();

Review Comment:
   This is part of the test cases, the possible values of `batch_sizes` won't 
let it panic.



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