nevi-me commented on a change in pull request #8826:
URL: https://github.com/apache/arrow/pull/8826#discussion_r541786808
##########
File path: rust/arrow/src/ipc/writer.rs
##########
@@ -98,6 +98,239 @@ impl Default for IpcWriteOptions {
}
}
+#[derive(Debug, Default)]
+pub struct IpcDataGenerator {}
+
+impl IpcDataGenerator {
+ pub fn schema_to_bytes(
+ &self,
+ schema: &Schema,
+ write_options: &IpcWriteOptions,
+ ) -> EncodedData {
+ let mut fbb = FlatBufferBuilder::new();
+ let schema = {
+ let fb = ipc::convert::schema_to_fb_offset(&mut fbb, schema);
+ fb.as_union_value()
+ };
+
+ let mut message = ipc::MessageBuilder::new(&mut fbb);
+ message.add_version(write_options.metadata_version);
+ message.add_header_type(ipc::MessageHeader::Schema);
+ message.add_bodyLength(0);
+ message.add_header(schema);
+ // TODO: custom metadata
Review comment:
We should attach JIRAs to the TODOs so we don't lose track of them
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]