GetPartitionStats()

Returns server-reported statistics for a partition, including its row count.

pub async fn get_partition_stats(
    &self,
    request: GetPartitionStatsRequest,
) -> Result<GetPartitionStatsResponse>

Request Syntax

let request = GetPartitionStatsRequest::builder()
    .collection_name("quick_setup")
    .partition_name("partitionA")
    .build()?;

REQUEST FIELDS:

  • database_name: Option<String>

    Name of the target database; uses the default database when empty.

  • collection_name: String

    Name of the collection. Required.

  • partition_name: String

    Name of the partition. Required.

RETURN TYPE:

Result

RETURNS:

A GetPartitionStatsResponse containing the partition statistics. Returns an Error if the operation fails.

GetPartitionStatsResponse
    name() // -> &str
    row_count() // -> Option<i64>
    statistics() // -> &HashMap<String, String>

METHODS:

  • name() (&str) -

    The name of the partition the statistics describe.

  • row_count() (Option) -

    The server-reported row count, when present.

  • statistics() (&HashMap) -

    The full key-value statistics map, including the server-reported row count when present.

Example

let request = GetPartitionStatsRequest::builder()
    .collection_name("quick_setup")
    .partition_name("partitionA")
    .build()?;
let resp = client.get_partition_stats(request).await?;
println!("row_count: {:?}", resp.row_count());

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?