Problem
DatasetIndexExt::initialize_index fails when an index references a nested field, even when the source and target datasets have identical schemas.
For example, initializing an index on embedding_data.vector.v2 fails with:
Index { message: "Field 'vector.v2' required by index 'vec_v2_idx' not found in target dataset" }
The failure affects initialize_index directly and initialize_indices when it encounters a nested index.
Root cause
The implementation resolves the source field by ID, but then uses only the leaf field name for both the target-schema lookup and the field names passed to the index initializer:
let target_field = self.schema().field(&source_field.name);
field_names.push(source_field.name.as_str());
For embedding_data.vector.v2, this reduces the canonical path to vector.v2, so the target schema lookup starts at the root and fails. Field names that require path quoting are affected as well.
Expected behavior
Resolve the indexed field ID to its canonical schema path with Schema::field_path, use that path for target-schema validation, and pass it to the scalar or vector index initializer.
Add regression coverage for initialization from an identical source schema using:
- a simple nested field path
- a nested field whose name requires path quoting
Impact
Index initialization and cloning workflows are blocked for valid nested vector or scalar indexes. No data corruption is known.
Problem
DatasetIndexExt::initialize_indexfails when an index references a nested field, even when the source and target datasets have identical schemas.For example, initializing an index on
embedding_data.fails with:vector.v2The failure affects
initialize_indexdirectly andinitialize_indiceswhen it encounters a nested index.Root cause
The implementation resolves the source field by ID, but then uses only the leaf field name for both the target-schema lookup and the field names passed to the index initializer:
For
embedding_data., this reduces the canonical path tovector.v2vector.v2, so the target schema lookup starts at the root and fails. Field names that require path quoting are affected as well.Expected behavior
Resolve the indexed field ID to its canonical schema path with
Schema::field_path, use that path for target-schema validation, and pass it to the scalar or vector index initializer.Add regression coverage for initialization from an identical source schema using:
Impact
Index initialization and cloning workflows are blocked for valid nested vector or scalar indexes. No data corruption is known.