Skip to content

Commit 862ed2e

Browse files
committed
docs: document from_ffi consumption invariant in JvmScalarUdfExpr
1 parent 909ab91 commit 862ed2e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • native/spark-expr/src/jvm_udf

native/spark-expr/src/jvm_udf/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ impl PhysicalExpr for JvmScalarUdfExpr {
195195
})?;
196196

197197
// Step 4: import the result from the FFI slots filled by the JVM.
198+
// SAFETY: from_ffi consumes the FFI_ArrowArray's release ownership; arrow-rs sets the
199+
// release callback to None on the moved-from struct, so the Box's subsequent drop is a no-op.
198200
let result_data = unsafe { from_ffi(*out_array, &out_schema) }
199201
.map_err(|e| CometError::Arrow { source: e })?;
200202
Ok(ColumnarValue::Array(make_array(result_data)))

0 commit comments

Comments
 (0)