---
updatedAt: 2026-05-04T21:16:02.000Z
agentTools:
  projectIndex: https://docs.observeinc.com/llms.txt
---

# update_resource

Aliases: `mergeevent` (deprecated), `merge_event` (deprecated).

```
update_resource [options(...)]?, [pkequalitypredicate: bool]+, [columnbinding: expression]+
```

Builds new columns on a Resource dataset by matching each resource row to Event rows on a full primary-key or candidate-key equality, then projecting values from those events onto the resource timeline.

The default input must be a Resource. Exactly one additional Event dataset is referenced (through the pipeline’s linked inputs); other dataset kinds are rejected.

After an optional `options(...)` map, you supply one or more `eq(local_col, @events.remote_col)` predicates. Together they must cover every column of the primary key or of at least one candidate key on the resource.

Following the predicates, you supply one or more name bindings `new_col:@events.expr` (or similar paths). Each binding introduces a new column name; rebinding into an existing resource column is not allowed. Expression types must be storable as column values.

Internally, events are folded into a temporary resource (similar to [make\_resource](verb-make_resource)) and left-outer-joined to the input resource on the key mapping. Foreign keys whose source columns you pull through intact may be carried into the output metadata.

# Options

| Option | Type     | Meaning                                                                                                                                                |
| ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| expiry | duration | `duration` controlling how long event-sourced values remain before expiring when forming the ephemeral resource from the event stream (default `24h`). |

# Categories

* [Join](verb#join-verbs)

# Accelerable

update\_resource is always accelerable if the input is accelerable. A dataset that only uses accelerable verbs can be accelerated, making
queries on the dataset respond faster.

# Examples

<OpalCodeBlock code={
`update_resource options(expiry:duration_hr(12)), station_id=@events.station_id, note:@events.message
`}/>

Matches each resource row to events on the primary key, adds a new `note` column from the event stream, and sets a twelve-hour materialization expiry.

<OpalCodeBlock code={
`update_resource station_id=@telemetry.station_id, rpm:@telemetry.rpm
`}/>

Projects a numeric field from a linked Event dataset onto the resource using default expiry, without listing an `options(...)` map.