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

Sylvain Lebresne commented on CASSANDRA-2737:
---------------------------------------------

Seems a bit more complicated that what I would I gone for a priori. It seems to 
me that what we'd need for CREATE is:
# add a ifNotExist boolean to the existing statement.
# in validate, if the CF already exists, just skip throwing an exception. And 
in execute, if the CF exists, skip the creation.

And the equivalent for DROP.

Doing this wouldn't allow the user to know if the creation did happen or if it 
was already existing, but I think it's fair since you can always use the 
current statement (and catch the exception) if you care about that. I suppose 
we could alternatively return a result set with a boolean indicating if 
creation did happen, for convenience sake, but I'm not even sure that'd be so 
useful.

But refactoring QueryProcessor and adding 2 new exceptions/new statements 
sounds overkill to me.
                
> CQL: support IF EXISTS extension for DROP commands (table, keyspace, index)
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2737
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2737
>             Project: Cassandra
>          Issue Type: New Feature
>    Affects Versions: 0.8.0
>            Reporter: Cathy Daw
>            Priority: Trivial
>              Labels: cql
>             Fix For: 2.0
>
>         Attachments: 2737-concept-v1.txt
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to