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

Function ExportRecordBatch

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

Source from the content-addressed store, hash-verified

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