mirror of
https://github.com/lancedb/lancedb.git
synced 2026-11-13 22:26:53 +00:00
## Summary Fixes the problems a page-by-page review of the docs found before launch, after checking each one against the current source and, where noted, the code. The matching fixes for the dataset and Geneva pages, which live in `lancedb/docs`, are in lancedb/docs#402. **Tables** - `integrations/embedding/cohere`: each input-type description was split across two table rows and wrapped in literal quotes (`"`search_document`"`). Now one row per type. - `integrations/embedding/gemini`: removes the same stray quotes from the task-type table. - `integrations/ai/langchain`: the MMR search table's `kwargs` row was missing a cell, so its description sat under Type. - Six reranker pages (answerdotai, cohere, colbert, jina, openai, voyageai): closes the backtick before `_relevance_score`. - `indexing/vector-index`: finishes a cell cut off at "with scalar". - `sql/dql/dedupe`: labels the empty header cell in the resolution table. **Corrections** - `curation/sampling`: sampling works in LanceDB Embedded through the Python SDK, so the page is available in both, with the SQL sections marked Enterprise. - `feature-engineering/index`, `add-computed-column`: automatic refresh is on by default for each computed column and takes effect once a deployment enables its scheduler. `refresh-column` already said so; these two implied it was off. - `indexing/scalar-index`, `indexing/index`: `LABEL_LIST` accelerates `array_has_all`/`array_has_any`; `array_contains_*` doesn't exist. Also merges scalar-index's two "nested fields" sections into one. - `integrations/embedding/ibm`: lists the four current models from `CURRENT_MODELS` (it listed a deprecated one) and explains that the default stays a legacy ID so existing tables reload with their model. - `integrations/reranking/openai`: the class is `OpenaiReranker`, not `OpenAI()`. - `integrations/ai/synthetic-data-kit`: the CLI is `synthetic-data-kit` throughout, each step runs one command, each step passes the file it writes to the next, and `save-as` uses `-f`/`-o`. - `integrations/data/dlt`: `secrets.toml` defines `api_token`, which the pipeline reads, and the run command runs the file the page creates. - `search/vector-search`: the multivector walkthrough connected to Enterprise in step 1 and a local path in step 2. It now runs locally throughout, with a note on connecting to Enterprise, and is renamed so it doesn't read as a duplicate of the short section above. **Structure and wording** - `integrations/embedding/nvidia`: adds headings, and drops test-suite details aimed at contributors. - `integrations/ai/genkit`: makes the retrieval test a real heading and describes the query step. - `integrations/data/voxel51`: replaces a raw MkDocs `!!! note` with a `<Note>`. - `sql/ddl/table`, `sql/ddl/job`: "Errors and limits" is a real heading, not bold text. - `curation/windowing`: sidebar title matches the curation overview ("Rank and Deduplicate"). - `deployment/storage`, `basics/agentic-skills`: fixes a garbled sentence and a stale reference to the quickstart. **Checked:** no new Vale alerts on the changed pages. Assembled together with lancedb/docs#402, the site passes `mint validate` and `mint broken-links --check-anchors --check-redirects`. Every changed page was reviewed in a local preview. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
100 lines
3.8 KiB
Plaintext
100 lines
3.8 KiB
Plaintext
---
|
|
title: "DEDUPE"
|
|
sidebarTitle: "DEDUPE"
|
|
description: "The dedupe() table function: one representative row per near-duplicate group, scanned over the index."
|
|
icon: layer-group
|
|
keywords: ["dedupe", "vector_dedup", "sql", "deduplication", "near-duplicate", "table function"]
|
|
availability:
|
|
embedded: unavailable
|
|
enterprise: available
|
|
---
|
|
|
|
`dedupe` scans a vector column's [index](/indexing/vector-index) partitions
|
|
for rows closer than a distance threshold, resolves the overlapping pairs it
|
|
finds into duplicate groups, and returns one representative row per group --
|
|
without a full pairwise scan or a shuffle. See
|
|
[`duplicate_pairs`](/sql/dql/duplicate-pairs) to inspect the pairs themselves
|
|
before committing to this resolution.
|
|
|
|
```sql
|
|
SELECT * FROM dedupe(<table>, <vector_column>,
|
|
distance_threshold => <float>
|
|
[, resolution => 'connected_components' | 'direct_representative']
|
|
[, selection => 'all' | 'first' | 'random', count => <int>, seed => <int>]
|
|
)
|
|
```
|
|
|
|
```sql
|
|
SELECT * FROM dedupe('frames', 'vec', distance_threshold => 0.02)
|
|
```
|
|
|
|
<Note>
|
|
Earlier releases spelled this `vector_dedup`; that name is rejected on
|
|
current deployments.
|
|
</Note>
|
|
|
|
## Input {#input}
|
|
|
|
| Argument | Type | Required | Meaning |
|
|
| --- | --- | --- | --- |
|
|
| table name | string literal | yes | the table to scan |
|
|
| vector column | string literal | yes | the indexed vector column to compare |
|
|
| `distance_threshold` | float | yes | maximum distance for a pair to count as close |
|
|
| `resolution` | `'connected_components'` (default) \| `'direct_representative'` | no | how overlapping pairs group together -- see [Resolution](#resolution) |
|
|
| `selection` | `'all'` (default) \| `'first'` \| `'random'` | no | which index partitions to scan |
|
|
| `count` | int | no | number of partitions to sample when `selection => 'random'` |
|
|
| `seed` | int | no | random seed when `selection => 'random'` |
|
|
|
|
`id_column` is refused on `dedupe`: it has no separate pair-identifier output
|
|
to project onto, only [`duplicate_pairs`](/sql/dql/duplicate-pairs#input)
|
|
accepts it.
|
|
|
|
## Output {#output}
|
|
|
|
One row per duplicate group, **in the table's own schema** -- every column of
|
|
`<table>`, including a BlobV2 column, comes through unchanged on the
|
|
representative row Lance selected for that group. Unlike
|
|
[`duplicate_pairs`](/sql/dql/duplicate-pairs#output), there is no fixed
|
|
`dedupe`-specific schema to document: the output schema is the source
|
|
table's schema.
|
|
|
|
Because the result is already shaped like the table, it composes directly
|
|
into a new table or a materialized view:
|
|
|
|
```sql
|
|
CREATE MATERIALIZED VIEW frames_deduped AS
|
|
SELECT * FROM dedupe('frames', 'vec', distance_threshold => 0.02)
|
|
```
|
|
|
|
## Resolution {#resolution}
|
|
|
|
`resolution` chooses how overlapping pairs group together:
|
|
|
|
| `resolution` value | How pairs group |
|
|
| --- | --- |
|
|
| `connected_components` (default) | groups transitively: if a~b and b~c are both close, all three resolve together |
|
|
| `direct_representative` | only pairs within the threshold of each other resolve together |
|
|
|
|
## Sampling partitions {#sampling}
|
|
|
|
`selection` scopes the scan to a sample of partitions instead of all of them,
|
|
the same `all` (default) / `first` / `random` choice as
|
|
[`ivf_partition`](/sql/scalar-functions#ivf-partition). Use it to estimate a
|
|
duplicate rate on a large table before scanning it in full:
|
|
|
|
```sql
|
|
SELECT * FROM dedupe('frames', 'vec',
|
|
distance_threshold => 0.02, selection => 'random', count => 100, seed => 42)
|
|
```
|
|
|
|
## What to read next {#next}
|
|
|
|
<CardGroup cols={2}>
|
|
<Card title="DUPLICATE_PAIRS" icon="clone" href="/sql/dql/duplicate-pairs">
|
|
Inspect the close pairs themselves instead of the resolved groups.
|
|
</Card>
|
|
<Card title="Deduplicate near-duplicates" icon="copy" href="/curation/dedupe">
|
|
When to reach for this instead of exact-key deduplication.
|
|
</Card>
|
|
</CardGroup>
|