paleolimbot commented on code in PR #143:
URL: https://github.com/apache/arrow-nanoarrow/pull/143#discussion_r1129451619
##########
extensions/nanoarrow_ipc/src/nanoarrow/nanoarrow_ipc.c:
##########
@@ -785,5 +876,261 @@ ArrowErrorCode ArrowIpcReaderDecode(struct
ArrowIpcReader* reader,
return EINVAL;
}
+ private_data->last_message = message_header;
+ return NANOARROW_OK;
+}
+
+ArrowErrorCode ArrowIpcReaderGetSchema(struct ArrowIpcReader* reader,
+ struct ArrowSchema* out,
+ struct ArrowError* error) {
+ struct ArrowIpcReaderPrivate* private_data =
+ (struct ArrowIpcReaderPrivate*)reader->private_data;
+
+ if (private_data->schema.release == NULL) {
+ ArrowErrorSet(error, "reader does not contain a valid schema");
+ return EINVAL;
+ }
+
+ ArrowSchemaMove(&private_data->schema, out);
Review Comment:
Until there's a code path where the decoder needs a copy of the schema for
something, probably a move? Strictly speaking, the decoder just needs to "see"
the schema once and doesn't need to refer to it again.
--
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]