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

The result of milvusclient.query is not expacted after use bulk load json file #301

Open
yongpengli-z opened this issue Jun 6, 2022 · 0 comments

Comments

@yongpengli-z
Copy link
Collaborator

details:
1.the rows of json file need >=30(the result is correct when the rows is <=20)
2.both row_based and column_based

steps:
1.Create collection:
String collectionName="Collection_"+ MathUtil.getRandomString(10);
FieldType fieldType1 = FieldType.newBuilder()
.withName("book_id")
.withDataType(DataType.Int64)
.withPrimaryKey(true)
.withAutoID(false)
.build();
FieldType fieldType2 = FieldType.newBuilder()
.withName("word_count")
.withDataType(DataType.Int64)
.build();
FieldType fieldType3 = FieldType.newBuilder()
.withName(CommonData.defalutVectorField)
.withDataType(DataType.FloatVector)
.withDimension(128)
.build();
CreateCollectionParam createCollectionReq = CreateCollectionParam.newBuilder()
.withCollectionName(collectionName)
.withDescription("Test"+collectionName+"search")
.withShardsNum(2)
.addFieldType(fieldType1)
.addFieldType(fieldType2)
.addFieldType(fieldType3)
.build();
R collection = BaseTest.milvusClient.createCollection(createCollectionReq);
2. Upload json file to minio :
FileUtils.fileUploader(path,"bigJson0.json","bigData");
3. Bulk load
R bulkload = milvusClient.bulkload(BulkloadParam.newBuilder()
.withCollectionName(newColltcion)
.addFile("bigData/bigJson0.json").withRowBased(false)
.build());
4. query:
String query_Param = "book_id in [2,4,6,8]";
List outFields=Arrays.asList("book_id","word_count");
QueryParam queryParam= QueryParam.newBuilder()
.withCollectionName(newColltcion)
.withOutFields(outFields)
.withExpr(query_Param)
.build();
R queryResultsR = milvusClient.query(queryParam);
QueryResultsWrapper wrapperQuery = new QueryResultsWrapper(queryResultsR.getData());
System.out.println("query book_id:"+wrapperQuery.getFieldWrapper("book_id").getFieldData());
System.out.println("query word_count:"+wrapperQuery.getFieldWrapper("word_count").getFieldData());

image
bigJson0.json.zip

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

No branches or pull requests

1 participant