Uh oh!
There was an error while loading. Please reload this page.
implement drop view - #3267
Conversation
avantgardnerio
commented
Aug 25, 2022
@DaltonModlin may be interested in this. |
Codecov Report
@@ Coverage Diff @@## master #3267 +/- ##
==========================================
- Coverage 85.48% 85.47% -0.02%
==========================================
Files 294 294 Lines 54072 54130 +58 ==========================================
+ Hits 46223 46267 +44 - Misses 7849 7863 +14
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
kmitchener
commented
Aug 25, 2022
Functionality plus basic tests and docs added |
kmitchener
commented
Aug 26, 2022
One thing I didn't do in this PR: re-export the new datafusion_expr::logical_plan::DropView struct via the "legacy" logical_plan module in core (datafusion::logical_plan:: ..). Should I re-export it or does legacy in this case mean that no new re-exports should happen there? https://github.com/apache/arrow-datafusion/blob/master/datafusion/core/src/logical_plan/mod.rs#L18 Alternatively, should we create an issue to remove this legacy re-exporting? |
andygrove
commented
Aug 26, 2022
We do have an issue already for this - #2683 We may want to deprecate this module for one release and then remove in the next. |
| DROP TABLE IF EXISTS nonexistent_table; | ||
| ``` | ||
| ## DROP VIEW |
Uh oh!
There was an error while loading. Please reload this page.
kmitchener
commented
Aug 31, 2022
@andygrove This is ready. Let me know what I can do to help get it committed. Thanks! |
kmitchener
commented
Sep 2, 2022
@alamb is there someone that's suitable to review this and give feedback? this PR is blocking progress on other issues and it's not getting a review :( and I'm not sure how to proceed |
alamb
commented
Sep 3, 2022
SOrry @kmitchener -- I will review it now |
alamb
left a comment
There was a problem hiding this comment.
This looks great @kmitchener -- thank you and I apologize again for the delay in review
| schema: DFSchemaRef::new(DFSchema::empty()), | ||
| })), | ||
| _ => Err(DataFusionError::NotImplemented( | ||
| "Only `DROP TABLE/VIEW ...` statement is supported currently" |
| pub schema: DFSchemaRef, | ||
| } | ||
| /// Drops a view. |
There was a problem hiding this comment.
Not for this PR, but it seems to me like requiring new LogicalPlan nodes for each type of DDL (CREATE, DROP, etc) is somewhat cumbersome. Maybe we can eventually refactor type of thing into LogicalPlan::DDL(DDL) and keep all the DDL related structs in their own structure. I'll file a follow on ticket for this
There was a problem hiding this comment.
Yes, I was wondering about this and follow on work for dropping schema, etc. A lot of plumbing here, and I'm not sure it works if you have your own CatalogProvider.
There was a problem hiding this comment.
Yes, I was wondering about this and follow on work for dropping schema, etc. A lot of plumbing here, and I'm not sure it works if you have your own CatalogProvider.
I agree -- it does not work if you have your own CatalogProvider without some more work. I this behavior is fine, as long as the point is clear to users.
| let plan = LogicalPlanBuilder::empty(false).build()?; | ||
| Ok(Arc::new(DataFrame::new(self.state.clone(), &plan))) | ||
| } | ||
| (true, false, Ok(_)) => self.return_empty_dataframe(), |
There was a problem hiding this comment.
This change to refactor and reduce duplicated code, is a very nice example of leaving the code better than when you found it. It is very much appreciated @kmitchener
| #[tokio::test] | ||
| #[should_panic(expected = "doesn't exist")] | ||
| async fn drop_view_cant_drop_table() { |
ursabot
commented
Sep 3, 2022
Benchmark runs are scheduled for baseline = 0fc7297 and contender = 5621e3b. 5621e3b 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#3251.
Rationale for this change
What changes are included in this PR?
drop viewanddrop view if existsdrop tableso it only works on tables, not viewsdrop viewAre there any user-facing changes?