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

Amit Singh Chowdhery commented on CASSANDRA-10411:
--------------------------------------------------

Hi Team,

I think this will take CQL little closer to SQL and will allow little more 
flexibility to user experience.

So I will pick this JIRA issue. I am thinking for the below changes(Just 
blueprint) ::

Step 1: Change in Grammar src\java\org\apache\cassandra\cql3\Cql.g , 
altertablestatement will be changed for both ADD and DROP statements. it might 
now look like :

For ADD -->

K_ADD   ( { isStatic=true; } K_STATIC)? { type = AlterTableStatement.Type.ADD; }
                    c1=cident { mColumnName.add(c1); }  v1=comparatorType { 
mValidator.add(v1); } 
                   ( ',' cn=cident { mColumnName.add(cn); }  vn=comparatorType 
{ mValidator.add(vn); } )*

For DROP -->

K_DROP  id=cident  { mColumnName.add(id); } ( ',' cn=cident { 
mColumnName.add(cn); } )* { type = AlterTableStatement.Type.DROP; }.

Step 2: After this corresponding java files will be changed to support above 
grammar changes.

Requesting you all to provide Comments/suggestions for same.

Thanks
Amit Singh Chowdhery



> Add/drop multiple columns in one ALTER TABLE statement
> ------------------------------------------------------
>
>                 Key: CASSANDRA-10411
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10411
>             Project: Cassandra
>          Issue Type: New Feature
>            Reporter: Bryn Cooke
>            Assignee: Amit Singh Chowdhery
>            Priority: Minor
>
> Currently it is only possible to add one column at a time in an alter table 
> statement. It would be great if we could add multiple columns at a time.
> The primary reason for this is that adding each column individually seems to 
> take a significant amount of time (at least on my development machine), I 
> know all the columns I want to add, but don't know them until after the 
> initial table is created.
> As a secondary consideration it brings CQL slightly closer to SQL where most 
> databases can handle adding multiple columns in one statement.



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

Reply via email to