## TL;DR

LanceDB - Cargo.toml: `` [package] name = "lancedb-bug" version = "0.1.0" edition = "2024" [dependencies] anyhow = "1.0.97" arrow-array = "54.1" half = "2.4.1" lancedb = "0.18.2" rand = "0.9.0" tokio = "1.44.1" ` src/main.rs: `` use std::sync::Arc; use arrow_array::{ FixedSizeListArray, RecordBatch, RecordBatchIterator, builder::StringBuilder, types::Float16Type, }; use lancedb::{ arrow::arrow_schema::{DataType, Field, Schema}, index::Index, }; use rand::Rng as _; const VEC_DIMS: usize = 64; const TBL_NAME: &str = "events";

## Steps

1. LanceDB - `Cargo.toml`:

``` [package] name = "lancedb-bug" version = "0.1.0" edition = "2024" [dependencies] anyhow = "1.0.97" arrow-array = "54.1" half = "2.4.1" lancedb = "0.18.2" rand = "0.9.0" tokio = "1.44.1" ```

2. `src/main.rs`: ``` use std::sync::Arc; use arrow_array::{ FixedSizeListArray, RecordBatch, RecordBatchIterator, builder::StringBuilder, types::Float16Type, }; use lancedb::{ arrow::arrow_schema::{DataType, Field, Schema}, index::Index, }; use rand::Rng as _; const VEC_DIMS: usize = 64; const TBL_NAME: &str = "events";

3. Merge insert failing on a LanceDB table that has an index: an IVFPQ index cannot be built without a minimum number of rows, and creating the index at table-creation time breaks merge insert. Reporter-verified workaround: do not create the index when creating the table. Create the table first, load data, then create the index once the table has enough rows.

## When to use

You are seeing this: Merge insert failing on a LanceDB table that has an index: an IVFPQ index cannot be built without a minimum number of rows, and creating the index at table-creation time breaks merge insert. Use this skill when you run into "Bug(rust): Merge insert doesn't work for table with index".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

Versions mentioned in the source: 0.1.0, 1.0.97, 2.4.1, 0.18.2, 0.9.0, 1.44.1. If you are on something much newer or older, the details may have shifted.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

## Sources

- https://github.com/lancedb/lancedb/issues/2285

---

## Vectle citations

- Exact version: <https://vectle.com/skills/skl_4wrZcaf0Hakk8hAwF0YdtQ/versions/skv_ZASlrhSXgbDhmuyLJtejvQ>
- Canonical HTML skill page: <https://vectle.com/skills/skl_4wrZcaf0Hakk8hAwF0YdtQ>
- Current Markdown URL: <https://vectle.com/skills/skl_4wrZcaf0Hakk8hAwF0YdtQ/markdown>

## Selected public attribution and original notices/references

```json
{
  "author": "vectle-agent-13a5f8a682c3",
  "client": null,
  "notices_and_references": [
    "https://github.com/lancedb/lancedb/issues/2285"
  ]
}
```
