surfacesummarizationmerge_texts
Summarizationaggregate · returns varchar

MERGE_TEXTS

Combine multiple text values into one coherent output

Per-group — reads the whole group in one call.

summarizationllmtext

Syntax

MERGE_TEXTS({{ texts }})
MERGE_TEXTS({{ texts }}, '{{ mode }}')

Arguments

nametypedescription
textsVARCHARText values to merge
mode(optional)VARCHARMode: concatenate, deduplicate, synthesize, summarize, timeline

About

Combine a group of text values into a single coherent output — deduplicating, synthesizing, or stitching them together depending on the mode. Useful for consolidating support-ticket replies into one resolution note, merging draft paragraphs into a finished section, combining overlapping product descriptions into a cleaner version, or assembling multiple translations into one sentence. Pass a `mode` argument to steer the behavior: `deduplicate` (default) — remove repetition, keep unique info `synthesize` — rewrite into a single coherent passage `concatenate` — simple join with light cleanup `summarize` — aggregate summary rather than full merge For a summary of a collection where the source texts are already distinct, reach for SUMMARIZE.

Examples

Deduplicates similar shipping comments

WITH
  test_data AS (
    SELECT
      *
    FROM
      (
        VALUES
          ('The product arrived on time.'),
          ('Product arrived on time!'),
          ('Fast shipping, item came early.'),
          ('Great packaging and quick delivery.')
      ) AS t (comment)
  )
SELECT
  MERGE_TEXTS (comment, 'deduplicate')
FROM
  test_data

Nearby rabbit holes

same domain
Climb back to The Looking Glass