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

Jogesh Anand commented on CASSANDRA-16916:
------------------------------------------

[~e.dimitrova] & [~blerer]- thanks! I cherry-picked the commits onto trunk PFA. 
Re-ran java tests, cqlsh tests locally.

The dtest on ALTER USER was failing because 
[here|https://github.com/apache/cassandra/pull/1422/files#diff-5435f01c80d135f7b28666e74015cc78777fd2e3deb395c56ff2e9d088e71716R1195]
 I had ifExists=true and instead of throwing an exception, it assumed that IF 
EXISTS clause was present. This suppressed the exception. Re-ran the failed 
dtests after the fix.

ran a rebase on top of the latest trunk.
 * Could you please review and run CI ?
 * Out of curiosity, when we release a new C* version, do we pick specific 
commits from trunk and then apply them on a new branch? Or do we branch off 
from trunk and cut the release from there. If the process is more involved skip 
this question. :)
 * Unlike, ALTER table _testcases_ in AlterTest.java, wherein we execute the 
stmt on a local node, I couldn't find testcases for ALTER USER stmts that run 
on the local node. These tests are present in dtests though. Is that 
intentional?

> Add support for IF EXISTS and IF NOT EXISTS in ALTER statements
> ---------------------------------------------------------------
>
>                 Key: CASSANDRA-16916
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-16916
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: CQL/Syntax
>            Reporter: Benjamin Lerer
>            Assignee: Jogesh Anand
>            Priority: Normal
>             Fix For: 4.x
>
>
> It would make sense to add support for {{IF EXISTS}} and {{IF NOT EXISTS}} in 
> the different {{ALTER}} statements. 
> For example:
> * {{ALTER TABLE IF EXISTS myTable ...}}
> * {{ALTER TABLE myTable ADD IF NOT EXISTS ...}}
> * {{ALTER TABLE myTable DROP IF EXISTS ...}}
> * {{ALTER TYPE IF EXISTS myType ...}}
> * {{ALTER TYPE myType ADD IF NOT EXISTS ...}}
> +Additional info for newcomers:+
> In order to implement this change you will need to change the {{Parser.g}} 
> ANTLR file located in the src/antlr directory and the java classes 
> corresponding to the different alter statements located in the 
> {{org.apache.cassandra.cql3.statements.schema}} package. You can look at the 
> CreateTableStatement class to see how it was done there.
> The unit test for the CQL logic are located under 
> {{org.apache.cassandra.cql3.validation}}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to