MCPcopy Create free account
hub / github.com/apache/paimon-rust / alter_table

Method alter_table

crates/paimon/src/catalog/filesystem.rs:400–425  ·  view source on GitHub ↗
(
        &self,
        identifier: &Identifier,
        changes: Vec<crate::spec::SchemaChange>,
        ignore_if_not_exists: bool,
    )

Source from the content-addressed store, hash-verified

398 }
399
400 async fn alter_table(
401 &self,
402 identifier: &Identifier,
403 changes: Vec<crate::spec::SchemaChange>,
404 ignore_if_not_exists: bool,
405 ) -> Result<()> {
406 let table_path = self.table_path(identifier);
407 if !self.table_exists(identifier).await? {
408 if ignore_if_not_exists {
409 return Ok(());
410 }
411 return Err(Error::TableNotExist {
412 full_name: identifier.full_name(),
413 });
414 }
415
416 let current = self
417 .load_latest_table_schema(&table_path)
418 .await?
419 .ok_or_else(|| Error::TableNotExist {
420 full_name: identifier.full_name(),
421 })?;
422
423 let new_schema = current.apply_changes(changes)?;
424 self.save_table_schema(&table_path, &new_schema).await
425 }
426}
427
428#[cfg(test)]

Callers 1

Calls 6

table_pathMethod · 0.80
table_existsMethod · 0.80
full_nameMethod · 0.80
apply_changesMethod · 0.80
save_table_schemaMethod · 0.80

Tested by 1