pub struct SchemaManager { /* private fields */ }Expand description
Manager for versioned table schema files.
Each table stores schema versions as JSON files under {table_path}/schema/schema-{id}.
When a schema evolution occurs (e.g. ADD COLUMN, ALTER COLUMN TYPE), a new schema file
is written with an incremented ID. Data files record which schema they were written with
via DataFileMeta.schema_id.
The schema cache is shared across clones via Arc, so multiple readers
(e.g. parallel split streams) benefit from a single cache.
Reference: org.apache.paimon.schema.SchemaManager
Implementations§
Source§impl SchemaManager
impl SchemaManager
pub fn new(file_io: FileIO, table_path: String) -> Self
Sourcepub async fn schema(&self, schema_id: i64) -> Result<Arc<TableSchema>>
pub async fn schema(&self, schema_id: i64) -> Result<Arc<TableSchema>>
Load a schema by ID. Returns cached version if available.
The cache is shared across all clones of this SchemaManager, so loading
a schema in one stream makes it available to all other streams reading
from the same table.
Reference: SchemaManager.schema(long)
Trait Implementations§
Source§impl Clone for SchemaManager
impl Clone for SchemaManager
Source§fn clone(&self) -> SchemaManager
fn clone(&self) -> SchemaManager
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more