You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2023/05/24 21:51:32 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #4278: Add `Debug` impls for `ArrowWriter` and `SerializedFileWriter`

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


##########
parquet/src/file/writer.rs:
##########
@@ -147,6 +148,18 @@ pub struct SerializedFileWriter<W: Write> {
     kv_metadatas: Vec<KeyValue>,
 }
 
+impl<W: Write> Debug for SerializedFileWriter<W> {

Review Comment:
   FWIW `#[derive(Debug)]` on `TrackedWrite` would allow similar here, without needing a manual impl. SerializedFileWriter doesn't contain any non-public types on it



##########
parquet/src/arrow/arrow_writer/mod.rs:
##########
@@ -92,6 +93,31 @@ pub struct ArrowWriter<W: Write> {
     max_row_group_size: usize,
 }
 
+impl<W: Write> Debug for ArrowWriter<W> {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        let mut buffered_batches = 0;

Review Comment:
   I think buffered_batches is just `self.buffer.len()`?



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