Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add withPartitionName for DeleteIdsParam #718

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3076,6 +3076,7 @@ public R<DeleteResponse> delete(DeleteIdsParam requestParam) {
String expr = VectorUtils.convertPksExpr(requestParam.getPrimaryIds(), wrapper);
DeleteParam deleteParam = DeleteParam.newBuilder()
.withCollectionName(requestParam.getCollectionName())
.withPartitionName(requestParam.getPartitionName())
.withExpr(expr)
.build();
R<MutationResult> resultR = delete(deleteParam);
Expand Down
15 changes: 14 additions & 1 deletion src/main/java/io/milvus/param/highlevel/dml/DeleteIdsParam.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@
@Getter
@ToString
public class DeleteIdsParam {

private final String collectionName;
private final String partitionName;
private final List<?> primaryIds;

private DeleteIdsParam(@NonNull Builder builder) {
this.collectionName = builder.collectionName;
this.partitionName = builder.partitionName;
this.primaryIds = builder.primaryIds;
}

Expand All @@ -54,6 +55,7 @@ public static Builder newBuilder() {
*/
public static class Builder<T> {
private String collectionName;
private String partitionName = "";
private List<T> primaryIds = new ArrayList<>();

private Builder() {
Expand All @@ -70,6 +72,17 @@ public Builder withCollectionName(@NonNull String collectionName) {
return this;
}

/**
* Sets the partition name (Optional).
*
* @param partitionName partition name
* @return <code>Builder</code>
*/
public Builder withPartitionName(@NonNull String partitionName) {
this.partitionName = partitionName;
return this;
}

/**
* Specifies primaryId fields. PrimaryIds cannot be empty or null.
*
Expand Down
Loading