Trait arrow::array::BasicDecimalArray
source · [−]pub trait BasicDecimalArray<T: BasicDecimal, U: From<ArrayData>>: DecimalArrayPrivate {
const VALUE_LENGTH: i32;
fn data(&self) -> &ArrayData;
fn precision(&self) -> usize;
fn scale(&self) -> usize;
fn value(&self, i: usize) -> T { ... }
fn value_offset(&self, i: usize) -> i32 { ... }
fn value_length(&self) -> i32 { ... }
fn value_data(&self) -> Buffer { ... }
fn value_offset_at(&self, i: usize) -> i32 { ... }
fn value_as_string(&self, row: usize) -> String { ... }
fn from_fixed_size_binary_array(
v: FixedSizeBinaryArray,
precision: usize,
scale: usize
) -> U { ... }
fn from_fixed_size_list_array(
v: FixedSizeListArray,
precision: usize,
scale: usize
) -> U { ... }
}
Required Associated Constants
const VALUE_LENGTH: i32
Required Methods
Return the precision (total digits) that can be stored by this array
Provided Methods
fn value_offset(&self, i: usize) -> i32
fn value_offset(&self, i: usize) -> i32
Returns the offset for the element at index i
.
Note this doesn’t do any bound checking, for performance reason.
fn value_length(&self) -> i32
fn value_length(&self) -> i32
Returns the length for an element.
All elements have the same length as the array is a fixed size.
fn value_data(&self) -> Buffer
fn value_data(&self) -> Buffer
Returns a clone of the value data buffer
fn value_offset_at(&self, i: usize) -> i32
fn value_as_string(&self, row: usize) -> String
fn from_fixed_size_binary_array(
v: FixedSizeBinaryArray,
precision: usize,
scale: usize
) -> U
fn from_fixed_size_binary_array(
v: FixedSizeBinaryArray,
precision: usize,
scale: usize
) -> U
Build a decimal array from FixedSizeBinaryArray
.
NB: This function does not validate that each value is in the permissible range for a decimal
fn from_fixed_size_list_array(
v: FixedSizeListArray,
precision: usize,
scale: usize
) -> U
fn from_fixed_size_list_array(
v: FixedSizeListArray,
precision: usize,
scale: usize
) -> U
👎 Deprecated:
please use from_fixed_size_binary_array
instead
Build a decimal array from FixedSizeListArray
.
NB: This function does not validate that each value is in the permissible range for a decimal. And, the null buffer of the child array will be ignored.