Lordworms commented on code in PR #9197:
URL: https://github.com/apache/arrow-datafusion/pull/9197#discussion_r1488026849


##########
datafusion/core/src/execution/context/mod.rs:
##########
@@ -934,7 +935,30 @@ impl SessionContext {
             .build()?,
         ))
     }
-
+    /// Create a [`DataFrame`] for reading a [`Vec[`RecordBatch`]`]
+    pub fn read_batches(
+        &self,
+        batches: impl IntoIterator<Item = RecordBatch>,
+    ) -> Result<DataFrame> {
+        // check schema uniqueness
+        let mut batches = batches.into_iter().peekable();
+        let schema = if let Some(batch) = batches.peek() {
+            batch.schema().clone()
+        } else {
+            Arc::new(Schema::empty())
+        };
+        let provider =
+            MemTable::try_new(schema, batches.map(|batch| 
vec![batch]).collect())?;

Review Comment:
   Thanks, I would read about it and commit the changes soon.



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