MCPcopy Create free account
hub / github.com/apache/arrow / ExportRecordBatch

Function ExportRecordBatch

cpp/src/arrow/c/bridge.cc:702–717  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

700}
701
702Status ExportRecordBatch(const RecordBatch& batch, struct ArrowArray* out,
703 struct ArrowSchema* out_schema) {
704 // XXX perhaps bypass ToStructArray() for speed?
705 ARROW_ASSIGN_OR_RAISE(auto array, batch.ToStructArray());
706
707 SchemaExportGuard guard(out_schema);
708 if (out_schema != nullptr) {
709 // Export the schema, not the struct type, so as not to lose top-level metadata
710 RETURN_NOT_OK(ExportSchema(*batch.schema(), out_schema));
711 }
712 ArrayExporter exporter;
713 RETURN_NOT_OK(exporter.Export(array->data()));
714 exporter.Finish(out);
715 guard.Detach();
716 return Status::OK();
717}
718
719//////////////////////////////////////////////////////////////////////////
720// C device arrays

Callers 5

TEST_FFunction · 0.70
TestWithBatchFactoryMethod · 0.70
ExportStreamNextFunction · 0.70
ExportBatchFromJsonFunction · 0.50

Calls 7

ExportSchemaFunction · 0.70
OKFunction · 0.50
schemaMethod · 0.45
ExportMethod · 0.45
dataMethod · 0.45
FinishMethod · 0.45
DetachMethod · 0.45

Tested by 2

TEST_FFunction · 0.56
TestWithBatchFactoryMethod · 0.56