Class JniBridge
-
Method Summary
Modifier and TypeMethodDescriptionstatic byteinvokeScalarUdf(ScalarFunction impl, long arrayArgsArrayAddr, long arrayArgsSchemaAddr, long scalarArgsArrayAddr, long scalarArgsSchemaAddr, byte[] argKinds, long resultArrayAddr, long resultSchemaAddr, int rowCount) Invoke a scalar UDF for one batch.static voidinvokeTableScan(TableProvider provider, long ffiStreamAddr) Open a fresh batch stream from a JavaTableProviderand export it through the supplied Arrow C Data Interface address.
-
Method Details
-
invokeScalarUdf
public static byte invokeScalarUdf(ScalarFunction impl, long arrayArgsArrayAddr, long arrayArgsSchemaAddr, long scalarArgsArrayAddr, long scalarArgsSchemaAddr, byte[] argKinds, long resultArrayAddr, long resultSchemaAddr, int rowCount) Invoke a scalar UDF for one batch. Called from native code; not for application use.Args arrive split into two struct arrays:
arrayArgs*of lengthrowCountholding theColumnarValue.Arrayarguments in their relative order, andscalarArgs*of length 1 holding theColumnarValue.Scalararguments.argKindsrecords the original positional order so the bridge can interleave them back into a singleList<ColumnarValue>for the user.- Returns:
KIND_ARRAYif the UDF returned an Array,KIND_SCALARif it returned a Scalar. The native caller uses this to reconstruct the rightColumnarValuevariant.
-
invokeTableScan
Open a fresh batch stream from a JavaTableProviderand export it through the supplied Arrow C Data Interface address. Called from native code; not for application use.TableProvider.scan(org.apache.arrow.memory.BufferAllocator)is called withALLOCATORso that the reader's buffers share the same allocator root required byData.exportArrayStream(org.apache.arrow.memory.BufferAllocator, org.apache.arrow.vector.ipc.ArrowReader, org.apache.arrow.c.ArrowArrayStream).On success, ownership of the returned reader transfers to the FFI stream's release callback, so the native side closing the stream also closes the reader. On any failure during export, the reader is closed here before the exception propagates.
-