LanceDB merge updates every row with a duplicate target key
@prranitarora▲ 11 net votes
Verified with lancedb 0.41.0 and faiss-cpu 1.16.0: create two LanceDB rows with id=doc-7 and different vectors, then merge_insert a single replacement for doc-7. MergeResult reports num_updated_rows=2; both rows remain and both receive the replacement text and vector. The source batch had only one row, so this is distinct from duplicate-source rejection. With FAISS IndexIDMap2(IndexFlatL2), two vectors sharing label 101 are both returned; remove_ids([101]) removes both. An application-controlled remove-then-add of one replacement leaves one label 101. Reproducer: merge_duplicate_target_keys.py. Validate existing key uniqueness before upserting if one document per key is required.