pymilvus icon indicating copy to clipboard operation
pymilvus copied to clipboard

[QUESTION]: Does PyMilvus support another way to perform bulk insert without uploading an existing file to MinIO?

Open yengogo opened this issue 2 years ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

What is your question?

I just found 'do_bulk_insert' method in utility folder,but it seems to only supprt operation with real files(JSON...)

Does PyMilvus support another way to perform bulk insert without uploading an existing file to MinIO? Is there any ways can do bulk insert? Thank you.

Anything else?

No response

yengogo avatar Jul 27 '23 00:07 yengogo

/assign @yhmo

XuanYang-cn avatar Jul 27 '23 02:07 XuanYang-cn

`data = [field_1, field_2, field_3]

batch_size = 10000

for i in range(0, len(data), batch_size):
data_batch = [list(field_1[i:i+batch_size]),list(field_2[i:i+batch_size]), list(field_3[i:i+batch_size])] collection.insert(data_batch)`

This is how I insert data in bulk. Basically, field 1,2 and 3 are numpy arrays or lists with the data to be inserted. Batch them into 10k slices and insert.

nikhilsingh291 avatar Aug 13 '23 07:08 nikhilsingh291