Skip to content

V6: insertMany() fails for Array properties due to unhandled type in property value mapping. #466

@Shah91n

Description

@Shah91n

Description:
When using insertMany() with objects containing Array properties, the operation fails because the property value mapping logic does not handle array types. The code currently only handles String and Number types, causing arrays to hit the assert false branch.

Steps to Reproduce:

  1. Create an object with an Array property (e.g., String[], List<String>)
  2. Attempt to insert using insertMany()
  3. Operation fails with AssertionError (if assertions enabled) or silently ignores the property (if assertions disabled)

Code Location:
io.weaviate.client6.v1.api.collections.data.InsertManyRequest.lambda$buildObject

Current Code Issue:

if (value instanceof String v) {
    protoValue.setStringValue(v);
} else if (value instanceof Number vx) {
    protoValue.setNumberValue(vx.doubleValue());
} else {
    assert false : "(insertMany) branch not covered"; // Arrays hit this branch
}

Impact:

  • Array properties are not persisted when using insertMany()
  • Data loss for array fields
  • Potential AssertionError crashes if assertions are enabled

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions