Background
We need to be able to call DataFusion query code from Java. This needs some support on the Rust side to export a C ABI compatible interface.
Analysis
We will use the Arrow FFI C stream interface to pass the RecordBatches from Rust across to Java. This is a zero copy operation. The ownership of the RecordBatches will transfer from Rust to Java, thus once we have given a RecordBatch from Rust to Java, the underlying arrays will be managed using the standard Java garbage collector.