10753-3.0 patch

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

Branch: refs/heads/trunk
Commit: 803a3d901141dcef4bcfce78b568300b283713e4
Parents: 25a1e89
Author: Stefania <stefania.alborghe...@datastax.com>
Authored: Tue Dec 1 13:56:03 2015 -0500
Committer: Joshua McKenzie <jmcken...@apache.org>
Committed: Tue Dec 1 13:56:03 2015 -0500

----------------------------------------------------------------------
 ...andra-driver-internal-only-3.0.0-6af642d.zip | Bin 0 -> 228893 bytes
 ...iver-internal-only-3.0.0a3.post0-3f15725.zip | Bin 234113 -> 0 bytes
 pylib/cqlshlib/cql3handling.py                  |  36 +++++++++----------
 pylib/cqlshlib/test/test_cqlsh_completion.py    |  10 +++---
 pylib/cqlshlib/test/test_cqlsh_output.py        |  15 --------
 5 files changed, 23 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/803a3d90/lib/cassandra-driver-internal-only-3.0.0-6af642d.zip
----------------------------------------------------------------------
diff --git a/lib/cassandra-driver-internal-only-3.0.0-6af642d.zip 
b/lib/cassandra-driver-internal-only-3.0.0-6af642d.zip
new file mode 100644
index 0000000..507370b
Binary files /dev/null and 
b/lib/cassandra-driver-internal-only-3.0.0-6af642d.zip differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/803a3d90/lib/cassandra-driver-internal-only-3.0.0a3.post0-3f15725.zip
----------------------------------------------------------------------
diff --git a/lib/cassandra-driver-internal-only-3.0.0a3.post0-3f15725.zip 
b/lib/cassandra-driver-internal-only-3.0.0a3.post0-3f15725.zip
deleted file mode 100644
index b9afb58..0000000
Binary files a/lib/cassandra-driver-internal-only-3.0.0a3.post0-3f15725.zip and 
/dev/null differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/803a3d90/pylib/cqlshlib/cql3handling.py
----------------------------------------------------------------------
diff --git a/pylib/cqlshlib/cql3handling.py b/pylib/cqlshlib/cql3handling.py
index 9ba4122..25cf427 100644
--- a/pylib/cqlshlib/cql3handling.py
+++ b/pylib/cqlshlib/cql3handling.py
@@ -787,21 +787,20 @@ def relation_token_subject_completer(ctxt, cass):
 @completer_for('relation', 'rel_lhs')
 def select_relation_lhs_completer(ctxt, cass):
     layout = get_table_meta(ctxt, cass)
-    filterable = set((layout.partition_key[0].name, 
layout.clustering_key[0].name))
+    filterable = set()
     already_filtered_on = map(dequote_name, ctxt.get_binding('rel_lhs', ()))
-    for num in range(1, len(layout.partition_key)):
-        if layout.partition_key[num - 1].name in already_filtered_on:
+    for num in range(0, len(layout.partition_key)):
+        if num == 0 or layout.partition_key[num - 1].name in 
already_filtered_on:
             filterable.add(layout.partition_key[num].name)
         else:
             break
-    for num in range(1, len(layout.clustering_key)):
-        if layout.clustering_key[num - 1].name in already_filtered_on:
+    for num in range(0, len(layout.clustering_key)):
+        if num == 0 or layout.clustering_key[num - 1].name in 
already_filtered_on:
             filterable.add(layout.clustering_key[num].name)
         else:
             break
-    for cd in layout.columns.values():
-        if cd.index:
-            filterable.add(cd.name)
+    for idx in layout.indexes.itervalues():
+        filterable.add(idx.index_options["target"])
     return map(maybe_escape_name, filterable)
 
 explain_completion('selector', 'colname')
@@ -850,16 +849,16 @@ def insert_newval_completer(ctxt, cass):
     if len(valuesdone) >= len(insertcols):
         return []
     curcol = insertcols[len(valuesdone)]
-    cqltype = layout.columns[curcol].data_type
-    coltype = cqltype.typename
+    coltype = layout.columns[curcol].cql_type
     if coltype in ('map', 'set'):
         return ['{']
     if coltype == 'list':
         return ['[']
     if coltype == 'boolean':
         return ['true', 'false']
+
     return [Hint('<value for %s (%s)>' % (maybe_escape_name(curcol),
-                                          cqltype.cql_parameterized_type()))]
+                                          coltype))]
 
 
 @completer_for('insertStatement', 'valcomma')
@@ -919,29 +918,28 @@ def update_col_completer(ctxt, cass):
 def update_countername_completer(ctxt, cass):
     layout = get_table_meta(ctxt, cass)
     curcol = dequote_name(ctxt.get_binding('updatecol', ''))
-    cqltype = layout.columns[curcol].data_type
-    coltype = cqltype.typename
+    coltype = layout.columns[curcol].cql_type
     if coltype == 'counter':
         return [maybe_escape_name(curcol)]
     if coltype in ('map', 'set'):
         return ["{"]
     if coltype == 'list':
         return ["["]
-    return [Hint('<term (%s)>' % cqltype.cql_parameterized_type())]
+    return [Hint('<term (%s)>' % coltype)]
 
 
 @completer_for('assignment', 'counterop')
 def update_counterop_completer(ctxt, cass):
     layout = get_table_meta(ctxt, cass)
     curcol = dequote_name(ctxt.get_binding('updatecol', ''))
-    return ['+', '-'] if layout.columns[curcol].data_type.typename == 
'counter' else []
+    return ['+', '-'] if layout.columns[curcol].cql_type == 'counter' else []
 
 
 @completer_for('assignment', 'inc')
 def update_counter_inc_completer(ctxt, cass):
     layout = get_table_meta(ctxt, cass)
     curcol = dequote_name(ctxt.get_binding('updatecol', ''))
-    if layout.columns[curcol].data_type.typename == 'counter':
+    if layout.columns[curcol].cql_type == 'counter':
         return [Hint('<wholenumber>')]
     return []
 
@@ -967,7 +965,7 @@ def update_listcol_completer(ctxt, cass):
 def update_indexbracket_completer(ctxt, cass):
     layout = get_table_meta(ctxt, cass)
     curcol = dequote_name(ctxt.get_binding('updatecol', ''))
-    coltype = layout.columns[curcol].data_type.typename
+    coltype = layout.columns[curcol].cql_type
     if coltype in ('map', 'list'):
         return ['[']
     return []
@@ -1199,8 +1197,10 @@ explain_completion('createUserTypeStatement', 'newcol', 
'<new_field_name>')
 
 @completer_for('createIndexStatement', 'col')
 def create_index_col_completer(ctxt, cass):
+    """ Return the columns for which an index doesn't exist yet. """
     layout = get_table_meta(ctxt, cass)
-    colnames = [cd.name for cd in layout.columns.values() if not cd.index]
+    idx_targets = [idx.index_options["target"] for idx in 
layout.indexes.itervalues()]
+    colnames = [cd.name for cd in layout.columns.values() if cd.name not in 
idx_targets]
     return map(maybe_escape_name, colnames)
 
 syntax_rules += r'''

http://git-wip-us.apache.org/repos/asf/cassandra/blob/803a3d90/pylib/cqlshlib/test/test_cqlsh_completion.py
----------------------------------------------------------------------
diff --git a/pylib/cqlshlib/test/test_cqlsh_completion.py 
b/pylib/cqlshlib/test/test_cqlsh_completion.py
index 84d7ca6..3596a75 100644
--- a/pylib/cqlshlib/test/test_cqlsh_completion.py
+++ b/pylib/cqlshlib/test/test_cqlsh_completion.py
@@ -341,18 +341,18 @@ class TestCqlshCompletion(CqlshCompletionCase):
         self.trycompletions("UPDATE empty_table SET lonelycol = 'eggs'",
                             choices=[',', 'WHERE'])
         self.trycompletions("UPDATE empty_table SET lonelycol = 'eggs' WHERE ",
-                            choices=['TOKEN(', '<identifier>', '<quotedName>'])
+                            choices=['TOKEN(', 'lonelykey'])
         self.trycompletions("UPDATE empty_table SET lonelycol = 'eggs' WHERE ",
-                            choices=['TOKEN(', '<identifier>', '<quotedName>'])
+                            choices=['TOKEN(', 'lonelykey'])
 
         self.trycompletions("UPDATE empty_table SET lonelycol = 'eggs' WHERE 
lonel",
-                            choices=['<quotedName>', '<identifier>'])
+                            immediate='ykey ')
         self.trycompletions("UPDATE empty_table SET lonelycol = 'eggs' WHERE 
lonelykey ",
                             choices=['=', '<=', '>=', '>', '<', 'CONTAINS', 
'IN', '['])
         self.trycompletions("UPDATE empty_table SET lonelycol = 'eggs' WHERE 
lonelykey = 0.0 ",
                             choices=['AND', 'IF', ';'])
         self.trycompletions("UPDATE empty_table SET lonelycol = 'eggs' WHERE 
lonelykey = 0.0 AND ",
-                            choices=['TOKEN(', '<identifier>', '<quotedName>'])
+                            choices=['TOKEN(', 'lonelykey'])
 
         self.trycompletions("UPDATE empty_table SET lonelycol = 'eggs' WHERE 
TOKEN(lonelykey ",
                             choices=[',', ')'])
@@ -656,7 +656,7 @@ class TestCqlshCompletion(CqlshCompletionCase):
                                     'timestamp_resolution', 'min_threshold', 
'class', 'max_threshold',
                                     'tombstone_compaction_interval', 
'tombstone_threshold',
                                     'enabled', 
'unchecked_tombstone_compaction',
-                                    'only_purge_repaired_tombstones'])
+                                    'max_window_size_seconds', 
'only_purge_repaired_tombstones'])
 
     def test_complete_in_create_columnfamily(self):
         self.trycompletions('CREATE C', choices=['COLUMNFAMILY', 'CUSTOM'])

http://git-wip-us.apache.org/repos/asf/cassandra/blob/803a3d90/pylib/cqlshlib/test/test_cqlsh_output.py
----------------------------------------------------------------------
diff --git a/pylib/cqlshlib/test/test_cqlsh_output.py 
b/pylib/cqlshlib/test/test_cqlsh_output.py
index 7a1481c..cfaa395 100644
--- a/pylib/cqlshlib/test/test_cqlsh_output.py
+++ b/pylib/cqlshlib/test/test_cqlsh_output.py
@@ -369,21 +369,6 @@ class TestCqlshOutput(BaseTestCase):
             """),
         ), env={'TZ': 'Etc/UTC'})
 
-        self.assertQueriesGiveColoredOutput((
-            ('''select timestampcol from has_all_types where num = 0;''', """
-             timestampcol
-             MMMMMMMMMMMM
-            --------------------------
-
-             2012-05-14 07:53:20-0500
-             GGGGGGGGGGGGGGGGGGGGGGGG
-
-
-            (1 rows)
-            nnnnnnnn
-            """),
-        ), env={'TZ': 'EST'})
-
     def test_boolean_output(self):
         self.assertCqlverQueriesGiveColoredOutput((
             ('select num, booleancol from has_all_types where num in (0, 1, 2, 
3);', """

Reply via email to