Trait mz_storage_types::sources::SourceConnection
source · pub trait SourceConnection: Debug + Clone + PartialEq + AlterCompatible {
// Required methods
fn name(&self) -> &'static str;
fn upstream_name(&self) -> Option<&str>;
fn key_desc(&self) -> RelationDesc;
fn value_desc(&self) -> RelationDesc;
fn timestamp_desc(&self) -> RelationDesc;
fn connection_id(&self) -> Option<GlobalId>;
fn metadata_columns(&self) -> Vec<(&str, ColumnType)>;
fn output_idx_for_name(&self, name: &UnresolvedItemName) -> Option<usize>;
}
Expand description
A connection to an external system
Required Methods§
sourcefn upstream_name(&self) -> Option<&str>
fn upstream_name(&self) -> Option<&str>
The name of the resource in the external system (e.g kafka topic) if any
sourcefn key_desc(&self) -> RelationDesc
fn key_desc(&self) -> RelationDesc
The schema of this connection’s key rows.
sourcefn value_desc(&self) -> RelationDesc
fn value_desc(&self) -> RelationDesc
The schema of this connection’s value rows.
sourcefn timestamp_desc(&self) -> RelationDesc
fn timestamp_desc(&self) -> RelationDesc
The schema of this connection’s timestamp type. This will also be the schema of the progress relation.
sourcefn connection_id(&self) -> Option<GlobalId>
fn connection_id(&self) -> Option<GlobalId>
The id of the connection object (i.e the one obtained from running CREATE CONNECTION
) in
the catalog, if any.
sourcefn metadata_columns(&self) -> Vec<(&str, ColumnType)>
fn metadata_columns(&self) -> Vec<(&str, ColumnType)>
Returns metadata columns that this connection instance will produce once rendered. The columns are returned in the order specified by the user.
sourcefn output_idx_for_name(&self, name: &UnresolvedItemName) -> Option<usize>
fn output_idx_for_name(&self, name: &UnresolvedItemName) -> Option<usize>
Returns the output index for name
if this source contains it.
We use the output index to provide a consistent correlation in multi-output sources between the ingestion dataflow and storage rendering’s use of persist as a sink.
We want to allow dynamic lookup of these values because the output index can change. if e.g. the source’s underlying structure changes due to adding and removing subsources.