From ef4f44f1c996de1d06a2250e8ec22c9e9f88004a Mon Sep 17 00:00:00 2001 From: RinChanNOWWW Date: Sun, 14 Apr 2024 09:33:03 +0800 Subject: [PATCH] Deprecate `ArrowPrimitiveType::get_byte_width`. --- arrow-array/src/types.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arrow-array/src/types.rs b/arrow-array/src/types.rs index 3ade1405d7bc..038b2a291f58 100644 --- a/arrow-array/src/types.rs +++ b/arrow-array/src/types.rs @@ -58,6 +58,12 @@ pub trait ArrowPrimitiveType: primitive::PrimitiveTypeSealed + 'static { /// the corresponding Arrow data type of this primitive type. const DATA_TYPE: DataType; + /// Returns the byte width of this primitive type. + #[deprecated(note = "Use ArrowNativeType::get_byte_width")] + fn get_byte_width() -> usize { + std::mem::size_of::() + } + /// Returns a default value of this primitive type. /// /// This is useful for aggregate array ops like `sum()`, `mean()`.