Details
-
Bug
-
Status: Resolved
-
Low
-
Resolution: Duplicate
-
None
-
Low
Description
When a CF is created with a parametrized comparator, e.g.
CREATE COLUMNFAMILY paramcompar (KEY text PRIMARY KEY) WITH comparator='TimeUUIDType(reversed=true)';
or, equivalently:
CREATE COLUMNFAMILY paramcompar (KEY text PRIMARY KEY) WITH comparator='ReversedType(org.apache.cassandra.db.marshal.TimeUUIDType)';
and then a CQL query is made against any populated contents, the resulting CqlMetadata part of the response only conveys that the "default_name_type='ReversedType'". This is not very helpful to a CQL library in decoding the column name. At least in the case of python-cql, it falls back on assuming UTF8Type as a default, which almost invariably leads to errors since the bytes in most UUIDs do not represent valid utf8 bytes.
I'm not sure what the right solution is; should the CqlMetadata.default_name_type include the parentheses and the parameters used (requiring CQL libraries to be able to interpret arbitrary parameterized types, or at least the more straightforward ones), or should CQL libraries need to query for CfDefs through Thrift and interpret comparator_type, or should CqlMetadata.default_name_type only convey enough information for valid deserialization (in this case, just TimeUUIDType would have worked)? Possibly that last might require adding some sort of special interface to classes implementing AbstractType. Not at all clear how that would work with CompositeType values, although maybe we can punt on that with the direct cql3 syntactical support.
Attachments
Issue Links
- relates to
-
CASSANDRA-4004 Add support for ReversedType
- Resolved