> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Column

> Column — Kinetica Rust API

[gpudb\_api](https://docs.kinetica.com/content/api/rust/index.md)::<wbr />[generic\_record](https://docs.kinetica.com/content/api/rust/generic_record/index.md)
[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L319-L326)&#x20;

<pre>`pub struct Column { /* private fields */ }`</pre>

Immutable metadata about a column in a Kinetica type.

## Implementations

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L328-L519)
impl [Column](https://docs.kinetica.com/content/api/rust/generic_record/struct.Column.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L330)
pub const [DEFAULT\_DECIMAL\_PRECISION](#associatedconstant.DEFAULT_DECIMAL_PRECISION): [i32](https://doc.rust-lang.org/1.98.1/std/primitive.i32.html) = 18

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L332)
pub const [DEFAULT\_DECIMAL\_SCALE](#associatedconstant.DEFAULT_DECIMAL_SCALE): [i32](https://doc.rust-lang.org/1.98.1/std/primitive.i32.html) = 4

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L334)
pub const [DEFAULT\_DECIMAL\_MIN](#associatedconstant.DEFAULT_DECIMAL_MIN): &'static [str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html) = "-922337203685477.5808"

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L336)
pub const [DEFAULT\_DECIMAL\_MAX](#associatedconstant.DEFAULT_DECIMAL_MAX): &'static [str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html) = "922337203685477.5807"

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L338)
pub const [DECIMAL8\_MAX\_PRECISION](#associatedconstant.DECIMAL8_MAX_PRECISION): [i32](https://doc.rust-lang.org/1.98.1/std/primitive.i32.html) = 18

The widest decimal held in eight bytes.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L345-L347)
pub fn [new](#method.new)(name: impl [Into](https://doc.rust-lang.org/1.98.1/core/convert/trait.Into.html)\<[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html)>, column\_type: [ColumnType](https://docs.kinetica.com/content/api/rust/generic_record/enum.ColumnType.md)) -> Self

Create a new column with the given name and type.A sub-type’s property is added (see [`ColumnType::property`](https://docs.kinetica.com/content/api/rust/generic_record/enum.ColumnType#method.property)), so a `Timestamp` column has the `timestamp` property, and is registered as one. See [`Self::with_properties`](https://docs.kinetica.com/content/api/rust/generic_record/struct.Column#method.with_properties).

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L359-L377)
pub fn [with\_properties](#method.with_properties)( name: impl [Into](https://doc.rust-lang.org/1.98.1/core/convert/trait.Into.html)\<[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html)>, column\_type: [ColumnType](https://docs.kinetica.com/content/api/rust/generic_record/enum.ColumnType.md), properties: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html)>, ) -> 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`](https://docs.kinetica.com/content/api/rust/generic_record/enum.ColumnType#method.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`](https://docs.kinetica.com/content/api/rust/generic_record/struct.Type#method.new) instead.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L381-L386)
pub fn [from\_base\_type](#method.from_base_type)( name: impl [Into](https://doc.rust-lang.org/1.98.1/core/convert/trait.Into.html)\<[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html)>, base\_type: [ColumnBaseType](https://docs.kinetica.com/content/api/rust/generic_record/enum.ColumnBaseType.md), properties: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html)>, ) -> Self

A column of the given base (Avro) type and properties, its type resolved from both.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L389-L391)
pub fn [decimal\_precision](#method.decimal_precision)(\&self) -> [i32](https://doc.rust-lang.org/1.98.1/std/primitive.i32.html)

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L394-L396)
pub fn [decimal\_scale](#method.decimal_scale)(\&self) -> [i32](https://doc.rust-lang.org/1.98.1/std/primitive.i32.html)

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L399-L401)
pub fn [is\_decimal](#method.is_decimal)(\&self) -> [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html)

Whether this is a decimal column.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L405-L409)
pub fn [has\_default](#method.has_default)(\&self) -> [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html)

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L414-L426)
pub fn [default\_value](#method.default_value)(\&self) -> [Option](https://doc.rust-lang.org/1.98.1/core/option/enum.Option.html)\<[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html)>

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](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L429-L431)
pub fn [is\_array](#method.is_array)(\&self) -> [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html)

Whether a property starts `array`.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L438-L461)
pub fn [array\_type](#method.array_type)(\&self) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[Option](https://doc.rust-lang.org/1.98.1/core/option/enum.Option.html)\<[ColumnType](https://docs.kinetica.com/content/api/rust/generic_record/enum.ColumnType.md)>, [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

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](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L464-L466)
pub fn [is\_vector](#method.is_vector)(\&self) -> [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html)

Whether a property starts `vector`.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L470-L478)
pub fn [vector\_dimensions](#method.vector_dimensions)(\&self) -> [i32](https://doc.rust-lang.org/1.98.1/std/primitive.i32.html)

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L481-L483)
pub fn [has\_property](#method.has_property)(\&self, property: &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html)) -> [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html)

Whether the column has exactly this property.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L486-L488)
pub fn [name](#method.name)(\&self) -> &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html)

Get the column name.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L491-L493)
pub fn [column\_type](#method.column_type)(\&self) -> [ColumnType](https://docs.kinetica.com/content/api/rust/generic_record/enum.ColumnType.md)

Get the column type.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L496-L498)
pub fn [base\_type](#method.base_type)(\&self) -> [ColumnBaseType](https://docs.kinetica.com/content/api/rust/generic_record/enum.ColumnBaseType.md)

Get the base type.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L501-L503)
pub fn [properties](#method.properties)(\&self) -> &\[[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html)]

Get the column properties.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L506-L508)
pub fn [is\_nullable](#method.is_nullable)(\&self) -> [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html)

Check if this column is nullable.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L511-L513)
pub fn [is\_primary\_key](#method.is_primary_key)(\&self) -> [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html)

Check if this column is a primary key.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L516-L518)
pub fn [is\_shard\_key](#method.is_shard_key)(\&self) -> [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html)

Check if this column is a shard key.

## Trait Implementations

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L318)
impl [Clone](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html) for [Column](https://docs.kinetica.com/content/api/rust/generic_record/struct.Column.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L318)
fn [clone](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html#tymethod.clone)(\&self) -> [Column](https://docs.kinetica.com/content/api/rust/generic_record/struct.Column.md)

Returns a duplicate of the value. [Read more](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html#tymethod.clone)

1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/142757)) · [Source](https://doc.rust-lang.org/1.98.1/src/core/clone.rs.html#245-247)
fn [clone\_from](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html#method.clone_from)(\&mut self, source: \&Self)

Performs copy-assignment from `source`. [Read more](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html#method.clone_from)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L318)
impl [Debug](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Debug.html) for [Column](https://docs.kinetica.com/content/api/rust/generic_record/struct.Column.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L318)
fn [fmt](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Debug.html#tymethod.fmt)(\&self, f: \&mut [Formatter](https://doc.rust-lang.org/1.98.1/core/fmt/struct.Formatter.html)\<'\_>) -> [Result](https://doc.rust-lang.org/1.98.1/core/fmt/type.Result.html)

Formats the value using the given formatter. [Read more](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Debug.html#tymethod.fmt)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L583-L601)
impl [Display](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Display.html) for [Column](https://docs.kinetica.com/content/api/rust/generic_record/struct.Column.md)

`{"name":..,"type":"Integer","properties":[..]}`, the type named by its [`ColumnBaseType`](https://docs.kinetica.com/content/api/rust/generic_record/enum.ColumnBaseType).

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L584-L600)
fn [fmt](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Display.html#tymethod.fmt)(\&self, f: \&mut [Formatter](https://doc.rust-lang.org/1.98.1/core/fmt/struct.Formatter.html)\<'\_>) -> [Result](https://doc.rust-lang.org/1.98.1/core/fmt/type.Result.html)

Formats the value using the given formatter. [Read more](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Display.html#tymethod.fmt)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L571)
impl [Eq](https://doc.rust-lang.org/1.98.1/core/cmp/trait.Eq.html) for [Column](https://docs.kinetica.com/content/api/rust/generic_record/struct.Column.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L573-L579)
impl [Hash](https://doc.rust-lang.org/1.98.1/core/hash/trait.Hash.html) for [Column](https://docs.kinetica.com/content/api/rust/generic_record/struct.Column.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L574-L578)
fn [hash](https://doc.rust-lang.org/1.98.1/core/hash/trait.Hash.html#tymethod.hash)\<H: [Hasher](https://doc.rust-lang.org/1.98.1/core/hash/trait.Hasher.html)>(\&self, state: [\&mut H](https://doc.rust-lang.org/1.98.1/std/primitive.reference.html))

Feeds this value into the given [`Hasher`](https://doc.rust-lang.org/1.98.1/core/hash/trait.Hasher.html). [Read more](https://doc.rust-lang.org/1.98.1/core/hash/trait.Hash.html#tymethod.hash)

1.3.0 · [Source](https://doc.rust-lang.org/1.98.1/src/core/hash/mod.rs.html#234-236)

#### fn [hash\_slice](https://doc.rust-lang.org/1.98.1/core/hash/trait.Hash.html#method.hash_slice)\<H>(data: &\[Self], state: [\&mut H](https://doc.rust-lang.org/1.98.1/std/primitive.reference.html))&#xA;where H: [Hasher](https://doc.rust-lang.org/1.98.1/core/hash/trait.Hasher.html), Self: [Sized](https://doc.rust-lang.org/1.98.1/core/marker/trait.Sized.html),

Feeds a slice of this type into the given [`Hasher`](https://doc.rust-lang.org/1.98.1/core/hash/trait.Hasher.html). [Read more](https://doc.rust-lang.org/1.98.1/core/hash/trait.Hash.html#method.hash_slice)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L565-L569)
impl [PartialEq](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialEq.html) for [Column](https://docs.kinetica.com/content/api/rust/generic_record/struct.Column.md)

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generic_record.rs#L566-L568)
fn [eq](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialEq.html#tymethod.eq)(\&self, other: \&Self) -> [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html)

Tests for `self` and `other` values to be equal, and is used by `==`.

1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/143800)) · [Source](https://doc.rust-lang.org/1.98.1/src/core/cmp.rs.html#263)
fn [ne](https://doc.rust-lang.org/1.98.1/core/cmp/trait.PartialEq.html#method.ne)(\&self, other: [\&Rhs](https://doc.rust-lang.org/1.98.1/std/primitive.reference.html)) -> [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html)

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.