-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add insert/update/delete to LogicalPlan and add SQL planner support #4902
Conversation
@andygrove @alamb I'd love to hear your thoughts on this. |
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.
I think this is looking quite nice @avantgardnerio -- I need to review it when I have a bit more brain power.
My biggest reaction is to the need to start namespacing the LogicalPlan a bit more -- but the WriteRel is a good model to follow (e.g. for DML)
7b26d58
to
0fbbf5a
Compare
let sql = "delete from person where id=1"; | ||
let plan = r#" | ||
Write: op=[Delete] table=[person] | ||
Filter: id = Int64(1) |
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.
No projection needed for delete I assume?
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.
Makes sense
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.
LGTM. Thanks @avantgardnerio
@@ -1180,6 +1180,12 @@ impl DefaultPhysicalPlanner { | |||
"Unsupported logical plan: CreateView".to_string(), | |||
)) | |||
} | |||
LogicalPlan::Dml(_) => { |
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.
😍
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.
Looks good to me -- thank you @avantgardnerio
"Insert-returning clause not yet supported".to_owned(), | ||
))?; | ||
} | ||
let _ = into; // optional keyword doesn't change behavior |
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.
awesome
Benchmark runs are scheduled for baseline = 279440b and contender = aa8f139. aa8f139 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Which issue does this PR close?
Closes #4901.
Rationale for this change
Described in issue.
What changes are included in this PR?
LogicalPlan
enum variant calledWriteRel
and modeled after SubstraitAre these changes tested?
Yes
Are there any user-facing changes?
Only if the user is a programmer using DataFusion as a library, in which case more ASTs will convert to LogicalPlans.