tustvold commented on code in PR #4228:
URL: https://github.com/apache/arrow-rs/pull/4228#discussion_r1195486370
##########
arrow-array/src/record_batch.rs:
##########
@@ -47,6 +47,9 @@ pub trait RecordBatchReader: Iterator<Item =
Result<RecordBatch, ArrowError>> {
pub trait RecordBatchWriter {
/// Write a single batch to the writer.
fn write(&mut self, batch: &RecordBatch) -> Result<(), ArrowError>;
+
+ /// Write footer or termination data, then mark the writer as done.
+ fn finish(self) -> Result<(), ArrowError>;
Review Comment:
```suggestion
fn close(self) -> Result<(), ArrowError>;
```
Perhaps, this might avoid the name collisions?
##########
parquet/src/arrow/arrow_writer/mod.rs:
##########
@@ -250,6 +250,10 @@ impl<W: Write> RecordBatchWriter for ArrowWriter<W> {
fn write(&mut self, batch: &RecordBatch) -> Result<(), ArrowError> {
self.write(batch).map_err(|e| e.into())
}
+
+ fn finish(self) -> std::result::Result<(), ArrowError> {
+ self.close().map(|_| ()).map_err(ArrowError::from)
Review Comment:
```suggestion
self.close()?;
Ok(())
```
--
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]