You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by al...@apache.org on 2013/06/26 19:42:10 UTC

git commit: cqlsh: Add ALTER TABLE RENAME autocompletion and docs

Updated Branches:
  refs/heads/cassandra-1.2 40112ec95 -> b97b490df


cqlsh: Add ALTER TABLE RENAME autocompletion and docs


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b97b490d
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b97b490d
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b97b490d

Branch: refs/heads/cassandra-1.2
Commit: b97b490dffda91284befa9049255ae477ea8114c
Parents: 40112ec
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Wed Jun 26 20:41:38 2013 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Wed Jun 26 20:41:38 2013 +0300

----------------------------------------------------------------------
 pylib/cqlshlib/cql3handling.py |  2 ++
 pylib/cqlshlib/helptopics.py   | 33 +++++++++++++++++++++++++++++++--
 2 files changed, 33 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b97b490d/pylib/cqlshlib/cql3handling.py
----------------------------------------------------------------------
diff --git a/pylib/cqlshlib/cql3handling.py b/pylib/cqlshlib/cql3handling.py
index 958b9ae..0e631ea 100644
--- a/pylib/cqlshlib/cql3handling.py
+++ b/pylib/cqlshlib/cql3handling.py
@@ -1239,6 +1239,8 @@ syntax_rules += r'''
                       | "ADD" newcol=<cident> <storageType>
                       | "DROP" existcol=<cident>
                       | "WITH" <cfamProperty> ( "AND" <cfamProperty> )*
+                      | "RENAME" existcol=<cident> "TO" newcol=<cident>
+                         ( "AND" existcol=<cident> "TO" newcol=<cident> )*
                       ;
 '''
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b97b490d/pylib/cqlshlib/helptopics.py
----------------------------------------------------------------------
diff --git a/pylib/cqlshlib/helptopics.py b/pylib/cqlshlib/helptopics.py
index c9dae31..cdbb8f4 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 <tablename> ALTER <columnname> TYPE <type>;
+        ALTER TABLE <tablename> ADD <columnname> <type>;
+        ALTER TABLE <tablename> RENAME <columnname> TO <columnname>
+            [AND <columnname> TO <columnname>]
+        ALTER TABLE <tablename> WITH <optionname> = <val> [AND <optionname> = <val> [...]];
+
+        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 <tablename> RENAME <columnname> TO <columnname>
+              [AND <columnname> TO <columnname>]
+
+        The ALTER TABLE ... RENAME variant renames a typed column in a column
+        family.
+        """
 
     def help_drop(self):
         super(CQL3HelpTopics, self).help_drop()