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


##########
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();
+    if (metadata) {
+      for (int64_t i = 0; i < metadata->size(); ++i) {
+        AppendCustomMetadata(metadata->key(i), metadata->value(i));
+      }
+    }

Review Comment:
   When writing a batch, its batch specific metadata will be copied into the 
serializer's internal metadata variable. Previously, we have the 
`AppendCustomMetadata` API, but it is never called, so the serializer's 
internal metadata variable is always empty.



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

Reply via email to