You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Amit Singh Chowdhery (JIRA)" <ji...@apache.org> on 2015/12/30 12:56:49 UTC

[jira] [Comment Edited] (CASSANDRA-10411) Add/drop multiple columns in one ALTER TABLE statement

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

Amit Singh Chowdhery edited comment on CASSANDRA-10411 at 12/30/15 11:56 AM:
-----------------------------------------------------------------------------

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.

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




was (Author: achowdhe):
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
>              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)