Skip to content

Conversation

@timsaucer
Copy link
Member

Related

Closes https://linear.app/rerun/project/add-ability-to-upsert-data-in-tables-aad5989947ac

What

This PR follows up on the work from #11694 and the issues linked inside it.

With this PR you can update existing tables if they have an index specified as a primary key. You do this by setting the metadata rerun:is_table_index on the field when creating the table. During update operations we will use these columns as the keys by which we update the underlying lance table.

@github-actions
Copy link

github-actions bot commented Nov 6, 2025

Web viewer built successfully.

Result Commit Link Manifest
bfbe562 https://rerun.io/viewer/pr/11812 +nightly +main

View image diff on kitdiff.

Note: This comment is updated whenever you push a commit.

@timsaucer timsaucer force-pushed the tsaucer/replace-operation branch 2 times, most recently from d77ed28 to bf729fa Compare November 10, 2025 19:33
@timsaucer timsaucer force-pushed the tsaucer/replace-operation branch from bf729fa to bfbe562 Compare November 14, 2025 16:04
@timsaucer
Copy link
Member Author

@rerun-bot full-check

@github-actions
Copy link

@timsaucer timsaucer requested a review from jleibs November 14, 2025 18:14
@timsaucer timsaucer marked this pull request as ready for review November 14, 2025 18:14
@timsaucer timsaucer added exclude from changelog PRs with this won't show up in CHANGELOG.md dataplatform Rerun Data Platform integration labels Nov 14, 2025
@timsaucer timsaucer changed the title Tsaucer/replace operation Add ability to replace/upsert in tables Nov 14, 2025
}
InsertOp::Replace => {
exec_err!("Invalid insert operation. Only append and overwrite are supported.")?;
let key_columns: Vec<_> = dataset
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If key_columns is empty and/or disjoint with reader.schema(), should we / do we get an error?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you get the error A merge insert operation must specify at least one on key

@timsaucer timsaucer merged commit 0c88e94 into main Nov 17, 2025
106 of 107 checks passed
@timsaucer timsaucer deleted the tsaucer/replace-operation branch November 17, 2025 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dataplatform Rerun Data Platform integration exclude from changelog PRs with this won't show up in CHANGELOG.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants