diff --git a/pylib/cqlshlib/cql3handling.py b/pylib/cqlshlib/cql3handling.py index 958b9aee51..0e631ea5ff 100644 --- a/pylib/cqlshlib/cql3handling.py +++ b/pylib/cqlshlib/cql3handling.py @@ -1239,6 +1239,8 @@ syntax_rules += r''' | "ADD" newcol= | "DROP" existcol= | "WITH" ( "AND" )* + | "RENAME" existcol= "TO" newcol= + ( "AND" existcol= "TO" newcol= )* ; ''' diff --git a/pylib/cqlshlib/helptopics.py b/pylib/cqlshlib/helptopics.py index c9dae31c1c..cdbb8f46cb 100644 --- a/pylib/cqlshlib/helptopics.py +++ b/pylib/cqlshlib/helptopics.py @@ -902,8 +902,37 @@ class CQL3HelpTopics(CQLHelpTopics): print " HELP CREATE_USER;" def help_alter(self): - super(CQL3HelpTopics, self).help_alter() - print " HELP ALTER_USER;" + print """ + ALTER TABLE ALTER TYPE ; + ALTER TABLE ADD ; + ALTER TABLE RENAME TO + [AND TO ] + ALTER TABLE WITH = [AND = [...]]; + + An ALTER statement is used to manipulate table metadata. It allows you + to add new typed columns, drop existing columns, change the data + storage type of existing columns, or change table properties. + No results are returned. + + See one of the following for more information: + + HELP ALTER_ALTER; + HELP ALTER_ADD; + HELP ALTER_DROP; + HELP ALTER_RENAME; + HELP ALTER_WITH; + """ + + def help_alter_rename(self): + print """ + ALTER TABLE: renaming a column + + ALTER TABLE RENAME TO + [AND TO ] + + The ALTER TABLE ... RENAME variant renames a typed column in a column + family. + """ def help_drop(self): super(CQL3HelpTopics, self).help_drop()