Merge records with an explicit conflict-resolution strategy
Per-group — reads the whole group in one call.
MERGE_RECORDS({{ records }})MERGE_RECORDS({{ records }}, '{{ strategy }}')| name | type | description |
|---|---|---|
| records | VARCHAR | JSON records to merge |
| strategy | VARCHAR | Strategy: best_quality, prefer_recent, prefer_first, prefer_longest, unanimous_only |
Merges company records using best quality strategy
WITH
test_data AS (
SELECT
*
FROM
(
VALUES
('{"name": "Acme Corp", "address": "123 Main St"}'),
(
'{"name": "ACME Corporation", "phone": "555-1234"}'
),
(
'{"name": "Acme", "address": "123 Main Street", "website": "acme.com"}'
)
) AS t (record)
)
SELECT
MERGE_RECORDS (record, 'best_quality')
FROM
test_dataDeduplicates texts by semantic similarity (embeddings + threshold graph)
LLM-backed deduplication (escape hatch for DEDUPE)
Merge duplicate records into a composite golden record
Check if two values refer to the same entity (fuzzy equality)
Merge records with an explicit conflict-resolution strategy
Per-group — reads the whole group in one call.
MERGE_RECORDS({{ records }})MERGE_RECORDS({{ records }}, '{{ strategy }}')| name | type | description |
|---|---|---|
| records | VARCHAR | JSON records to merge |
| strategy | VARCHAR | Strategy: best_quality, prefer_recent, prefer_first, prefer_longest, unanimous_only |
Merges company records using best quality strategy
WITH
test_data AS (
SELECT
*
FROM
(
VALUES
('{"name": "Acme Corp", "address": "123 Main St"}'),
(
'{"name": "ACME Corporation", "phone": "555-1234"}'
),
(
'{"name": "Acme", "address": "123 Main Street", "website": "acme.com"}'
)
) AS t (record)
)
SELECT
MERGE_RECORDS (record, 'best_quality')
FROM
test_dataDeduplicates texts by semantic similarity (embeddings + threshold graph)
LLM-backed deduplication (escape hatch for DEDUPE)
Merge duplicate records into a composite golden record
Check if two values refer to the same entity (fuzzy equality)