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

Method commit_snapshot

crates/paimon/src/api/rest_api.rs:458–479  ·  view source on GitHub ↗

Commit a snapshot for a table. Corresponds to Python `RESTApi.commit_snapshot`.

(
        &self,
        identifier: &Identifier,
        table_uuid: &str,
        snapshot: &Snapshot,
        statistics: &[PartitionStatistics],
    )

Source from the content-addressed store, hash-verified

456 ///
457 /// Corresponds to Python `RESTApi.commit_snapshot`.
458 pub async fn commit_snapshot(
459 &self,
460 identifier: &Identifier,
461 table_uuid: &str,
462 snapshot: &Snapshot,
463 statistics: &[PartitionStatistics],
464 ) -> Result<bool> {
465 let database = identifier.database();
466 let table = identifier.object();
467 validate_non_empty_multi(&[(database, "database name"), (table, "table name")])?;
468 let path = self.resource_paths.commit_table(database, table);
469 let request = serde_json::json!({
470 "tableUuid": table_uuid,
471 "snapshot": snapshot,
472 "statistics": statistics,
473 });
474 let resp: serde_json::Value = self.client.post(&path, &request).await?;
475 Ok(resp
476 .get("success")
477 .and_then(|v| v.as_bool())
478 .unwrap_or(false))
479 }
480
481 /// Rollback a table to a specific snapshot.
482 pub async fn rollback_to_snapshot(

Calls 6

validate_non_empty_multiFunction · 0.85
objectMethod · 0.80
commit_tableMethod · 0.80
postMethod · 0.80
databaseMethod · 0.45
getMethod · 0.45