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

Method list_partitions

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

List all partitions of a table, paging internally.

(&self, identifier: &Identifier)

Source from the content-addressed store, hash-verified

380
381 /// List all partitions of a table, paging internally.
382 pub async fn list_partitions(&self, identifier: &Identifier) -> Result<Vec<Partition>> {
383 let database = identifier.database();
384 let table = identifier.object();
385 validate_non_empty_multi(&[(database, "database name"), (table, "table name")])?;
386
387 let mut results = Vec::new();
388 let mut page_token: Option<String> = None;
389
390 loop {
391 let paged = self
392 .list_partitions_paged(identifier, None, page_token.as_deref())
393 .await?;
394 let is_empty = paged.elements.is_empty();
395 results.extend(paged.elements);
396 page_token = paged.next_page_token;
397 if page_token.is_none() || is_empty {
398 break;
399 }
400 }
401
402 Ok(results)
403 }
404
405 /// List partitions with pagination.
406 pub async fn list_partitions_paged(

Callers 1

scanMethod · 0.45

Calls 5

validate_non_empty_multiFunction · 0.85
objectMethod · 0.80
databaseMethod · 0.45
list_partitions_pagedMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected