pub struct Column /* private fields */ Immutable metadata about a column in a Kinetica type.
Implementations
pub const DEFAULT_DECIMAL_PRECISION: i32 = 18
A decimal column’s precision where its property gives none.
pub const DEFAULT_DECIMAL_SCALE: i32 = 4
A decimal column’s scale where its property gives none.
pub const DEFAULT_DECIMAL_MIN: &‘static str = “-922337203685477.5808”
The least default decimal, i64::MIN at scale 4, as text.
pub const DEFAULT_DECIMAL_MAX: &‘static str = “922337203685477.5807”
The greatest default decimal, i64::MAX at scale 4, as text.
pub const DECIMAL8_MAX_PRECISION: i32 = 18
The widest decimal held in eight bytes.
Create a new column with the given name and type.
A sub-type’s property is added (see ColumnType::property), so a Timestamp column has the timestamp property, and is registered as one. See Self::with_properties.
pub fn with_properties( name: impl Into<String>, column_type: ColumnType, properties: Vec<String>, ) -> Self
Create a column with properties.
The column’s type is resolved from its base type and properties, so the properties decide: a string column with the date property is a date. A sub-type column_type that they do not already make has its property added first (see ColumnType::property). An array or vector type, which no single property makes, is kept as given.
This cannot fail, so an empty name or property is refused by Type::new instead.
pub fn from_base_type( name: impl Into<String>, base_type: ColumnBaseType, properties: Vec<String>, ) -> Self
A column of the given base (Avro) type and properties, its type resolved from both.
pub fn decimal_precision(&self) -> i32
The precision of a decimal column. 0 for a column of another type.
pub fn decimal_scale(&self) -> i32
The scale of a decimal column. 0 for a column of another type.
pub fn is_decimal(&self) -> bool
Whether this is a decimal column.
pub fn has_default(&self) -> bool
Whether the column has a default: a default(…) property, init_with_now or init_with_uuid.
pub fn default_value(&self) -> Option<String>
The column’s default: the text of its first default(…), NOW() for init_with_now, or NEW_UUID() for init_with_uuid; None without one.
pub fn array_type(&self) -> Result<Option<ColumnType>, KineticaError>
The element type of an array column, read from the first array(…) property: int… an integer, bool… a boolean, and long, float, double, string, ulong or bytes themselves. None for a column with no such property; any other element type fails with “Unknown array type: <type>”.
pub fn vector_dimensions(&self) -> i32
The dimensions of a vector column, from its first vector(N) property. -1 without one, and for dimensions that are not a number.
pub fn has_property(&self, property: &str) -> bool
Whether the column has exactly this property.
pub fn column_type(&self) -> ColumnType
Get the column type.
pub fn base_type(&self) -> ColumnBaseType
Get the base type.
pub fn properties(&self) -> &[String]
Get the column properties.
pub fn is_nullable(&self) -> bool
Check if this column is nullable.
pub fn is_primary_key(&self) -> bool
Check if this column is a primary key.
pub fn is_shard_key(&self) -> bool
Check if this column is a shard key.
Trait Implementations
impl Display for Column
”name”:..,“type”:“Integer”,“properties”:[..], the type named by its ColumnBaseType.