cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Stupp (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CASSANDRA-12055) UDT named 'return' causes error in DESC TABLE
Date Wed, 22 Jun 2016 12:52:57 GMT
Robert Stupp created CASSANDRA-12055:
----------------------------------------

             Summary: UDT named 'return' causes error in DESC TABLE
                 Key: CASSANDRA-12055
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-12055
             Project: Cassandra
          Issue Type: Bug
            Reporter: Robert Stupp
            Priority: Minor


Having a schema like
{code}
CREATE TYPE foo.return ( a int, order_id text, b int, c text );
CREATE TABLE foo.bar ( pk int PRIMARY KEY,returns frozen<list<frozen<return>>>
);
{code}
created in 2.2.6.

Executing {{DESC TABLE}} causes cqlsh to error out, if it's executed from 2.2 branch - but
funnily it works fine with cqlsh on trunk. Funnily because both 2.2 and trunk use the same
driver version and I don't really get what's different there.

The error message on 2.2.3 (using driver version 2.7.2) on the original cluster is:
{code}
Warning: Table abcd.efgh is incomplete because of an error processing metadata.
Traceback (most recent call last):
  File "/usr/share/cassandra/lib/cassandra-driver-internal-only-2.7.2.zip/cassandra-driver-2.7.2/cassandra/metadata.py",
line 438, in _build_table_metadata
    column_meta = self._build_column_metadata(table_meta, col_row)
  File "/usr/share/cassandra/lib/cassandra-driver-internal-only-2.7.2.zip/cassandra-driver-2.7.2/cassandra/metadata.py",
line 471, in _build_column_metadata
    data_type = types.lookup_casstype(row["validator"])
  File "/usr/share/cassandra/lib/cassandra-driver-internal-only-2.7.2.zip/cassandra-driver-2.7.2/cassandra/cqltypes.py",
line 184, in lookup_casstype
    raise ValueError("Don't know how to parse type string %r: %s" % (casstype, e))
ValueError: Don't know how to parse type string u'org.apache.cassandra.db.marshal.FrozenType(org.apache.cassandra.db.marshal.ListType(org.apache.cassandra.db.marshal.UserType(foo,72657475726e,...:org.apache.cassandra.db.marshal.Int32Type,...:org.apache.cassandra.db.marshal.UTF8Type,...:org.apache.cassandra.db.marshal.Int32Type,...:org.apache.cassandra.db.marshal.UTF8Type)))':
Type names and field names cannot be a keyword: 'return'
{code}

The error message on latest 2.2 is:
{code}
Warning: Table foo.bar is incomplete because of an error processing metadata.
Traceback (most recent call last):
  File "/Users/snazy/devel/cassandra/2.2/bin/../lib/cassandra-driver-internal-only-3.0.0-6af642d.zip/cassandra-driver-3.0.0-6af642d/cassandra/metadata.py",
line 1893, in _build_table_metadata
    column_meta = self._build_column_metadata(table_meta, col_row)
  File "/Users/snazy/devel/cassandra/2.2/bin/../lib/cassandra-driver-internal-only-3.0.0-6af642d.zip/cassandra-driver-3.0.0-6af642d/cassandra/metadata.py",
line 1931, in _build_column_metadata
    data_type = types.lookup_casstype(type_string)
  File "/Users/snazy/devel/cassandra/2.2/bin/../lib/cassandra-driver-internal-only-3.0.0-6af642d.zip/cassandra-driver-3.0.0-6af642d/cassandra/cqltypes.py",
line 182, in lookup_casstype
    return parse_casstype_args(casstype)
  File "/Users/snazy/devel/cassandra/2.2/bin/../lib/cassandra-driver-internal-only-3.0.0-6af642d.zip/cassandra-driver-3.0.0-6af642d/cassandra/cqltypes.py",
line 150, in parse_casstype_args
    prev_types[-1] = prev_types[-1].apply_parameters(types, names)
  File "/Users/snazy/devel/cassandra/2.2/bin/../lib/cassandra-driver-internal-only-3.0.0-6af642d.zip/cassandra-driver-3.0.0-6af642d/cassandra/cqltypes.py",
line 883, in apply_parameters
    return cls.make_udt_class(keyspace, udt_name, field_names, tuple(subtypes[2:]))
  File "/Users/snazy/devel/cassandra/2.2/bin/cqlsh.py", line 632, in new_make_udt_class
    formatter_for(udt_class.tuple_type.__name__)(format_value_utype)
AttributeError: 'NoneType' object has no attribute '__name__'
{code}

Both seem to be caused by the UDT name {{return}} (which is not a wise choice).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message