Enum iceberg_rust::spec::values::Value
source · pub enum Value {
Show 17 variants
Boolean(bool),
Int(i32),
LongInt(i64),
Float(OrderedFloat<f32>),
Double(OrderedFloat<f64>),
Date(i32),
Time(i64),
Timestamp(i64),
TimestampTZ(i64),
String(String),
UUID(Uuid),
Fixed(usize, Vec<u8>),
Binary(Vec<u8>),
Decimal(Decimal),
Struct(Struct),
List(Vec<Option<Value>>),
Map(BTreeMap<Value, Option<Value>>),
}
Expand description
Values present in iceberg type
Variants§
Boolean(bool)
0x00 for false, non-zero byte for true
Int(i32)
Stored as 4-byte little-endian
LongInt(i64)
Stored as 8-byte little-endian
Float(OrderedFloat<f32>)
Stored as 4-byte little-endian
Double(OrderedFloat<f64>)
Stored as 8-byte little-endian
Date(i32)
Stores days from the 1970-01-01 in an 4-byte little-endian int
Time(i64)
Stores microseconds from midnight in an 8-byte little-endian long
Timestamp(i64)
Stores microseconds from 1970-01-01 00:00:00.000000 in an 8-byte little-endian long
TimestampTZ(i64)
Stores microseconds from 1970-01-01 00:00:00.000000 in an 8-byte little-endian long
String(String)
UTF-8 bytes (without length)
UUID(Uuid)
16-byte big-endian value
Fixed(usize, Vec<u8>)
Binary value
Binary(Vec<u8>)
Binary value (without length)
Decimal(Decimal)
Stores unscaled value as two’s-complement big-endian binary, using the minimum number of bytes for the value
Struct(Struct)
A struct is a tuple of typed values. Each field in the tuple is named and has an integer id that is unique in the table schema. Each field can be either optional or required, meaning that values can (or cannot) be null. Fields may be any type. Fields may have an optional comment or doc string. Fields can have default values.
List(Vec<Option<Value>>)
A list is a collection of values with some element type. The element field has an integer id that is unique in the table schema. Elements can be either optional or required. Element types may be any type.
Map(BTreeMap<Value, Option<Value>>)
A map is a collection of key-value pairs with a key type and a value type. Both the key field and value field each have an integer id that is unique in the table schema. Map keys are required and map values can be either optional or required. Both map keys and map values may be any type, including nested types.
Implementations§
source§impl Value
impl Value
sourcepub fn tranform(&self, transform: &Transform) -> Result<Value, Error>
pub fn tranform(&self, transform: &Transform) -> Result<Value, Error>
Perform a partition transformation for the given value
sourcepub fn try_from_bytes(bytes: &[u8], data_type: &Type) -> Result<Value, Error>
pub fn try_from_bytes(bytes: &[u8], data_type: &Type) -> Result<Value, Error>
Create iceberg value from bytes
Trait Implementations§
source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Value, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Value, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl Ord for Value
impl Ord for Value
source§impl PartialEq for Value
impl PartialEq for Value
source§impl PartialOrd for Value
impl PartialOrd for Value
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for Value
impl Serialize for Value
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.