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

MichaƂ Michalski commented on CASSANDRA-2737:
---------------------------------------------

Thanks for reply, Sylvain!

I definitely agree that my solution has some overhead and your is much simpler, 
but one of the things I aimed for was to distinguish the "critical" exceptions 
from the ones that can be handled by such "IF (NOT) EXISTS" extensions, so - in 
the end - it could be possible to let user know what really happened and, 
maybe, display some descriptive NOTICE message instead of displaying nothing (I 
was a bit "inspired" in how it's reported in PostgreSQL in similar case). 
However, if you say it's not necessary, I'm fine with it :-) 

Additionally, in most of the cases validation checking if KS/CF/Index exists 
(or not) happens outside *Statement classes (for example for CFs it's done in 
MigrationManager.announceColumnFamilyDrop()) and I didn't like the idea of 
passing additional parameter and handling it there - I preferred this decision 
(if exception should be thrown or not) to be done by *Statement class itself, 
basing on what was returned/thrown by MigrationManager. 

One thing I missed when coding was the fact that for KS/CF, when reporting 
existing / inexistent KS/CF,  ConfigurationException is thrown (index-related 
code throws InvalidRequestException, which looks like a little inconsistency to 
me, by the way), so I could have reused it, instead of creating new ones.

Anyway, I see your point :-) Tomorrow I'm leaving for three weeks and when I'm 
back I'll reimplement it taking your suggestions into account :-)
                
> 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