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";

## The fix

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.

Thread: gh:lancedb/lancedb#2285