Please implement a "DROP TABLE IF EXISTS" for drill to prevent FAILED status on command return status. This is a standard feature in most SQL frameworks. Hao Zhu
DROP TABLE - Apache Drill
Hi Community Manager!!!
For suggested enhancements to the Apache Drill project you can file a JIRA here
Apache Drill - ASF JIRA
This is a great idea. A JIRA for just such a feature was added a few days ago. See
[DRILL-4673] Implement "DROP TABLE IF EXISTS" for drill to prevent FAILED status on command return - ASF JIRA
for more information on progress.
DROP TABLE IF EXISTS but also DROP VIEW IF EXISTS
Both statements are important to administrators looking to automate and script things within a multi tenant environment. Very important. With Drill, much is done with VIEWs, I would argue that in Drill Views and Tables are almost equal in their importance.
Yep both of them are implemented, so we just need to wait for the future release.
These would be SOOO nice to have.
I usually use a CREATE OR REPLACE view. What would be the difference with that vs the DROP VIEW IF EXISTS? I am not sure I understand the difference.
Good answer there.
Drop if exists is a way of getting rid of a schema or doing nothing if the
schema already exists. That is a nice thing to do when rebuilding stuff.
Your point about "create or replace" is actually very well taken. That is
slightly better than drop followed by create because the effect should be
atomic ... that means that you can't have a collision between two processes
with one failing. You may get surprising results if the other process does
what you didn't expect, but no failures.
Sorry for the delay in responding Ali, but I think Ted handled the question for me. It's all about automation.
If I have a script that updates a view. I need to check if it exists, drop it, then create it. Or with DROP IF EXISTS, I just drop and replace every time without my script producing an error if it tries to drop it the first time.
Understood. Thanks for clarifying
Just making a note that this feature was added in Drill 1.8. Read more her: Apache Drill 1.8 Released on MapR Converged Data Platform
Retrieving data ...