pitrou commented on code in PR #39455:
URL: https://github.com/apache/arrow/pull/39455#discussion_r1446406409
##########
cpp/src/arrow/c/bridge.cc:
##########
@@ -1979,13 +1979,61 @@ Result<std::shared_ptr<RecordBatch>>
ImportDeviceRecordBatch(
namespace {
+template <typename T>
+static inline Status ExportStreamSchema(const std::shared_ptr<T>& src,
+ struct ArrowSchema* out_schema);
+
+template <>
+inline Status ExportStreamSchema(const std::shared_ptr<RecordBatchReader>& src,
+ struct ArrowSchema* out_schema) {
+ return ExportSchema(*src->schema(), out_schema);
+}
+
+template <>
+inline Status ExportStreamSchema(const std::shared_ptr<ChunkedArray>& src,
+ struct ArrowSchema* out_schema) {
+ return ExportType(*src->type(), out_schema);
+}
Review Comment:
```suggestion
Status ExportStreamSchema(const std::shared_ptr<RecordBatchReader>& src,
struct ArrowSchema* out_schema) {
return ExportSchema(*src->schema(), out_schema);
}
Status ExportStreamSchema(const std::shared_ptr<ChunkedArray>& src,
struct ArrowSchema* out_schema) {
return ExportType(*src->type(), out_schema);
}
```
--
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]