Skip to main content
pub struct Column  /* private fields */ 

Immutable metadata about a column in a Kinetica type.

Implementations

A decimal column’s precision where its property gives none.

A decimal column’s scale where its property gives none.

Source

pub const DEFAULT_DECIMAL_MIN: &‘static str = “-922337203685477.5808”

The least default decimal, i64::MIN at scale 4, as text.

Source

pub const DEFAULT_DECIMAL_MAX: &‘static str = “922337203685477.5807”

The greatest default decimal, i64::MAX at scale 4, as text.

The widest decimal held in eight bytes.

Source

pub fn new(name: impl Into<String>, column_type: ColumnType) -> Self

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.

Source

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.

Source

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.

The precision of a decimal column. 0 for a column of another type.

Source

pub fn decimal_scale(&self) -> i32

The scale of a decimal column. 0 for a column of another type.

Source

pub fn is_decimal(&self) -> bool

Whether this is a decimal column.

Source

pub fn has_default(&self) -> bool

Whether the column has a default: a default(…) property, init_with_now or init_with_uuid.

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.

Source

pub fn is_array(&self) -> bool

Whether a property starts array.

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>”.

Source

pub fn is_vector(&self) -> bool

Whether a property starts vector.

The dimensions of a vector column, from its first vector(N) property. -1 without one, and for dimensions that are not a number.

Source

pub fn has_property(&self, property: &str) -> bool

Whether the column has exactly this property.

Source

pub fn name(&self) -> &str

Get the column name.

Get the column type.

Get the base type.

Source

pub fn properties(&self) -> &[String]

Get the column properties.

Source

pub fn is_nullable(&self) -> bool

Check if this column is nullable.

Source

pub fn is_primary_key(&self) -> bool

Check if this column is a primary key.

Source

pub fn is_shard_key(&self) -> bool

Check if this column is a shard key.

Trait Implementations

Source

fn clone(&self) -> Column

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source

fn fmt(&self, f: &mut Formatter<’_>) -> Result

Formats the value using the given formatter. Read more
Source

impl Display for Column

”name”:..,“type”:“Integer”,“properties”:[..], the type named by its ColumnBaseType.

Source

fn fmt(&self, f: &mut Formatter<’_>) -> Result

Formats the value using the given formatter. Read more
Source

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source

impl PartialEq for Column

The same name, Avro type and properties, in order.

Source

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.