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

Method list_partitions_paged

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

List partitions with pagination.

(
        &self,
        identifier: &Identifier,
        max_results: Option<u32>,
        page_token: Option<&str>,
    )

Source from the content-addressed store, hash-verified

404
405 /// List partitions with pagination.
406 pub async fn list_partitions_paged(
407 &self,
408 identifier: &Identifier,
409 max_results: Option<u32>,
410 page_token: Option<&str>,
411 ) -> Result<PagedList<Partition>> {
412 let database = identifier.database();
413 let table = identifier.object();
414 validate_non_empty_multi(&[(database, "database name"), (table, "table name")])?;
415 let path = self.resource_paths.partitions(database, table);
416 let mut params: Vec<(&str, String)> = Vec::new();
417
418 if let Some(max) = max_results {
419 params.push((Self::MAX_RESULTS, max.to_string()));
420 }
421 if let Some(token) = page_token {
422 params.push((Self::PAGE_TOKEN, token.to_string()));
423 }
424
425 let response: ListPartitionsResponse = if params.is_empty() {
426 self.client.get(&path, None::<&[(&str, &str)]>).await?
427 } else {
428 self.client.get(&path, Some(&params)).await?
429 };
430
431 Ok(PagedList::new(
432 response.partitions.unwrap_or_default(),
433 response.next_page_token,
434 ))
435 }
436
437 // ==================== Token Operations ====================
438

Callers 1

list_partitionsMethod · 0.45

Calls 6

validate_non_empty_multiFunction · 0.85
objectMethod · 0.80
partitionsMethod · 0.80
databaseMethod · 0.45
is_emptyMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected