tustvold commented on code in PR #1719:
URL: https://github.com/apache/arrow-rs/pull/1719#discussion_r878742710
##########
parquet/src/file/writer.rs:
##########
@@ -393,39 +387,91 @@ impl<W: 'static + ParquetWriter> RowGroupWriter for
SerializedRowGroupWriter<W>
.set_num_rows(self.total_rows_written.unwrap_or(0) as i64)
.build()?;
- self.row_group_metadata = Some(Arc::new(row_group_metadata));
+ let metadata = Arc::new(row_group_metadata);
+ self.row_group_metadata = Some(metadata.clone());
+
+ if let Some(on_close) = self.on_close.take() {
+ on_close(metadata)?
+ }
}
let metadata = self.row_group_metadata.as_ref().unwrap().clone();
Ok(metadata)
}
}
+/// A wrapper around a [`ColumnWriter`] that invokes a callback on
[`Self::close`]
Review Comment:
I'm not a massive fan of this, but I was somewhat wary of making changes to
the `ColumnWriter` plumbing as it is used in lots of places
--
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]