< Docs
  • Java


A MilvusClient interface. This method drops a partition and the data within.

This method drops all data in the specified partition and the _default partition cannot be dropped.
R<RpcStatus> dropPartition(DropPartitionParam requestParam);


Use the DropPartitionParam.Builder to construct a DropPartitionParam object.

import io.milvus.param.DropPartitionParam;
DropPartitionParam.Builder builder = DropPartitionParam.newBuilder();

Methods of DropPartitionParam.Builder:

withCollectionName(String collectionName)Sets the collection name. The collection name cannot be empty or null.collectionName: The name of the collection in which a partition needs to be dropped.
withPartitionName(String partitionName)Sets the partition name. The partition name cannot be empty or null.partitionName: The name of the partition to drop.
build()Constructs a DropPartitionParam object.N/A

The can throw the following exceptions:

  • ParamException: error if the parameter is invalid.


This method catches all the exceptions and returns an R<RpcStatus> object.

  • If the API fails on the server side, it returns the error code and message from the server.

  • If the API fails by RPC exception, it returns R.Status.Unknow and the error message of the exception.

  • If the API succeeds, it returns R.Status.Success.


import io.milvus.param.*;

DropPartitionParam param = DropPartitionParam.newBuilder()
R<RpcStatus> response = client.dropPartition(param);
if (response.getStatus() != R.Status.Success.getCode()) {