cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amit Singh Chowdhery (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-10411) Add/drop multiple columns in one ALTER TABLE statement
Date Fri, 27 Nov 2015 05:58:11 GMT


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.

Amit Singh Chowdhery

> Add/drop multiple columns in one ALTER TABLE statement
> ------------------------------------------------------
>                 Key: CASSANDRA-10411
>                 URL:
>             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

View raw message