New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add merge_insert to the node and rust APIs #915
Conversation
|
/// merge_insert.execute(Box::new(new_data)).await.unwrap(); | ||
/// # }); | ||
/// ``` | ||
fn merge_insert(&self, on: &[&str]) -> MergeInsertBuilder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why dont we just call it upsert
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upsert has well defined semantics and is only a subset of merge insert. Merge insert can do upsert
, insert-if-not-exists
and replace-range
. We could create an alias that sets the appropriate configuration and runs merge insert but we talked about it a bit in slack and decided not to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More specifically:
Bulk Update
when_matched_update_all
Upsert
when_matched_update_all
when_not_matched_insert_all
Insert if not Exists
when_not_matched_insert_all
Replace Range
when_matched_update_all
when_not_matched_insert_all
when_not_matched_by_source_delete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And, to be clear, we didn't invent MERGE INSERT
. It's an established operation in data warehouses:
No description provided.