Enum parquet::data_type::Decimal [−][src]
pub enum Decimal { Int32 { value: [u8; 4], precision: i32, scale: i32, }, Int64 { value: [u8; 8], precision: i32, scale: i32, }, Bytes { value: ByteArray, precision: i32, scale: i32, }, }
Rust representation for Decimal values.
This is not a representation of Parquet physical type, but rather a wrapper for DECIMAL logical type, and serves as container for raw parts of decimal values: unscaled value in bytes, precision and scale.
Variants
Int32
Decimal backed by i32
.
Fields of Int32
value: [u8; 4] | |
precision: i32 | |
scale: i32 |
Int64
Decimal backed by i64
.
Fields of Int64
value: [u8; 8] | |
precision: i32 | |
scale: i32 |
Bytes
Decimal backed by byte array.
Fields of Bytes
value: ByteArray | |
precision: i32 | |
scale: i32 |
Methods
impl Decimal
[src]
impl Decimal
pub fn from_i32(value: i32, precision: i32, scale: i32) -> Self
[src]
pub fn from_i32(value: i32, precision: i32, scale: i32) -> Self
Creates new decimal value from i32
.
pub fn from_i64(value: i64, precision: i32, scale: i32) -> Self
[src]
pub fn from_i64(value: i64, precision: i32, scale: i32) -> Self
Creates new decimal value from i64
.
pub fn from_bytes(value: ByteArray, precision: i32, scale: i32) -> Self
[src]
pub fn from_bytes(value: ByteArray, precision: i32, scale: i32) -> Self
Creates new decimal value from ByteArray
.
pub fn data(&self) -> &[u8]
[src]
pub fn data(&self) -> &[u8]
Returns bytes of unscaled value.
pub fn precision(&self) -> i32
[src]
pub fn precision(&self) -> i32
Returns decimal precision.
pub fn scale(&self) -> i32
[src]
pub fn scale(&self) -> i32
Returns decimal scale.
Trait Implementations
impl Clone for Decimal
[src]
impl Clone for Decimal
fn clone(&self) -> Decimal
[src]
fn clone(&self) -> Decimal
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Decimal
[src]
impl Debug for Decimal
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for Decimal
[src]
impl Default for Decimal
impl PartialEq for Decimal
[src]
impl PartialEq for Decimal
fn eq(&self, other: &Decimal) -> bool
[src]
fn eq(&self, other: &Decimal) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl AsBytes for Decimal
[src]
impl AsBytes for Decimal