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 inCreating
status, in which case callingvnode_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
impl Table
sourcepub fn table_type(&self) -> TableType
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.
sourcepub fn set_table_type(&mut self, value: TableType)
pub fn set_table_type(&mut self, value: TableType)
Sets table_type
to the provided enum value.
sourcepub fn vnode_col_index(&self) -> u32
pub fn vnode_col_index(&self) -> u32
Returns the value of vnode_col_index
, or the default value if vnode_col_index
is unset.
sourcepub fn row_id_index(&self) -> u32
pub fn row_id_index(&self) -> u32
Returns the value of row_id_index
, or the default value if row_id_index
is unset.
sourcepub fn handle_pk_conflict_behavior(&self) -> HandleConflictBehavior
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.
sourcepub fn set_handle_pk_conflict_behavior(&mut self, value: HandleConflictBehavior)
pub fn set_handle_pk_conflict_behavior(&mut self, value: HandleConflictBehavior)
Sets handle_pk_conflict_behavior
to the provided enum value.
sourcepub fn dml_fragment_id(&self) -> u32
pub fn dml_fragment_id(&self) -> u32
Returns the value of dml_fragment_id
, or the default value if dml_fragment_id
is unset.
sourcepub fn initialized_at_epoch(&self) -> u64
pub fn initialized_at_epoch(&self) -> u64
Returns the value of initialized_at_epoch
, or the default value if initialized_at_epoch
is unset.
sourcepub fn created_at_epoch(&self) -> u64
pub fn created_at_epoch(&self) -> u64
Returns the value of created_at_epoch
, or the default value if created_at_epoch
is unset.
sourcepub fn stream_job_status(&self) -> StreamJobStatus
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.
sourcepub fn set_stream_job_status(&mut self, value: StreamJobStatus)
pub fn set_stream_job_status(&mut self, value: StreamJobStatus)
Sets stream_job_status
to the provided enum value.
sourcepub fn create_type(&self) -> CreateType
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.
sourcepub fn set_create_type(&mut self, value: CreateType)
pub fn set_create_type(&mut self, value: CreateType)
Sets create_type
to the provided enum value.
sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Returns the value of description
, or the default value if description
is unset.
sourcepub fn initialized_at_cluster_version(&self) -> &str
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.
sourcepub fn created_at_cluster_version(&self) -> &str
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.
sourcepub fn retention_seconds(&self) -> u32
pub fn retention_seconds(&self) -> u32
Returns the value of retention_seconds
, or the default value if retention_seconds
is unset.
sourcepub fn version_column_index(&self) -> u32
pub fn version_column_index(&self) -> u32
Returns the value of version_column_index
, or the default value if version_column_index
is unset.
sourcepub fn cdc_table_id(&self) -> &str
pub fn cdc_table_id(&self) -> &str
Returns the value of cdc_table_id
, or the default value if cdc_table_id
is unset.
sourcepub fn maybe_vnode_count(&self) -> u32
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
impl Table
pub fn get_id(&self) -> u32
pub fn get_schema_id(&self) -> u32
pub fn get_database_id(&self) -> u32
pub fn get_name(&self) -> &String
pub fn get_columns(&self) -> &Vec<ColumnCatalog>
pub fn get_pk(&self) -> &Vec<ColumnOrder>
pub fn get_dependent_relations(&self) -> &Vec<u32>
pub fn get_table_type(&self) -> Result<TableType, PbFieldNotFound>
pub fn get_distribution_key(&self) -> &Vec<i32>
pub fn get_stream_key(&self) -> &Vec<i32>
pub fn get_append_only(&self) -> bool
pub fn get_owner(&self) -> u32
pub fn get_fragment_id(&self) -> u32
pub fn get_vnode_col_index(&self) -> Result<&u32, PbFieldNotFound>
pub fn get_row_id_index(&self) -> Result<&u32, PbFieldNotFound>
pub fn get_value_indices(&self) -> &Vec<i32>
pub fn get_definition(&self) -> &String
pub fn get_handle_pk_conflict_behavior( &self, ) -> Result<HandleConflictBehavior, PbFieldNotFound>
pub fn get_read_prefix_len_hint(&self) -> u32
pub fn get_watermark_indices(&self) -> &Vec<i32>
pub fn get_dist_key_in_pk(&self) -> &Vec<i32>
pub fn get_dml_fragment_id(&self) -> Result<&u32, PbFieldNotFound>
pub fn get_cardinality(&self) -> Result<&Cardinality, PbFieldNotFound>
pub fn get_initialized_at_epoch(&self) -> Result<&u64, PbFieldNotFound>
pub fn get_created_at_epoch(&self) -> Result<&u64, PbFieldNotFound>
pub fn get_cleaned_by_watermark(&self) -> bool
pub fn get_stream_job_status(&self) -> Result<StreamJobStatus, PbFieldNotFound>
pub fn get_create_type(&self) -> Result<CreateType, PbFieldNotFound>
pub fn get_description(&self) -> Result<&String, PbFieldNotFound>
pub fn get_incoming_sinks(&self) -> &Vec<u32>
pub fn get_initialized_at_cluster_version( &self, ) -> Result<&String, PbFieldNotFound>
pub fn get_created_at_cluster_version(&self) -> Result<&String, PbFieldNotFound>
pub fn get_retention_seconds(&self) -> Result<&u32, PbFieldNotFound>
pub fn get_version_column_index(&self) -> Result<&u32, PbFieldNotFound>
pub fn get_cdc_table_id(&self) -> Result<&String, PbFieldNotFound>
pub fn get_maybe_vnode_count(&self) -> Result<&u32, PbFieldNotFound>
pub fn get_version(&self) -> Result<&TableVersion, PbFieldNotFound>
pub fn get_optional_associated_source_id( &self, ) -> Result<&OptionalAssociatedSourceId, PbFieldNotFound>
Trait Implementations§
source§impl<'de> Deserialize<'de> for Table
impl<'de> Deserialize<'de> for Table
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 Message for Table
impl Message for Table
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.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> 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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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> 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