Class JniBridge
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidexecutePlan(ExecutionPlan plan, int partition, long ffiStreamAddr) Open a fresh batch stream from a JavaTableProviderand export it through the supplied Arrow C Data Interface address.static 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 ExecutionPlanscanWithArgs(TableProvider provider, byte[] optionsBytes, byte[][] filterProtos) Plan one physical scan without opening its reader.static int[]supportsTableFilterPushdown(TableProvider provider, byte[][] filterProtos) Report per-expression capabilities using the native adapter's closed numeric contract.
-
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.
-
scanWithArgs
public static ExecutionPlan scanWithArgs(TableProvider provider, byte[] optionsBytes, byte[][] filterProtos) throws com.google.protobuf.InvalidProtocolBufferException Plan one physical scan without opening its reader. Called from native code.- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
supportsTableFilterPushdown
public static int[] supportsTableFilterPushdown(TableProvider provider, byte[][] filterProtos) throws com.google.protobuf.InvalidProtocolBufferException Report per-expression capabilities using the native adapter's closed numeric contract.- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
executePlan
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.ExecutionPlan.execute(int, org.apache.arrow.memory.BufferAllocator)is called withALLOCATORso that the reader's buffers share the same allocator root required byData.exportArrayStream(BufferAllocator, ArrowReader, 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.
-