This is an automated email from the ASF dual-hosted git repository.
tustvold pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/master by this push:
new 31560a330 Clean up (#2389)
31560a330 is described below
commit 31560a3306920b7c8b0d92fc38e35262f83d5d8a
Author: Liang-Chi Hsieh <[email protected]>
AuthorDate: Tue Aug 9 10:24:21 2022 -0700
Clean up (#2389)
---
arrow/src/array/array_decimal.rs | 10 ++--------
arrow/src/util/decimal.rs | 11 +++++------
2 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/arrow/src/array/array_decimal.rs b/arrow/src/array/array_decimal.rs
index 781ed5f8f..412b74c60 100644
--- a/arrow/src/array/array_decimal.rs
+++ b/arrow/src/array/array_decimal.rs
@@ -75,12 +75,6 @@ pub type Decimal128Array = BasicDecimalArray<16>;
pub type Decimal256Array = BasicDecimalArray<32>;
-mod private_decimal {
- pub trait DecimalArrayPrivate {
- fn raw_value_data_ptr(&self) -> *const u8;
- }
-}
-
pub struct BasicDecimalArray<const BYTE_WIDTH: usize> {
data: ArrayData,
value_data: RawPtrBox<u8>,
@@ -90,10 +84,10 @@ pub struct BasicDecimalArray<const BYTE_WIDTH: usize> {
impl<const BYTE_WIDTH: usize> BasicDecimalArray<BYTE_WIDTH> {
pub const VALUE_LENGTH: i32 = BYTE_WIDTH as i32;
- pub const DEFAULT_TYPE: DataType =
BasicDecimal::<BYTE_WIDTH>::DEFAULT_TYPE;
+ const DEFAULT_TYPE: DataType = BasicDecimal::<BYTE_WIDTH>::DEFAULT_TYPE;
pub const MAX_PRECISION: usize = BasicDecimal::<BYTE_WIDTH>::MAX_PRECISION;
pub const MAX_SCALE: usize = BasicDecimal::<BYTE_WIDTH>::MAX_SCALE;
- pub const TYPE_CONSTRUCTOR: fn(usize, usize) -> DataType =
+ const TYPE_CONSTRUCTOR: fn(usize, usize) -> DataType =
BasicDecimal::<BYTE_WIDTH>::TYPE_CONSTRUCTOR;
pub fn data(&self) -> &ArrayData {
diff --git a/arrow/src/util/decimal.rs b/arrow/src/util/decimal.rs
index 74f3379f4..10bd13f7e 100644
--- a/arrow/src/util/decimal.rs
+++ b/arrow/src/util/decimal.rs
@@ -35,7 +35,7 @@ pub struct BasicDecimal<const BYTE_WIDTH: usize> {
impl<const BYTE_WIDTH: usize> BasicDecimal<BYTE_WIDTH> {
#[allow(clippy::type_complexity)]
- const _MAX_PRECISION_SCALE_CONSTRUCTOR_DEFAULT_TYPE: (
+ const MAX_PRECISION_SCALE_CONSTRUCTOR_DEFAULT_TYPE: (
usize,
usize,
fn(usize, usize) -> DataType,
@@ -56,13 +56,12 @@ impl<const BYTE_WIDTH: usize> BasicDecimal<BYTE_WIDTH> {
_ => panic!("invalid byte width"),
};
- pub const MAX_PRECISION: usize =
- Self::_MAX_PRECISION_SCALE_CONSTRUCTOR_DEFAULT_TYPE.0;
- pub const MAX_SCALE: usize =
Self::_MAX_PRECISION_SCALE_CONSTRUCTOR_DEFAULT_TYPE.1;
+ pub const MAX_PRECISION: usize =
Self::MAX_PRECISION_SCALE_CONSTRUCTOR_DEFAULT_TYPE.0;
+ pub const MAX_SCALE: usize =
Self::MAX_PRECISION_SCALE_CONSTRUCTOR_DEFAULT_TYPE.1;
pub const TYPE_CONSTRUCTOR: fn(usize, usize) -> DataType =
- Self::_MAX_PRECISION_SCALE_CONSTRUCTOR_DEFAULT_TYPE.2;
+ Self::MAX_PRECISION_SCALE_CONSTRUCTOR_DEFAULT_TYPE.2;
pub const DEFAULT_TYPE: DataType =
- Self::_MAX_PRECISION_SCALE_CONSTRUCTOR_DEFAULT_TYPE.3;
+ Self::MAX_PRECISION_SCALE_CONSTRUCTOR_DEFAULT_TYPE.3;
/// Tries to create a decimal value from precision, scale and bytes.
/// If the length of bytes isn't same as the bit width of this decimal,