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


##########
cpp/src/arrow/ipc/writer.h:
##########
@@ -104,8 +104,7 @@ class ARROW_EXPORT RecordBatchWriter {
   virtual Status WriteRecordBatch(
       const RecordBatch& batch,
       const std::shared_ptr<const KeyValueMetadata>& custom_metadata) {
-    return Status::NotImplemented(
-        "Write record batch with custom metadata not implemented");
+    return WriteRecordBatch(batch);

Review Comment:
   It won't cause crash but this default implementation (ignoring 
custom_metadata if not supported) seems making higher level binding easier to 
write. Otherwise, for example, pyarrow's implementation will need to choose 
which API to use like this:
   ```
   def write_batch(self, batch, custom_metadata=None):
      if (custom_metadata):
        WriteRecordBatch(batch, custom_metadata);
      else:
        WriteRecordBatch(batch);
   ```
   It seems this will be a pattern for all higher level bindings, which I think 
probably indicates this could be handled in lower level API, so that higher 
level binding could always be implemented like this:
   ```
    def write_batch(self, batch, custom_metadata=None):
        WriteRecordBatch(batch, custom_metadata);
   ```
   What do you think?



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