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

[Bug]: DeleteByPks is disabled if the string PK contains spaces #429

Open
1 task done
xwjdsh opened this issue Mar 27, 2023 · 0 comments · May be fixed by #430
Open
1 task done

[Bug]: DeleteByPks is disabled if the string PK contains spaces #429

xwjdsh opened this issue Mar 27, 2023 · 0 comments · May be fixed by #430

Comments

@xwjdsh
Copy link

xwjdsh commented Mar 27, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I have a collection where the id field is of type string, one of the entities is as follows,

id:  ba379e5b-5b63-4d8c-85f7-659828395e3b:example 111
... other fields

Then I'd like to delete the entity from the collection, the code is as follows,

pks := entity.NewColumnVarChar("id", []string{"ba379e5b-5b63-4d8c-85f7-659828395e3b:example 111"})
return s.client.DeleteByPks(ctx, collectionName, partitionName, pks)

Everything is fine but when I query again, it still returns.

Expected Behavior

It should not return after I execute DeleteByPks.

Steps To Reproduce

No response

Environment

docker milvusdb/milvus:v2.2.3

Anything else?

The code that causes the problem is as follows, it modified the input id that contains spaces.

expr = fmt.Sprintf("%s in %s", pkName, strings.Join(strings.Fields(fmt.Sprint(data)), ","))

go playground: https://go.dev/play/p/IT224pefQBl

@xwjdsh xwjdsh changed the title [Bug]: DeleteByPks is disabled if the data contains spaces [Bug]: DeleteByPks is disabled if the string PK contains spaces Mar 27, 2023
@xwjdsh xwjdsh linked a pull request Mar 27, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant