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/04/07 12:33:09 UTC

[GitHub] [arrow] lidavidm commented on a diff in pull request #12812: ARROW-16131 [C++] support saving and retrieving custom metadata in batches for IPC file

lidavidm commented on code in PR #12812:
URL: https://github.com/apache/arrow/pull/12812#discussion_r845076985


##########
cpp/src/arrow/ipc/writer.cc:
##########
@@ -263,6 +263,14 @@ class RecordBatchSerializer {
     out_->body_length = offset - buffer_start_offset_;
     DCHECK(bit_util::IsMultipleOf8(out_->body_length));
 
+    // copy given record batch's schema metadata to the serializer for serialization
+    auto const &metadata = batch.schema()->metadata();

Review Comment:
   Maybe we should instead add overloads that also allow explicitly passing in metadata to include with the message. Thoughts @pitrou @westonpace?



##########
cpp/src/arrow/ipc/writer.cc:
##########
@@ -263,6 +263,14 @@ class RecordBatchSerializer {
     out_->body_length = offset - buffer_start_offset_;
     DCHECK(bit_util::IsMultipleOf8(out_->body_length));
 
+    // copy given record batch's schema metadata to the serializer for serialization
+    auto const &metadata = batch.schema()->metadata();

Review Comment:
   ```suggestion
       const auto& metadata = batch.schema()->metadata();
   ```
   for consistency



##########
cpp/src/arrow/ipc/writer.cc:
##########
@@ -263,6 +263,14 @@ class RecordBatchSerializer {
     out_->body_length = offset - buffer_start_offset_;
     DCHECK(bit_util::IsMultipleOf8(out_->body_length));
 
+    // copy given record batch's schema metadata to the serializer for serialization
+    auto const &metadata = batch.schema()->metadata();

Review Comment:
   I'm not sure about this change. If the overall schema has metadata, then won't this copy the schema metadata into every batch, duplicating it over and over?



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