[
https://issues.apache.org/jira/browse/CASSANDRA-11274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15173076#comment-15173076
]
Stefania commented on CASSANDRA-11274:
--------------------------------------
This is ready for review [~aholmber]:
|[patch|https://github.com/stef1927/cassandra/commits/11274]|[dtests
patch|https://github.com/stef1927/cassandra-dtest/commits/11274]|[dtests
results|http://cassci.datastax.com/view/Dev/view/stef1927/job/stef1927-11274-dtest/]|
The code is similar to what you already reviewed for CASSANDRA-11053 but it has
been extended to cope better with user types so that we no longer override
{{UserType.udt_apply_parameters}} and {{UserType.make_udt_class}}. The parsing
of the CQL type string has been encapsulated in a class called {{CqlType}} and
defined in the formatting package. It is the same basic algorithm as before
except that we use recursion to better represent sub-types and for user types
we get the sub-type names from the keyspace metadata.
There is still one driver deserialization method that is overridden by cqlsh:
{{cassandra.cqltypes.DateType.deserialize}}. This has nothing to do with
formatting and so I did not change it. Will this cause us problems when running
the driver with cython extensions?
> cqlsh: interpret CQL type for formatting blob types
> ---------------------------------------------------
>
> Key: CASSANDRA-11274
> URL: https://issues.apache.org/jira/browse/CASSANDRA-11274
> Project: Cassandra
> Issue Type: Improvement
> Components: Tools
> Reporter: Stefania
> Assignee: Stefania
> Fix For: 3.x
>
>
> During the development of CASSANDRA-11053 we have added changes to the cqlsh
> formatting code so that we can format {{blob}} types correctly even if they
> are represented as {{str}} rather than {{bytearray}}.
> At the moment we ensure {{blob}} are of type {{bytearray}} via the following
> shortcut:
> {code}
> cassandra.cqltypes.BytesType.deserialize = staticmethod(lambda byts,
> protocol_version: bytearray(byts))
> {code}
> After CASSANDRA-11053 is committed there will be a similar shortcut to
> override the fast serializers implemented in cython.
> Decoding the CQL type is safer in that it decouples cqlsh formatting from the
> types returned by the driver deserializers but it is also unnecessary for
> CASSANDRA-11053 performance goals and risky for older releases.
> Therefore this ticket delivers this functionality but only on trunk.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)