Skip to content

Support settings columns with expressions in merge_insert #4281

@wjones127

Description

@wjones127

Support queries like:

MERGE INTO <dataset>
USING <source>
ON dataset.id = source.id
WHEN MATCHED AND target.text <> source.text THEN UPDATE
  SET text = source.text,
      updated_at = timestamp_now(),
      text_embedding = embedding(source.text)
WHEN NOT MATCHED THEN INSERT
  (text, created_at, updated_at, text_embedding)
  VALUES
  (source.text, timestamp_now(), timestamp_now(), embedding(source.text))

This would allow deferring computations, such as embedding functions, until we find they are actually needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions