You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by aw...@apache.org on 2017/11/15 21:46:37 UTC

[09/50] cassandra git commit: Handle index order in describe output on 2.1

Handle index order in describe output on 2.1

Patch by Joel Knighton; reviewed by Philip Thompson


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

Branch: refs/heads/master
Commit: d040629b2a71286105346c3cc637f8d1e16cf0a1
Parents: cc355ff
Author: Joel Knighton <jk...@apache.org>
Authored: Wed Jul 12 16:56:08 2017 -0500
Committer: Joel Knighton <jk...@apache.org>
Committed: Thu Jul 13 15:17:52 2017 -0500

----------------------------------------------------------------------
 cqlsh_tests/cqlsh_tests.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d040629b/cqlsh_tests/cqlsh_tests.py
----------------------------------------------------------------------
diff --git a/cqlsh_tests/cqlsh_tests.py b/cqlsh_tests/cqlsh_tests.py
index e7bc11c..418b9f7 100644
--- a/cqlsh_tests/cqlsh_tests.py
+++ b/cqlsh_tests/cqlsh_tests.py
@@ -913,6 +913,9 @@ VALUES (4, blobAsInt(0x), '', blobAsBigint(0x), 0x, blobAsBoolean(0x), blobAsDec
             return ret + "\n" + col_idx_def
 
     def get_users_table_output(self):
+        quoted_index_output = self.get_index_output('"QuotedNameIndex"', 'test', 'users', 'firstname')
+        myindex_output = self.get_index_output('myindex', 'test', 'users', 'age')
+
         if self.cluster.version() >= LooseVersion('3.9'):
             return """
         CREATE TABLE test.users (
@@ -934,8 +937,7 @@ VALUES (4, blobAsInt(0x), '', blobAsBigint(0x), 0x, blobAsBoolean(0x), blobAsDec
             AND min_index_interval = 128
             AND read_repair_chance = 0.0
             AND speculative_retry = '99PERCENTILE';
-        """ + self.get_index_output('"QuotedNameIndex"', 'test', 'users', 'firstname') \
-                   + "\n" + self.get_index_output('myindex', 'test', 'users', 'age')
+        """ + quoted_index_output + "\n" + myindex_output
         elif self.cluster.version() >= LooseVersion('3.0'):
             return """
         CREATE TABLE test.users (
@@ -957,8 +959,7 @@ VALUES (4, blobAsInt(0x), '', blobAsBigint(0x), 0x, blobAsBoolean(0x), blobAsDec
             AND min_index_interval = 128
             AND read_repair_chance = 0.0
             AND speculative_retry = '99PERCENTILE';
-        """ + self.get_index_output('"QuotedNameIndex"', 'test', 'users', 'firstname') \
-                   + "\n" + self.get_index_output('myindex', 'test', 'users', 'age')
+        """ + quoted_index_output + "\n" + myindex_output
         else:
             return """
         CREATE TABLE test.users (
@@ -979,8 +980,8 @@ VALUES (4, blobAsInt(0x), '', blobAsBigint(0x), 0x, blobAsBoolean(0x), blobAsDec
             AND min_index_interval = 128
             AND read_repair_chance = 0.0
             AND speculative_retry = '99.0PERCENTILE';
-        """ + self.get_index_output('QuotedNameIndex', 'test', 'users', 'firstname') \
-                   + "\n" + self.get_index_output('myindex', 'test', 'users', 'age')
+        """ + (quoted_index_output + "\n" + myindex_output if self.cluster.version() >= LooseVersion('2.2') else
+               myindex_output + "\n" + quoted_index_output)
 
     def get_index_output(self, index, ks, table, col):
         # a quoted index name (e.g. "FooIndex") is only correctly echoed by DESCRIBE


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org