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


##########
parquet/src/file/writer.rs:
##########
@@ -270,69 +273,45 @@ impl<W: 'static + ParquetWriter> FileWriter for 
SerializedFileWriter<W> {
 /// A serialized implementation for Parquet [`RowGroupWriter`].
 /// Coordinates writing of a row group with column writers.
 /// See documentation on row group writer for more information.
-pub struct SerializedRowGroupWriter<W: ParquetWriter> {
+pub struct SerializedRowGroupWriter<'a, W: Write> {
     descr: SchemaDescPtr,
     props: WriterPropertiesPtr,
-    buf: W,
+    buf: &'a mut TrackedWrite<W>,
     total_rows_written: Option<u64>,
     total_bytes_written: u64,
     column_index: usize,
-    previous_writer_closed: bool,
     row_group_metadata: Option<RowGroupMetaDataPtr>,
     column_chunks: Vec<ColumnChunkMetaData>,
+    on_close: Option<OnCloseRowGroup<'a>>,
 }
 
-impl<W: 'static + ParquetWriter> SerializedRowGroupWriter<W> {
+impl<'a, W: Write> SerializedRowGroupWriter<'a, W> {
+    /// Creates a new `SerializedRowGroupWriter` with:
+    ///
+    /// - `schema_descr` - the schema to write
+    /// - `properties` - writer properties
+    /// - `buf` - the buffer to write data to
+    /// - `on_close` - an optional callback that will invoked on 
[`Self::close`]
     pub fn new(
         schema_descr: SchemaDescPtr,
         properties: WriterPropertiesPtr,
-        buf: &W,
+        buf: &'a mut TrackedWrite<W>,
+        on_close: Option<OnCloseRowGroup<'a>>,

Review Comment:
   So these writers are technically public and I don't really know what people 
might be using them for, I thought this was a way to make the change less 
annoying - you can just pass `None` and move on...



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to