Building a vector index on an existing embedding column fails on some tables with
could not detect dimension for '<column>', and reproduces on retry for the same table
while structurally similar tables index successfully. The trigger was not identified.
This blocks the HNSW fast path for HotdataVectorStore on any table that lands in this
state, and there is no client-side workaround (see "Why this cannot be fixed in the client"
below).
What happened
While verifying the vector fast path for HotdataVectorStore (hotdata-langchain 0.4.0),
we created cosine vector indexes on seven managed tables in a live workspace
(api.hotdata.dev). Six succeeded. One failed with:
could not detect dimension for 'embedding'
The failure reproduced on retry against the same table. Recreating an equivalent table
from scratch and indexing it succeeded, so the problem is table state, not the schema.
All seven tables had the same relevant shape:
- column
embedding, arrow type List(Float32), 1536 dimensions (OpenAI
text-embedding-3-small)
- written through
load_managed_table(..., mode="upsert", key=["id"]) from a pyarrow
table serialised to parquet
- index request:
index_type="vector", metric="cosine", columns=["embedding"]
How the failure surfaces
Index creation is an async job. The create_index call returns successfully with a job id
and status pending; the error only ever appears on the job record, in
JobsApi.get_job(id).error_message. A caller that does not poll sees a successful create
and an index that never materialises.
Hypotheses tested and ruled out
Each was checked by building a table exhibiting only that property and indexing it. All four
indexed successfully, so none of these is the trigger on its own:
| Hypothesis |
Result |
| Parquet fragmentation from repeated upserts |
ruled out — a table with several successive upserts indexed fine |
A prior mode="delete" load leaving tombstones |
ruled out — a table with a delete applied indexed fine |
| Promoted typed metadata columns alongside the vector column |
ruled out — indexed fine |
The List(Float32) column type itself |
ruled out — it is indexable; six tables with that exact type succeeded |
We stopped after six controlled reproductions rather than continue guessing. Whatever the
trigger is, it is some accumulated table state that the dimension-detection step does not
handle, and it is not any of the obvious candidates above.
Why this cannot be fixed in the client
hotdata-framework 0.10.0's create_index accepts a dimensions argument, but it does not
apply here. Per its own contract, when indexing an existing vector column the width is
read from the data; dimensions applies only to the provider-backed path, where the engine
embeds a source text column itself. So passing dimensions=1536 — which we were doing — is
ignored on this path, and there is no argument a caller can supply to bypass detection.
That means every consumer that indexes an existing embedding column is exposed:
hotdata-langchain's HotdataVectorStore, and anything built on
hotdata-dlt-destination's write side once its embedding adapter lands.
What would resolve this
Either of:
- Make detection robust to whatever table state defeats it. Ideally the detection step
reports what it saw when it fails (file count, first row inspected, the type it read)
rather than a bare "could not detect".
- Let the caller assert the width on the existing-column path too, so
dimensions= is
honoured as an override rather than ignored. This is the smaller change and unblocks
consumers immediately, but leaves the underlying detection bug in place.
A better error message is worth having regardless of which is chosen. The current text names
the column but nothing about why detection failed, which is what made this take six
reproductions to not diagnose.
Context
Building a
vectorindex on an existing embedding column fails on some tables withcould not detect dimension for '<column>', and reproduces on retry for the same tablewhile structurally similar tables index successfully. The trigger was not identified.
This blocks the HNSW fast path for
HotdataVectorStoreon any table that lands in thisstate, and there is no client-side workaround (see "Why this cannot be fixed in the client"
below).
What happened
While verifying the vector fast path for
HotdataVectorStore(hotdata-langchain 0.4.0),we created cosine vector indexes on seven managed tables in a live workspace
(
api.hotdata.dev). Six succeeded. One failed with:The failure reproduced on retry against the same table. Recreating an equivalent table
from scratch and indexing it succeeded, so the problem is table state, not the schema.
All seven tables had the same relevant shape:
embedding, arrow typeList(Float32), 1536 dimensions (OpenAItext-embedding-3-small)load_managed_table(..., mode="upsert", key=["id"])from a pyarrowtable serialised to parquet
index_type="vector",metric="cosine",columns=["embedding"]How the failure surfaces
Index creation is an async job. The
create_indexcall returns successfully with a job idand status
pending; the error only ever appears on the job record, inJobsApi.get_job(id).error_message. A caller that does not poll sees a successful createand an index that never materialises.
Hypotheses tested and ruled out
Each was checked by building a table exhibiting only that property and indexing it. All four
indexed successfully, so none of these is the trigger on its own:
mode="delete"load leaving tombstonesList(Float32)column type itselfWe stopped after six controlled reproductions rather than continue guessing. Whatever the
trigger is, it is some accumulated table state that the dimension-detection step does not
handle, and it is not any of the obvious candidates above.
Why this cannot be fixed in the client
hotdata-framework0.10.0'screate_indexaccepts adimensionsargument, but it does notapply here. Per its own contract, when indexing an existing vector column the width is
read from the data;
dimensionsapplies only to the provider-backed path, where the engineembeds a source text column itself. So passing
dimensions=1536— which we were doing — isignored on this path, and there is no argument a caller can supply to bypass detection.
That means every consumer that indexes an existing embedding column is exposed:
hotdata-langchain'sHotdataVectorStore, and anything built onhotdata-dlt-destination's write side once its embedding adapter lands.What would resolve this
Either of:
reports what it saw when it fails (file count, first row inspected, the type it read)
rather than a bare "could not detect".
dimensions=ishonoured as an override rather than ignored. This is the smaller change and unblocks
consumers immediately, but leaves the underlying detection bug in place.
A better error message is worth having regardless of which is chosen. The current text names
the column but nothing about why detection failed, which is what made this take six
reproductions to not diagnose.
Context
docs/engine-contract.md(section "The vector index is also reached without naming it")
HotdataVectorStore, shipped in hotdata-langchain 0.4.0 (HotdataVectorStore Phase 1 (MVP): writes, similarity search, get_by_ids, delete, from_texts #48)create_indexon exactly thispath, so this bug will surface to LangChain users rather than just to us.