diff --git a/arrow-arith/src/temporal.rs b/arrow-arith/src/temporal.rs index 7cbe56c17fd..e88b832f558 100644 --- a/arrow-arith/src/temporal.rs +++ b/arrow-arith/src/temporal.rs @@ -21,7 +21,7 @@ use std::sync::Arc; use arrow_array::cast::AsArray; use cast::as_primitive_array; -use chrono::{Datelike, NaiveDateTime, Offset, TimeZone, Timelike, Utc}; +use chrono::{Datelike, TimeZone, Timelike, Utc}; use arrow_array::temporal_conversions::{ date32_to_datetime, date64_to_datetime, timestamp_ms_to_datetime, timestamp_ns_to_datetime, @@ -664,20 +664,6 @@ impl ChronoDateExt for T { } } -/// Parse the given string into a string representing fixed-offset that is correct as of the given -/// UTC NaiveDateTime. -/// -/// Note that the offset is function of time and can vary depending on whether daylight savings is -/// in effect or not. e.g. Australia/Sydney is +10:00 or +11:00 depending on DST. -#[deprecated(since = "26.0.0", note = "Use arrow_array::timezone::Tz instead")] -pub fn using_chrono_tz_and_utc_naive_date_time( - tz: &str, - utc: NaiveDateTime, -) -> Option { - let tz: Tz = tz.parse().ok()?; - Some(tz.offset_from_utc_datetime(&utc).fix()) -} - /// Extracts the hours of a given array as an array of integers within /// the range of [0, 23]. If the given array isn't temporal primitive or dictionary array, /// an `Err` will be returned. diff --git a/arrow-array/src/array/binary_array.rs b/arrow-array/src/array/binary_array.rs index 350661a85d1..bbf61f286e6 100644 --- a/arrow-array/src/array/binary_array.rs +++ b/arrow-array/src/array/binary_array.rs @@ -24,12 +24,6 @@ use arrow_schema::DataType; pub type GenericBinaryArray = GenericByteArray>; impl GenericBinaryArray { - /// Get the data type of the array. - #[deprecated(since = "20.0.0", note = "please use `Self::DATA_TYPE` instead")] - pub const fn get_data_type() -> DataType { - Self::DATA_TYPE - } - /// Creates a [GenericBinaryArray] from a vector of byte slices /// /// See also [`Self::from_iter_values`] diff --git a/arrow-array/src/array/primitive_array.rs b/arrow-array/src/array/primitive_array.rs index ae394b588b7..bad6af959d0 100644 --- a/arrow-array/src/array/primitive_array.rs +++ b/arrow-array/src/array/primitive_array.rs @@ -1480,24 +1480,6 @@ def_numeric_from_vec!(TimestampMicrosecondType); def_numeric_from_vec!(TimestampNanosecondType); impl PrimitiveArray { - /// Construct a timestamp array from a vec of i64 values and an optional timezone - #[deprecated(since = "26.0.0", note = "Use with_timezone_opt instead")] - pub fn from_vec(data: Vec, timezone: Option) -> Self - where - Self: From>, - { - Self::from(data).with_timezone_opt(timezone) - } - - /// Construct a timestamp array from a vec of `Option` values and an optional timezone - #[deprecated(since = "26.0.0", note = "Use with_timezone_opt instead")] - pub fn from_opt_vec(data: Vec>, timezone: Option) -> Self - where - Self: From>>, - { - Self::from(data).with_timezone_opt(timezone) - } - /// Returns the timezone of this array if any pub fn timezone(&self) -> Option<&str> { match self.data_type() { diff --git a/arrow-array/src/array/string_array.rs b/arrow-array/src/array/string_array.rs index c87c797bcf2..c53a436834d 100644 --- a/arrow-array/src/array/string_array.rs +++ b/arrow-array/src/array/string_array.rs @@ -17,18 +17,12 @@ use crate::types::GenericStringType; use crate::{GenericBinaryArray, GenericByteArray, GenericListArray, OffsetSizeTrait}; -use arrow_schema::{ArrowError, DataType}; +use arrow_schema::ArrowError; /// A [`GenericByteArray`] for storing `str` pub type GenericStringArray = GenericByteArray>; impl GenericStringArray { - /// Get the data type of the array. - #[deprecated(since = "20.0.0", note = "please use `Self::DATA_TYPE` instead")] - pub const fn get_data_type() -> DataType { - Self::DATA_TYPE - } - /// Returns the number of `Unicode Scalar Value` in the string at index `i`. /// # Performance /// This function has `O(n)` time complexity where `n` is the string length. diff --git a/arrow-array/src/cast.rs b/arrow-array/src/cast.rs index fd83104a6a4..fc657f94c6a 100644 --- a/arrow-array/src/cast.rs +++ b/arrow-array/src/cast.rs @@ -689,15 +689,6 @@ array_downcast_fn!(as_struct_array, StructArray); array_downcast_fn!(as_union_array, UnionArray); array_downcast_fn!(as_map_array, MapArray); -/// Force downcast of an Array, such as an ArrayRef to Decimal128Array, panic’ing on failure. -#[deprecated( - since = "42.0.0", - note = "please use `as_primitive_array::` instead" -)] -pub fn as_decimal_array(arr: &dyn Array) -> &PrimitiveArray { - as_primitive_array::(arr) -} - /// Downcasts a `dyn Array` to a concrete type /// /// ``` diff --git a/arrow-array/src/types.rs b/arrow-array/src/types.rs index 4e05349cd08..3d8cfcdb112 100644 --- a/arrow-array/src/types.rs +++ b/arrow-array/src/types.rs @@ -324,12 +324,6 @@ pub trait ArrowTimestampType: ArrowTemporalType { /// The [`TimeUnit`] of this timestamp. const UNIT: TimeUnit; - /// Returns the `TimeUnit` of this timestamp. - #[deprecated(since = "36.0.0", note = "Use Self::UNIT")] - fn get_time_unit() -> TimeUnit { - Self::UNIT - } - /// Creates a ArrowTimestampType::Native from the provided [`NaiveDateTime`] /// /// See [`DataType::Timestamp`] for more information on timezone handling diff --git a/arrow-buffer/src/buffer/boolean.rs b/arrow-buffer/src/buffer/boolean.rs index 49b88d1f581..d9d2ea04e35 100644 --- a/arrow-buffer/src/buffer/boolean.rs +++ b/arrow-buffer/src/buffer/boolean.rs @@ -96,17 +96,6 @@ impl BooleanBuffer { BitChunks::new(self.values(), self.offset, self.len) } - /// Returns `true` if the bit at index `i` is set - /// - /// # Panics - /// - /// Panics if `i >= self.len()` - #[inline] - #[deprecated(since = "36.0.0", note = "use BooleanBuffer::value")] - pub fn is_set(&self, i: usize) -> bool { - self.value(i) - } - /// Returns the offset of this [`BooleanBuffer`] in bits #[inline] pub fn offset(&self) -> usize { diff --git a/arrow-buffer/src/buffer/immutable.rs b/arrow-buffer/src/buffer/immutable.rs index c2d4d069c10..10534ccfe32 100644 --- a/arrow-buffer/src/buffer/immutable.rs +++ b/arrow-buffer/src/buffer/immutable.rs @@ -278,14 +278,6 @@ impl Buffer { BitChunks::new(self.as_slice(), offset, len) } - /// Returns the number of 1-bits in this buffer. - #[deprecated(since = "27.0.0", note = "use count_set_bits_offset instead")] - pub fn count_set_bits(&self) -> usize { - let len_in_bits = self.len() * 8; - // self.offset is already taken into consideration by the bit_chunks implementation - self.count_set_bits_offset(0, len_in_bits) - } - /// Returns the number of 1-bits in this buffer, starting from `offset` with `length` bits /// inspected. Note that both `offset` and `length` are measured in bits. pub fn count_set_bits_offset(&self, offset: usize, len: usize) -> usize { diff --git a/arrow-buffer/src/buffer/mutable.rs b/arrow-buffer/src/buffer/mutable.rs index 854ccee4d61..5471bc0e5f6 100644 --- a/arrow-buffer/src/buffer/mutable.rs +++ b/arrow-buffer/src/buffer/mutable.rs @@ -118,13 +118,6 @@ impl MutableBuffer { Self { data, len, layout } } - /// Create a [`MutableBuffer`] from the provided [`Vec`] without copying - #[inline] - #[deprecated(since = "46.0.0", note = "Use From>")] - pub fn from_vec(vec: Vec) -> Self { - Self::from(vec) - } - /// Allocates a new [MutableBuffer] from given `Bytes`. pub(crate) fn from_bytes(bytes: Bytes) -> Result { let layout = match bytes.deallocation() { diff --git a/arrow-buffer/src/native.rs b/arrow-buffer/src/native.rs index fb19903f128..eb8e067db0b 100644 --- a/arrow-buffer/src/native.rs +++ b/arrow-buffer/src/native.rs @@ -88,30 +88,6 @@ pub trait ArrowNativeType: /// Returns `None` if [`Self`] is not an integer or conversion would result /// in truncation/overflow fn to_i64(self) -> Option; - - /// Convert native type from i32. - /// - /// Returns `None` if [`Self`] is not `i32` - #[deprecated(since = "24.0.0", note = "please use `Option::Some` instead")] - fn from_i32(_: i32) -> Option { - None - } - - /// Convert native type from i64. - /// - /// Returns `None` if [`Self`] is not `i64` - #[deprecated(since = "24.0.0", note = "please use `Option::Some` instead")] - fn from_i64(_: i64) -> Option { - None - } - - /// Convert native type from i128. - /// - /// Returns `None` if [`Self`] is not `i128` - #[deprecated(since = "24.0.0", note = "please use `Option::Some` instead")] - fn from_i128(_: i128) -> Option { - None - } } macro_rules! native_integer { @@ -147,23 +123,15 @@ macro_rules! native_integer { fn usize_as(i: usize) -> Self { i as _ } - - - $( - #[inline] - fn $from(v: $t) -> Option { - Some(v) - } - )* } }; } native_integer!(i8); native_integer!(i16); -native_integer!(i32, from_i32); -native_integer!(i64, from_i64); -native_integer!(i128, from_i128); +native_integer!(i32); +native_integer!(i64); +native_integer!(i128); native_integer!(u8); native_integer!(u16); native_integer!(u32); diff --git a/arrow-csv/src/reader/mod.rs b/arrow-csv/src/reader/mod.rs index 7c288d718e2..27f3b84a4a0 100644 --- a/arrow-csv/src/reader/mod.rs +++ b/arrow-csv/src/reader/mod.rs @@ -136,7 +136,7 @@ use lazy_static::lazy_static; use regex::{Regex, RegexSet}; use std::fmt::{self, Debug}; use std::fs::File; -use std::io::{BufRead, BufReader as StdBufReader, Read, Seek, SeekFrom}; +use std::io::{BufRead, BufReader as StdBufReader, Read}; use std::sync::Arc; use crate::map_csv_error; @@ -399,51 +399,6 @@ impl Format { } } -/// Infer the schema of a CSV file by reading through the first n records of the file, -/// with `max_read_records` controlling the maximum number of records to read. -/// -/// If `max_read_records` is not set, the whole file is read to infer its schema. -/// -/// Return inferred schema and number of records used for inference. This function does not change -/// reader cursor offset. -/// -/// The inferred schema will always have each field set as nullable. -#[deprecated(since = "39.0.0", note = "Use Format::infer_schema")] -#[allow(deprecated)] -pub fn infer_file_schema( - mut reader: R, - delimiter: u8, - max_read_records: Option, - has_header: bool, -) -> Result<(Schema, usize), ArrowError> { - let saved_offset = reader.stream_position()?; - let r = infer_reader_schema(&mut reader, delimiter, max_read_records, has_header)?; - // return the reader seek back to the start - reader.seek(SeekFrom::Start(saved_offset))?; - Ok(r) -} - -/// Infer schema of CSV records provided by struct that implements `Read` trait. -/// -/// `max_read_records` controlling the maximum number of records to read. If `max_read_records` is -/// not set, all records are read to infer the schema. -/// -/// Return inferred schema and number of records used for inference. -#[deprecated(since = "39.0.0", note = "Use Format::infer_schema")] -pub fn infer_reader_schema( - reader: R, - delimiter: u8, - max_read_records: Option, - has_header: bool, -) -> Result<(Schema, usize), ArrowError> { - let format = Format { - delimiter: Some(delimiter), - header: has_header, - ..Default::default() - }; - format.infer_schema(reader, max_read_records) -} - /// Infer schema from a list of CSV files by reading through first n records /// with `max_read_records` controlling the maximum number of records to read. /// @@ -1101,14 +1056,6 @@ impl ReaderBuilder { } } - /// Set whether the CSV file has headers - #[deprecated(since = "39.0.0", note = "Use with_header")] - #[doc(hidden)] - pub fn has_header(mut self, has_header: bool) -> Self { - self.format.header = has_header; - self - } - /// Set whether the CSV file has a header pub fn with_header(mut self, has_header: bool) -> Self { self.format.header = has_header; diff --git a/arrow-csv/src/writer.rs b/arrow-csv/src/writer.rs index 6fffe244d20..c5a0a0b76d5 100644 --- a/arrow-csv/src/writer.rs +++ b/arrow-csv/src/writer.rs @@ -256,14 +256,6 @@ impl WriterBuilder { Self::default() } - /// Set whether to write headers - #[deprecated(since = "39.0.0", note = "Use Self::with_header")] - #[doc(hidden)] - pub fn has_headers(mut self, has_headers: bool) -> Self { - self.has_header = has_headers; - self - } - /// Set whether to write the CSV file with a header pub fn with_header(mut self, header: bool) -> Self { self.has_header = header; @@ -397,17 +389,6 @@ impl WriterBuilder { self.null_value.as_deref().unwrap_or(DEFAULT_NULL_VALUE) } - /// Use RFC3339 format for date/time/timestamps (default) - #[deprecated(since = "39.0.0", note = "Use WriterBuilder::default()")] - pub fn with_rfc3339(mut self) -> Self { - self.date_format = None; - self.datetime_format = None; - self.time_format = None; - self.timestamp_format = None; - self.timestamp_tz_format = None; - self - } - /// Create a new `Writer` pub fn build(self, writer: W) -> Writer { let mut builder = csv::WriterBuilder::new(); diff --git a/arrow-data/src/data.rs b/arrow-data/src/data.rs index cbdda9b6929..a35b5e8629e 100644 --- a/arrow-data/src/data.rs +++ b/arrow-data/src/data.rs @@ -30,11 +30,6 @@ use std::sync::Arc; use crate::{equal, validate_binary_view, validate_string_view}; -/// A collection of [`Buffer`] -#[doc(hidden)] -#[deprecated(since = "46.0.0", note = "Use [Buffer]")] -pub type Buffers<'a> = &'a [Buffer]; - #[inline] pub(crate) fn contains_nulls( null_bit_buffer: Option<&NullBuffer>, diff --git a/arrow-json/src/reader/mod.rs b/arrow-json/src/reader/mod.rs index c9013b10fb5..ec824271c10 100644 --- a/arrow-json/src/reader/mod.rs +++ b/arrow-json/src/reader/mod.rs @@ -244,13 +244,6 @@ impl ReaderBuilder { Self { batch_size, ..self } } - /// Sets if the decoder should coerce primitive values (bool and number) into string - /// when the Schema's column is Utf8 or LargeUtf8. - #[deprecated(since = "39.0.0", note = "Use with_coerce_primitive")] - pub fn coerce_primitive(self, coerce_primitive: bool) -> Self { - self.with_coerce_primitive(coerce_primitive) - } - /// Sets if the decoder should coerce primitive values (bool and number) into string /// when the Schema's column is Utf8 or LargeUtf8. pub fn with_coerce_primitive(self, coerce_primitive: bool) -> Self { diff --git a/arrow-ord/src/partition.rs b/arrow-ord/src/partition.rs index 48cd9594129..ec164739323 100644 --- a/arrow-ord/src/partition.rs +++ b/arrow-ord/src/partition.rs @@ -24,7 +24,6 @@ use arrow_buffer::BooleanBuffer; use arrow_schema::ArrowError; use crate::cmp::distinct; -use crate::sort::SortColumn; /// A computed set of partitions, see [`partition`] #[derive(Debug, Clone)] @@ -160,21 +159,6 @@ fn find_boundaries(v: &dyn Array) -> Result { Ok(distinct(&v1, &v2)?.values().clone()) } -/// Use [`partition`] instead. Given a list of already sorted columns, find -/// partition ranges that would partition lexicographically equal values across -/// columns. -/// -/// The returned vec would be of size k where k is cardinality of the sorted values; Consecutive -/// values will be connected: (a, b) and (b, c), where start = 0 and end = n for the first and last -/// range. -#[deprecated(since = "46.0.0", note = "Use partition")] -pub fn lexicographical_partition_ranges( - columns: &[SortColumn], -) -> Result> + '_, ArrowError> { - let cols: Vec<_> = columns.iter().map(|x| x.values.clone()).collect(); - Ok(partition(&cols)?.ranges().into_iter()) -} - #[cfg(test)] mod tests { use std::sync::Arc; diff --git a/object_store/src/memory.rs b/object_store/src/memory.rs index 4584ab7fead..a467e3b88a2 100644 --- a/object_store/src/memory.rs +++ b/object_store/src/memory.rs @@ -468,12 +468,6 @@ impl InMemory { Self { storage } } - /// Creates a clone of the store - #[deprecated(since = "44.0.0", note = "Use fork() instead")] - pub async fn clone(&self) -> Self { - self.fork() - } - async fn entry(&self, location: &Path) -> Result { let storage = self.storage.read(); let value = storage diff --git a/object_store/src/prefix.rs b/object_store/src/prefix.rs index 8e52d1f9885..227887d78fd 100644 --- a/object_store/src/prefix.rs +++ b/object_store/src/prefix.rs @@ -26,10 +26,6 @@ use crate::{ PutOptions, PutPayload, PutResult, Result, }; -#[doc(hidden)] -#[deprecated(since = "36.0.0", note = "Use PrefixStore")] -pub type PrefixObjectStore = PrefixStore; - /// Store wrapper that applies a constant prefix to all paths handled by the store. #[derive(Debug, Clone)] pub struct PrefixStore { diff --git a/parquet/src/column/reader.rs b/parquet/src/column/reader.rs index d95b10f30c3..953dc057d7a 100644 --- a/parquet/src/column/reader.rs +++ b/parquet/src/column/reader.rs @@ -185,31 +185,6 @@ where } } - /// Reads a batch of values of at most `batch_size`, returning a tuple containing the - /// actual number of non-null values read, followed by the corresponding number of levels, - /// i.e, the total number of values including nulls, empty lists, etc... - /// - /// If the max definition level is 0, `def_levels` will be ignored, otherwise it will be - /// populated with the number of levels read, with an error returned if it is `None`. - /// - /// If the max repetition level is 0, `rep_levels` will be ignored, otherwise it will be - /// populated with the number of levels read, with an error returned if it is `None`. - /// - /// `values` will be contiguously populated with the non-null values. Note that if the column - /// is not required, this may be less than either `batch_size` or the number of levels read - #[deprecated(since = "42.0.0", note = "Use read_records")] - pub fn read_batch( - &mut self, - batch_size: usize, - def_levels: Option<&mut D::Buffer>, - rep_levels: Option<&mut R::Buffer>, - values: &mut V::Buffer, - ) -> Result<(usize, usize)> { - let (_, values, levels) = self.read_records(batch_size, def_levels, rep_levels, values)?; - - Ok((values, levels)) - } - /// Read up to `max_records` whole records, returning the number of complete /// records, non-null values and levels decoded. All levels for a given record /// will be read, i.e. the next repetition level, if any, will be 0 diff --git a/parquet/src/file/metadata/mod.rs b/parquet/src/file/metadata/mod.rs index 642706f554f..252cb99f3f3 100644 --- a/parquet/src/file/metadata/mod.rs +++ b/parquet/src/file/metadata/mod.rs @@ -230,12 +230,6 @@ impl ParquetMetaData { &self.row_groups } - /// Returns page indexes in this file. - #[deprecated(since = "39.0.0", note = "Use Self::column_index")] - pub fn page_indexes(&self) -> Option<&ParquetColumnIndex> { - self.column_index.as_ref() - } - /// Returns the column index for this file if loaded /// /// Returns `None` if the parquet file does not have a `ColumnIndex` or @@ -246,12 +240,6 @@ impl ParquetMetaData { self.column_index.as_ref() } - /// Returns the offset index for this file if loaded - #[deprecated(since = "39.0.0", note = "Use Self::offset_index")] - pub fn offset_indexes(&self) -> Option<&ParquetOffsetIndex> { - self.offset_index.as_ref() - } - /// Returns offset indexes in this file, if loaded /// /// Returns `None` if the parquet file does not have a `OffsetIndex` or