tustvold commented on code in PR #6527:
URL: https://github.com/apache/arrow-rs/pull/6527#discussion_r1792322244


##########
arrow/src/lib.rs:
##########
@@ -345,6 +345,67 @@
 //! orchestrates the primitives exported by this crate into an embeddable 
query engine, with
 //! SQL and DataFrame frontends, and heavily influences this crate's roadmap.
 //!
+//! The Rust implementation does not provide the ChunkedArray abstraction 
implemented by the Python
+//! and C++ Arrow implementations. The recommended alternative is to use one 
of the following:
+//! - `Vec<ArrayRef>` a simple, eager version of a `ChunkedArray`
+//! - `impl Iterator<Item=ArrayRef>` a lazy version of a `ChunkedArray`
+//! - `impl Stream<Item=ArrayRef>` a lazy async version of a `ChunkedArray`
+//!
+//! Similar patterns can be applied at the `RecordBatch` level. For example, 
[DataFusion] makes
+//! extensive use of [RecordBatchStream].
+//!
+//! This approach integrates well into the Rust ecosystem, simplifies the 
implementation and
+//! encourages the use of performant lazy and async patterns.
+//!
+//! Aside from providing a slightly less convenient API, one other downside is 
the lack of support
+//! for processing compute kernels across chunked arrays. But this use case is 
well-supported by
+//! [DataFusion].
+//!

Review Comment:
   ```suggestion
   ```
   
   I'm not sure I agree with this statement, iterators are fairly ergonomic 
once you get the hang of them, and it is fairly trivial to use the processing 
kernels with them.
   
   e.g.
   
   ```
   let arrays = todo!();
   
   let processed = arrays.iter().map(|x| cast(&DataType::Int64, 
x.as_ref())).collect::<Result<Vec<_>, _>>().unwrap();
   ```



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