diff --git a/arrow-array/src/ffi.rs b/arrow-array/src/ffi.rs index 7dd63c35af3e..e1761beb2bf4 100644 --- a/arrow-array/src/ffi.rs +++ b/arrow-array/src/ffi.rs @@ -109,37 +109,8 @@ use arrow_data::{ArrayData, layout}; pub use arrow_schema::ffi::FFI_ArrowSchema; use arrow_schema::{ArrowError, DataType, UnionMode}; -use crate::array::ArrayRef; - type Result = std::result::Result; -/// Exports an array to raw pointers of the C Data Interface provided by the consumer. -/// # Safety -/// Assumes that these pointers represent valid C Data Interfaces, both in memory -/// representation and lifetime via the `release` mechanism. -/// -/// This function copies the content of two FFI structs [arrow_data::ffi::FFI_ArrowArray] and -/// [arrow_schema::ffi::FFI_ArrowSchema] in the array to the location pointed by the raw pointers. -/// Usually the raw pointers are provided by the array data consumer. -#[deprecated( - since = "52.0.0", - note = "Use FFI_ArrowArray::new and FFI_ArrowSchema::try_from" -)] -pub unsafe fn export_array_into_raw( - src: ArrayRef, - out_array: *mut FFI_ArrowArray, - out_schema: *mut FFI_ArrowSchema, -) -> Result<()> { - let data = src.to_data(); - let array = FFI_ArrowArray::new(&data); - let schema = FFI_ArrowSchema::try_from(data.data_type())?; - - unsafe { std::ptr::write_unaligned(out_array, array) }; - unsafe { std::ptr::write_unaligned(out_schema, schema) }; - - Ok(()) -} - /// returns the number of bits that buffer `i` (in the C data interface) is expected to have. /// This is set by the Arrow specification fn bit_width(data_type: &DataType, i: usize) -> Result { @@ -1151,35 +1122,6 @@ mod tests_to_then_from_ffi { Ok(()) } - #[test] - #[allow(deprecated)] - fn test_export_array_into_raw() -> Result<()> { - let array = make_array(Int32Array::from(vec![1, 2, 3]).into_data()); - - // Assume two raw pointers provided by the consumer - let mut out_array = FFI_ArrowArray::empty(); - let mut out_schema = FFI_ArrowSchema::empty(); - - { - let out_array_ptr = std::ptr::addr_of_mut!(out_array); - let out_schema_ptr = std::ptr::addr_of_mut!(out_schema); - unsafe { - export_array_into_raw(array, out_array_ptr, out_schema_ptr)?; - } - } - - // (simulate consumer) import it - let data = unsafe { from_ffi(out_array, &out_schema) }?; - let array = make_array(data); - - // perform some operation - let array = array.as_any().downcast_ref::().unwrap(); - - // verify - assert_eq!(array, &Int32Array::from(vec![1, 2, 3])); - Ok(()) - } - #[test] fn test_duration() -> Result<()> { // create an array natively diff --git a/arrow-ipc/src/reader.rs b/arrow-ipc/src/reader.rs index 8349cafc7200..05db7a8ad559 100644 --- a/arrow-ipc/src/reader.rs +++ b/arrow-ipc/src/reader.rs @@ -1616,15 +1616,6 @@ impl StreamReader { }) } - /// Deprecated, use [`StreamReader::try_new`] instead. - #[deprecated(since = "53.0.0", note = "use `try_new` instead")] - pub fn try_new_unbuffered( - reader: R, - projection: Option>, - ) -> Result { - Self::try_new(reader, projection) - } - /// Return the schema of the stream pub fn schema(&self) -> SchemaRef { self.schema.clone() diff --git a/arrow/src/array/mod.rs b/arrow/src/array/mod.rs index e548c4c83757..327acc99b3c3 100644 --- a/arrow/src/array/mod.rs +++ b/arrow/src/array/mod.rs @@ -31,9 +31,5 @@ pub use arrow_data::{ pub use arrow_data::transform::{Capacities, MutableArrayData}; -#[cfg(feature = "ffi")] -#[allow(deprecated)] -pub use arrow_array::ffi::export_array_into_raw; - // --------------------- Array's values comparison --------------------- pub use arrow_ord::ord::{DynComparator, make_comparator};