Hello Arrow users, I would need some help to understand how I can pass an RecordBatch or a table created in a C++ build DLL into a C# application? How could this be handled efficiently without much data copies?
Kind Regards, Bjoern Bachmann.C++ sample code which is exported in the DLL:std::queue<std::shared_ptr<arrow::RecordBatch>> wfmQueue;ARROW_EXAM_API long EnqueueWaveformChunks()
{//En-Queue Loop
std::cout << "En-Queue Data ... \n";
for (int i = 0; i < chunk_size; i++) {
createWfmSrc(col0_data, col1_data);
WaveformChunkWriterHelper testWfm{ col0_data, col1_data }; //creates schema and adds the data
testWfm.createRecBatch();
wfmQueue.push(testWfm.getRecBatch());
}
return S_OK;
}ARROW_EXAM_API long DequeueSingleWaveformChunk(arrow::RecordBatch* recBatch)
{
std::shared_ptr<arrow::RecordBatch> queueItem;
if (!wfmQueue.empty()) {
queueItem = wfmQueue.front();
wfmQueue.pop();std::cout << "Get RecBatch from Queue\n";
recBatch = queueItem.get();//ExportRecordBatch(*queueItem, c_array);
//recBatch = reinterpret_cast<void*>(queueItem.get());
}
return S_OK;
}
