You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/23 10:57:47 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #1719: Change parquet `ArrowFileWriter` to use standard `std:io::Write` rather custom `ParquetWriter` trait (#1717) (#1163)

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


##########
parquet/src/file/mod.rs:
##########
@@ -48,12 +48,14 @@
 //! let props = Arc::new(WriterProperties::builder().build());
 //! let file = fs::File::create(&path).unwrap();
 //! let mut writer = SerializedFileWriter::new(file, schema, props).unwrap();
-//! let mut row_group_writer = writer.next_row_group().unwrap();
-//! while let Some(mut col_writer) = row_group_writer.next_column().unwrap() {
-//!     // ... write values to a column writer
-//!     row_group_writer.close_column(col_writer).unwrap();
+//! {

Review Comment:
   > Which trait indirection are you referring to?
   
   We have FileWriter and RowGroupWriter traits which are then implemented by `SerializedFileWriter` and `SerializedRowGroupWriter`.
   
   I'm not sure why you would ever want to override the default implementation, and the need to expose these as object-safe traits prevents `FileWriter::close(self)` or `RowGroupWriter::close(self)` which causes lifetime annoyances.
   
   I also find the indirection very confusing in general :sweat_smile:  



-- 
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-unsubscribe@arrow.apache.org

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