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

Robert Stupp commented on CASSANDRA-10411:
------------------------------------------

I’d prefer to have just one {{List}} passed into {{AlterTypeStatement}} instead 
of 3 lists. That one list could contain one object per column like 
{{AlterTableStatementColumn}} or so. Having that, the code in Cql.g should 
become easier, too.

Can you add unit tests for these duplicate column names (implementation works 
fine, just for safety)?
* {{ALTER TABLE foo ADD (colname int, colname int)}}
* {{ALTER TABLE foo DROP (colname, colname)}}

Unit tests:
* the {{assertRows}} and {{INSERT INTO}} statements basically test nothing. 
However it would be good to insert data after the {{ALTER TABLE ADD}} / 
{{DROP}} statements to check whether the correct columns/data are returned.

Code style:
* {{Cql.g}}: the lines below {{K_ADD}} and {{K_DROP}} should be indented
* uses tabs for indention (must be spaces)
* superfluous {{@Override}} annotations in {{AlterTableStatement}} (we only add 
these for overridden non-abstract methods)
* noop changes to import-section in {{AlterTableStatement}}
* indention for the loops in {{AlterTableStatement}} is off (sometimes 1 space, 
sometimes two). (Maybe my previous statement about indention caused this.)
* annotations (like {{@Test}}) should be placed directly before the method and 
after the javadoc

Beside that the code does what it’s about to do. So, I’d commit it as soon as 
the issues above are addresses.

> 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
>         Attachments: Cassandra-10411-trunk.diff, 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