risingwave_pb::catalog

Struct Table

source
pub struct Table {
Show 38 fields pub id: u32, pub schema_id: u32, pub database_id: u32, pub name: String, pub columns: Vec<ColumnCatalog>, pub pk: Vec<ColumnOrder>, pub dependent_relations: Vec<u32>, pub table_type: i32, pub distribution_key: Vec<i32>, pub stream_key: Vec<i32>, pub append_only: bool, pub owner: u32, pub fragment_id: u32, pub vnode_col_index: Option<u32>, pub row_id_index: Option<u32>, pub value_indices: Vec<i32>, pub definition: String, pub handle_pk_conflict_behavior: i32, pub read_prefix_len_hint: u32, pub watermark_indices: Vec<i32>, pub dist_key_in_pk: Vec<i32>, pub dml_fragment_id: Option<u32>, pub cardinality: Option<Cardinality>, pub initialized_at_epoch: Option<u64>, pub created_at_epoch: Option<u64>, pub cleaned_by_watermark: bool, pub stream_job_status: i32, pub create_type: i32, pub description: Option<String>, pub incoming_sinks: Vec<u32>, pub initialized_at_cluster_version: Option<String>, pub created_at_cluster_version: Option<String>, pub retention_seconds: Option<u32>, pub version_column_index: Option<u32>, pub cdc_table_id: Option<String>, pub maybe_vnode_count: Option<u32>, pub version: Option<TableVersion>, pub optional_associated_source_id: Option<OptionalAssociatedSourceId>,
}
Expand description

See TableCatalog struct in frontend crate for more information.

Fields§

§id: u32§schema_id: u32§database_id: u32§name: String§columns: Vec<ColumnCatalog>§pk: Vec<ColumnOrder>§dependent_relations: Vec<u32>

For cdc table created from a cdc source, here records the source id.

TODO(rc): deprecate this by passing dependencies via Request message

§table_type: i32§distribution_key: Vec<i32>§stream_key: Vec<i32>

pk_indices of the corresponding materialize operator’s output.

§append_only: bool§owner: u32§fragment_id: u32§vnode_col_index: Option<u32>

an optional column index which is the vnode of each row computed by the table’s consistent hash distribution

§row_id_index: Option<u32>

An optional column index of row id. If the primary key is specified by users, this will be None.

§value_indices: Vec<i32>

The column indices which are stored in the state store’s value with row-encoding. Currently is not supported yet and expected to be \[0..columns.len()\].

§definition: String§handle_pk_conflict_behavior: i32

Used to control whether handling pk conflict for incoming data.

§read_prefix_len_hint: u32

Anticipated read prefix pattern (number of fields) for the table, which can be utilized for implementing the table’s bloom filter or other storage optimization techniques.

§watermark_indices: Vec<i32>§dist_key_in_pk: Vec<i32>§dml_fragment_id: Option<u32>

A dml fragment id corresponds to the table, used to decide where the dml statement is executed.

§cardinality: Option<Cardinality>

The range of row count of the table. This field is not always present due to backward compatibility. Use Cardinality::unknown in this case.

§initialized_at_epoch: Option<u64>§created_at_epoch: Option<u64>§cleaned_by_watermark: bool

This field is introduced in v1.2.0. It is used to indicate whether the table should use watermark_cache to avoid state cleaning as a performance optimization. In older versions we can just initialize without it.

§stream_job_status: i32

Used to filter created / creating tables in meta.

§create_type: i32§description: Option<String>

This field is used to store the description set by the comment on clause.

§incoming_sinks: Vec<u32>

This field is used to mark the the sink into this table.

§initialized_at_cluster_version: Option<String>

Cluster version (tracked by git commit) when initialized/created

§created_at_cluster_version: Option<String>§retention_seconds: Option<u32>

TTL of the record in the table, to ensure the consistency with other tables in the streaming plan, it only applies to append-only tables.

§version_column_index: Option<u32>

This field specifies the index of the column set in the “with version column” within all the columns. It is used for filtering during “on conflict” operations.

§cdc_table_id: Option<String>

The unique identifier of the upstream table if it is a CDC table. It will be used in auto schema change to get the Table which mapped to the upstream table.

§maybe_vnode_count: Option<u32>

Total vnode count of the table.

Use VnodeCountCompat::vnode_count to access it.

  • Can be unset if the table is created in older versions where variable vnode count is not supported, in which case a default value of 256 (or 1 for singleton) should be used.
  • Can be placeholder value Some(0) if the catalog is generated by the frontend and the corresponding job is still in Creating status, in which case calling vnode_count will panic.

Please note that this field is not intended to describe the expected vnode count for a streaming job. Instead, refer to stream_plan.StreamFragmentGraph.max_parallelism.

§version: Option<TableVersion>

Per-table catalog version, used by schema change. None for internal tables and tests. Not to be confused with the global catalog version for notification service.

§optional_associated_source_id: Option<OptionalAssociatedSourceId>

Implementations§

source§

impl Table

source

pub fn table_type(&self) -> TableType

Returns the enum value of table_type, or the default if the field is set to an invalid enum value.

source

pub fn set_table_type(&mut self, value: TableType)

Sets table_type to the provided enum value.

source

pub fn vnode_col_index(&self) -> u32

Returns the value of vnode_col_index, or the default value if vnode_col_index is unset.

source

pub fn row_id_index(&self) -> u32

Returns the value of row_id_index, or the default value if row_id_index is unset.

source

pub fn handle_pk_conflict_behavior(&self) -> HandleConflictBehavior

Returns the enum value of handle_pk_conflict_behavior, or the default if the field is set to an invalid enum value.

source

pub fn set_handle_pk_conflict_behavior(&mut self, value: HandleConflictBehavior)

Sets handle_pk_conflict_behavior to the provided enum value.

source

pub fn dml_fragment_id(&self) -> u32

Returns the value of dml_fragment_id, or the default value if dml_fragment_id is unset.

source

pub fn initialized_at_epoch(&self) -> u64

Returns the value of initialized_at_epoch, or the default value if initialized_at_epoch is unset.

source

pub fn created_at_epoch(&self) -> u64

Returns the value of created_at_epoch, or the default value if created_at_epoch is unset.

source

pub fn stream_job_status(&self) -> StreamJobStatus

Returns the enum value of stream_job_status, or the default if the field is set to an invalid enum value.

source

pub fn set_stream_job_status(&mut self, value: StreamJobStatus)

Sets stream_job_status to the provided enum value.

source

pub fn create_type(&self) -> CreateType

Returns the enum value of create_type, or the default if the field is set to an invalid enum value.

source

pub fn set_create_type(&mut self, value: CreateType)

Sets create_type to the provided enum value.

source

pub fn description(&self) -> &str

Returns the value of description, or the default value if description is unset.

source

pub fn initialized_at_cluster_version(&self) -> &str

Returns the value of initialized_at_cluster_version, or the default value if initialized_at_cluster_version is unset.

source

pub fn created_at_cluster_version(&self) -> &str

Returns the value of created_at_cluster_version, or the default value if created_at_cluster_version is unset.

source

pub fn retention_seconds(&self) -> u32

Returns the value of retention_seconds, or the default value if retention_seconds is unset.

source

pub fn version_column_index(&self) -> u32

Returns the value of version_column_index, or the default value if version_column_index is unset.

source

pub fn cdc_table_id(&self) -> &str

Returns the value of cdc_table_id, or the default value if cdc_table_id is unset.

source

pub fn maybe_vnode_count(&self) -> u32

Returns the value of maybe_vnode_count, or the default value if maybe_vnode_count is unset.

source§

impl Table

source

pub fn get_id(&self) -> u32

source

pub fn get_schema_id(&self) -> u32

source

pub fn get_database_id(&self) -> u32

source

pub fn get_name(&self) -> &String

source

pub fn get_columns(&self) -> &Vec<ColumnCatalog>

source

pub fn get_pk(&self) -> &Vec<ColumnOrder>

source

pub fn get_dependent_relations(&self) -> &Vec<u32>

source

pub fn get_table_type(&self) -> Result<TableType, PbFieldNotFound>

source

pub fn get_distribution_key(&self) -> &Vec<i32>

source

pub fn get_stream_key(&self) -> &Vec<i32>

source

pub fn get_append_only(&self) -> bool

source

pub fn get_owner(&self) -> u32

source

pub fn get_fragment_id(&self) -> u32

source

pub fn get_vnode_col_index(&self) -> Result<&u32, PbFieldNotFound>

source

pub fn get_row_id_index(&self) -> Result<&u32, PbFieldNotFound>

source

pub fn get_value_indices(&self) -> &Vec<i32>

source

pub fn get_definition(&self) -> &String

source

pub fn get_handle_pk_conflict_behavior( &self, ) -> Result<HandleConflictBehavior, PbFieldNotFound>

source

pub fn get_read_prefix_len_hint(&self) -> u32

source

pub fn get_watermark_indices(&self) -> &Vec<i32>

source

pub fn get_dist_key_in_pk(&self) -> &Vec<i32>

source

pub fn get_dml_fragment_id(&self) -> Result<&u32, PbFieldNotFound>

source

pub fn get_cardinality(&self) -> Result<&Cardinality, PbFieldNotFound>

source

pub fn get_initialized_at_epoch(&self) -> Result<&u64, PbFieldNotFound>

source

pub fn get_created_at_epoch(&self) -> Result<&u64, PbFieldNotFound>

source

pub fn get_cleaned_by_watermark(&self) -> bool

source

pub fn get_stream_job_status(&self) -> Result<StreamJobStatus, PbFieldNotFound>

source

pub fn get_create_type(&self) -> Result<CreateType, PbFieldNotFound>

source

pub fn get_description(&self) -> Result<&String, PbFieldNotFound>

source

pub fn get_incoming_sinks(&self) -> &Vec<u32>

source

pub fn get_initialized_at_cluster_version( &self, ) -> Result<&String, PbFieldNotFound>

source

pub fn get_created_at_cluster_version(&self) -> Result<&String, PbFieldNotFound>

source

pub fn get_retention_seconds(&self) -> Result<&u32, PbFieldNotFound>

source

pub fn get_version_column_index(&self) -> Result<&u32, PbFieldNotFound>

source

pub fn get_cdc_table_id(&self) -> Result<&String, PbFieldNotFound>

source

pub fn get_maybe_vnode_count(&self) -> Result<&u32, PbFieldNotFound>

source

pub fn get_version(&self) -> Result<&TableVersion, PbFieldNotFound>

source

pub fn get_optional_associated_source_id( &self, ) -> Result<&OptionalAssociatedSourceId, PbFieldNotFound>

Trait Implementations§

source§

impl Clone for Table

source§

fn clone(&self) -> Table

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Table

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for Table

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Table

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Message for Table

source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
source§

impl PartialEq for Table

source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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.
source§

impl Serialize for Table

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for Table

Auto Trait Implementations§

§

impl Freeze for Table

§

impl RefUnwindSafe for Table

§

impl Send for Table

§

impl Sync for Table

§

impl Unpin for Table

§

impl UnwindSafe for Table

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,