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

Amit Singh Chowdhery edited comment on CASSANDRA-10411 at 12/30/15 1:22 PM:
----------------------------------------------------------------------------

In this patch , multiple columns addition and deletion has been entertained. 
New syntax for Addition will be :

Alter table tablename add ( col1 datatype <static>,col2 datatype.......coln 
datatype  <static>);

New Syntax for deletion will be :

Alter table tablename drop (col1,col2,col3.....col n);

One can add single add and drop in same way which was earlier supported like :

Alter table tablename drop col1;
Alter table tablename add col1 datatype <static>;

Currently attached patch is for branch 2.0.x , In case you find any issues in 
auto merging the change on 2.1,2.2 or 3 , please let me know , i will submit 
separate patches for that.


was (Author: achowdhe):
In this patch , multiple columns addition and deletion has been entertained. 
New syntax for Addition will be :

Alter table tablename add ( col1 datatype <static>,col2 datatype.......coln 
datatype  <static>);

New Syntax for deletion will be :

Alter table tablename drop (col1,col2,col3.....col n);

One can add single add and drop in same way which was earlier supported like :

Alter table tablename drop col1;
Alter table tablename add col1 datatype <static>;

Currently attached patch is for branch 2.0.x , In case to support for higher 
branches , please let me know i will upload that patch also.

> 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
>              Labels: patch
>             Fix For: 2.0.17
>
>         Attachments: cassandra-10411.diff
>
>
> 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