pub struct ColumnSchema {
pub name: String,
pub data_type: ConcreteDataType,
is_nullable: bool,
is_time_index: bool,
default_constraint: Option<ColumnDefaultConstraint>,
metadata: Metadata,
}
Expand description
Schema of a column, used as an immutable struct.
Fields§
§name: String
§data_type: ConcreteDataType
§is_nullable: bool
§is_time_index: bool
§default_constraint: Option<ColumnDefaultConstraint>
§metadata: Metadata
Implementations§
Source§impl ColumnSchema
impl ColumnSchema
pub fn new<T: Into<String>>( name: T, data_type: ConcreteDataType, is_nullable: bool, ) -> ColumnSchema
pub fn is_time_index(&self) -> bool
pub fn is_nullable(&self) -> bool
pub fn default_constraint(&self) -> Option<&ColumnDefaultConstraint>
Sourcepub fn is_default_impure(&self) -> bool
pub fn is_default_impure(&self) -> bool
Check if the default constraint is a impure function.
pub fn metadata(&self) -> &Metadata
pub fn mut_metadata(&mut self) -> &mut Metadata
Sourcepub fn column_comment(&self) -> Option<&String>
pub fn column_comment(&self) -> Option<&String>
Retrieve the column comment
pub fn with_time_index(self, is_time_index: bool) -> Self
Sourcepub fn set_inverted_index(&mut self, value: bool)
pub fn set_inverted_index(&mut self, value: bool)
Set the inverted index for the column. Similar to with_inverted_index but don’t take the ownership.
Sourcepub fn with_inverted_index(self, value: bool) -> Self
pub fn with_inverted_index(self, value: bool) -> Self
Set the inverted index for the column. Similar to set_inverted_index but take the ownership and return a owned value.
pub fn is_inverted_indexed(&self) -> bool
pub fn is_fulltext_indexed(&self) -> bool
pub fn is_skipping_indexed(&self) -> bool
pub fn has_inverted_index_key(&self) -> bool
Sourcepub fn with_default_constraint(
self,
default_constraint: Option<ColumnDefaultConstraint>,
) -> Result<Self>
pub fn with_default_constraint( self, default_constraint: Option<ColumnDefaultConstraint>, ) -> Result<Self>
Set default constraint.
If a default constraint exists for the column, this method will validate it against the column’s data type and nullability.
Sourcepub fn with_nullable_set(self) -> Self
pub fn with_nullable_set(self) -> Self
Set the nullablity to true
of the column.
Similar to set_nullable but take the ownership and return a owned value.
Sourcepub fn set_nullable(&mut self)
pub fn set_nullable(&mut self)
Set the nullability to true
of the column.
Similar to with_nullable_set but don’t take the ownership
Sourcepub fn set_time_index(&mut self)
pub fn set_time_index(&mut self)
Set the is_time_index
to true
of the column.
Similar to with_time_index but don’t take the ownership.
Sourcepub fn with_metadata(self, metadata: Metadata) -> Self
pub fn with_metadata(self, metadata: Metadata) -> Self
Creates a new ColumnSchema
with given metadata.
Sourcepub fn create_default_vector(
&self,
num_rows: usize,
) -> Result<Option<VectorRef>>
pub fn create_default_vector( &self, num_rows: usize, ) -> Result<Option<VectorRef>>
Creates a vector with default value for this column.
If the column is NOT NULL
but doesn’t has DEFAULT
value supplied, returns Ok(None)
.
Sourcepub fn create_default_vector_for_padding(&self, num_rows: usize) -> VectorRef
pub fn create_default_vector_for_padding(&self, num_rows: usize) -> VectorRef
Creates a vector for padding.
This method always returns a vector since it uses DataType::default_value to fill the vector. Callers should only use the created vector for padding and never read its content.
Sourcepub fn create_default(&self) -> Result<Option<Value>>
pub fn create_default(&self) -> Result<Option<Value>>
Creates a default value for this column.
If the column is NOT NULL
but doesn’t has DEFAULT
value supplied, returns Ok(None)
.
Sourcepub fn create_impure_default(&self) -> Result<Option<Value>>
pub fn create_impure_default(&self) -> Result<Option<Value>>
Creates an impure default value for this column, only if it have a impure default constraint.
Otherwise, returns Ok(None)
.
Sourcepub fn fulltext_options(&self) -> Result<Option<FulltextOptions>>
pub fn fulltext_options(&self) -> Result<Option<FulltextOptions>>
Retrieves the fulltext options for the column.
pub fn with_fulltext_options(self, options: FulltextOptions) -> Result<Self>
pub fn set_fulltext_options(&mut self, options: &FulltextOptions) -> Result<()>
Sourcepub fn skipping_index_options(&self) -> Result<Option<SkippingIndexOptions>>
pub fn skipping_index_options(&self) -> Result<Option<SkippingIndexOptions>>
Retrieves the skipping index options for the column.
pub fn with_skipping_options( self, options: SkippingIndexOptions, ) -> Result<Self>
pub fn set_skipping_options( &mut self, options: &SkippingIndexOptions, ) -> Result<()>
pub fn unset_skipping_options(&mut self) -> Result<()>
Trait Implementations§
Source§impl Clone for ColumnSchema
impl Clone for ColumnSchema
Source§fn clone(&self) -> ColumnSchema
fn clone(&self) -> ColumnSchema
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ColumnSchema
impl Debug for ColumnSchema
Source§impl<'de> Deserialize<'de> for ColumnSchema
impl<'de> Deserialize<'de> for ColumnSchema
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ColumnSchema
impl PartialEq for ColumnSchema
Source§impl Serialize for ColumnSchema
impl Serialize for ColumnSchema
Source§impl TryFrom<&ColumnSchema> for Field
impl TryFrom<&ColumnSchema> for Field
Source§impl TryFrom<&Field> for ColumnSchema
impl TryFrom<&Field> for ColumnSchema
impl Eq for ColumnSchema
impl StructuralPartialEq for ColumnSchema
Auto Trait Implementations§
impl !Freeze for ColumnSchema
impl RefUnwindSafe for ColumnSchema
impl Send for ColumnSchema
impl Sync for ColumnSchema
impl Unpin for ColumnSchema
impl UnwindSafe for ColumnSchema
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
§impl<T, V> Convert<T> for Vwhere
V: Into<T>,
impl<T, V> Convert<T> for Vwhere
V: Into<T>,
fn convert(value: Self) -> T
fn convert_box(value: Box<Self>) -> Box<T>
fn convert_vec(value: Vec<Self>) -> Vec<T>
fn convert_vec_box(value: Vec<Box<Self>>) -> Vec<Box<T>>
fn convert_matrix(value: Vec<Vec<Self>>) -> Vec<Vec<T>>
fn convert_option(value: Option<Self>) -> Option<T>
fn convert_option_box(value: Option<Box<Self>>) -> Option<Box<T>>
fn convert_option_vec(value: Option<Vec<Self>>) -> Option<Vec<T>>
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.