From 7fdcbd0b433f9c30459f17527a05e5a87eb8efab Mon Sep 17 00:00:00 2001 From: Dave Brosius Date: Sun, 22 Sep 2013 23:44:05 -0400 Subject: [PATCH] add help topic COMPOUND_PRIMARY_KEYS for cqlsh patch by dbrosius reviewed by jbellis for cassandra-6076 --- pylib/cqlshlib/helptopics.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pylib/cqlshlib/helptopics.py b/pylib/cqlshlib/helptopics.py index cdbb8f46cb..5130a23c0c 100644 --- a/pylib/cqlshlib/helptopics.py +++ b/pylib/cqlshlib/helptopics.py @@ -226,7 +226,7 @@ class CQLHelpTopics(object): CollatingOrderPreservingPartitioner both require UTF-8 keys. In cql3 mode, a table can have multiple columns composing the primary - key (see HELP COMPOSITE_PRIMARY_KEYS). + key (see HELP COMPOUND_PRIMARY_KEYS). For more information, see one of the following: @@ -235,6 +235,22 @@ class CQLHelpTopics(object): """ help_create_columnfamily = help_create_table + def help_compound_primary_keys(self): + print """ + CREATE TABLE ( , type, type, + [, ...]], PRIMARY KEY (, , ); + + CREATE TABLE allows a primary key composed of multiple columns. When this is the case, specify + the columns that take part in the compound key after all columns have been specified. + + , PRIMARY KEY( , , ... ) + + The partitioning key itself can be a compound key, in which case the first element of the PRIMARY KEY + phrase should be parenthesized, as + + PRIMARY KEY ((, ), ) + """ + def help_create_table_types(self): print """ CREATE TABLE: Specifying column types