diff --git a/CHANGES.txt b/CHANGES.txt index c7bbed34a0..d7a0a03b6d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -3,6 +3,7 @@ * Add the ability to disable bulk loading of SSTables (CASSANDRA-18781) * Clean up obsolete functions and simplify cql_version handling in cqlsh (CASSANDRA-18787) Merged from 5.0: + * Upgrade Python driver to 3.28.0 (CASSANDRA-18960) * Add retries to IR messages (CASSANDRA-18962) * Add metrics and logging to repair retries (CASSANDRA-18952) * Remove deprecated code in Cassandra 1.x and 2.x (CASSANDRA-18959) diff --git a/lib/cassandra-driver-internal-only-3.25.0.zip b/lib/cassandra-driver-internal-only-3.25.0.zip deleted file mode 100644 index ecfd6a946e..0000000000 Binary files a/lib/cassandra-driver-internal-only-3.25.0.zip and /dev/null differ diff --git a/lib/cassandra-driver-internal-only-3.28.0.zip b/lib/cassandra-driver-internal-only-3.28.0.zip new file mode 100644 index 0000000000..07e0379447 Binary files /dev/null and b/lib/cassandra-driver-internal-only-3.28.0.zip differ diff --git a/pylib/cqlshlib/formatting.py b/pylib/cqlshlib/formatting.py index e384221f7f..cdf36e0c53 100644 --- a/pylib/cqlshlib/formatting.py +++ b/pylib/cqlshlib/formatting.py @@ -148,8 +148,8 @@ class CqlType: def parse(self, typestring, ksmeta): """ Parse the typestring by looking at this pattern: *<*>. If there is no match then the type - is either a simple type or a user type, otherwise it must be a composite type - for which we need to look-up the sub-types. For user types the sub types can be extracted + is either a simple type or a user type, otherwise it must be a composite type or a vector type, + for which we need to look up the subtypes. For user types the subtypes can be extracted from the keyspace metadata. """ while True: @@ -166,8 +166,15 @@ class CqlType: typestring = m.group(2) continue - name = m.group(1) # a composite type, parse sub types - return name, self.parse_sub_types(m.group(2), ksmeta), self._get_formatter(name) + name = m.group(1) # a composite or vector type, parse subtypes + try: + # Vector types are parameterized as name so add custom handling for that here + type_args = m.group(2).split(',') + vector_type = CqlType(type_args[0]) + vector_size = int(type_args[1]) + return name, [vector_type for _ in range(vector_size)], self._get_formatter(name) + except (ValueError, IndexError): + return name, self.parse_sub_types(m.group(2), ksmeta), self._get_formatter(name) @staticmethod def _get_formatter(name): diff --git a/pylib/cqlshlib/test/test_cqlsh_output.py b/pylib/cqlshlib/test/test_cqlsh_output.py index 3cb6d51300..65ac5be482 100644 --- a/pylib/cqlshlib/test/test_cqlsh_output.py +++ b/pylib/cqlshlib/test/test_cqlsh_output.py @@ -935,6 +935,28 @@ class TestCqlshOutput(BaseTestCase): """), )) + def test_vectors_output(self): + self.assertQueriesGiveColoredOutput(( + ("SELECT vectorcol FROM has_all_types;", r""" + vectorcol + MMMMMMMMM + ----------------------- + + [1, -2, NaN] + BGBBGGBBGGGB + [1, 2, 3] + BGBBGBBGB + [0, 0, 0] + BGBBGBBGB + null + RRRR + [1e+08, 1e+08, 1e+08] + BGGGGGBBGGGGGBBGGGGGB + + (5 rows) + """), + )) + def test_expanded_output_counts_past_page(self): query = "PAGING 5; EXPAND ON; SELECT * FROM twenty_rows_table;" output, result = cqlsh_testcall(prompt=None, env=self.default_env,