[ 
https://issues.apache.org/jira/browse/DRILL-3979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14974984#comment-14974984
 ] 

Andries Engelbrecht commented on DRILL-3979:
--------------------------------------------

Most databases do not support the REPLACE clause for CTAS. With a VIEW there is 
not inherit data loss, while with CTAS there can be data loss if the existing 
table is dropped. That is part of why most databases requires an explicit DROP 
TABLE command.

Perhaps a better option would be a TEMP TABLE clause, which implies the data is 
transient.

> Add support for "replace" in CTAS similar to views
> --------------------------------------------------
>
>                 Key: DRILL-3979
>                 URL: https://issues.apache.org/jira/browse/DRILL-3979
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Query Planning & Optimization, Storage - Writer
>    Affects Versions: 1.2.0
>            Reporter: Abhishek Girish
>
> Drill could support "create or replace table" syntax, similar to the existing 
> "create or replace view" syntax. 
> Given that "drop table" is now supported, I think it might be possible to 
> support this. This could be helpful in automating tests and in SQL scripting. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to