cassandra-client-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikhail Stepura <mikhail.step...@outlook.com>
Subject Re: How should clients handle the user defined types in 2.1?
Date Tue, 25 Feb 2014 18:42:15 GMT
The driver shall parse that.
I'm not sure if there is a doc for that, but here is what I did for CQLSH

1. UserType is a CompositeType, where 1s subtype is a KS name, and 2nd 
is hex-encoded name of the type
2. Remainder of subtypes are types of Usertype's columns. So you can 
easily decode *values* for fields
3. Information about field *names* is stored in system.schema_usertypes 
table
4. The driver has to combine pieces 1-3 and create a new class/type for 
a user. It was easy in Python, I guess it should be easy in Ruby as well

-M


On 2/22/14, 12:29, Theo Hultberg wrote:
> Hi,
>
> Is there any documentation on how CQL clients should handle the new user
> defined types coming in 2.1? There's nothing in the protocol specification
> on how to handle custom types as far as I can understand.
>
> For example, I tried creating the "address" type from the description of
> CASSANDRA-5590, and this is how its metadata looks (the metadata for a
> query contains a column with a custom type and this is the description of
> it):
>
> org.apache.cassandra.db.marshal.UserType(user_defined_types,61646472657373,737472656574:org.apache.cassandra.db.marshal.UTF8Type,63697479:org.apache.cassandra.db.marshal.UTF8Type,7a69705f636f6465:org.apache.cassandra.db.marshal.Int32Type,70686f6e6573:org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type))
>
> Is the client supposed to parse that description, and in that case how? I
> could probably figure it out but it would be great if someone could point
> me to the right docs.
>
> yours,
> Theo (author of cql-rb, the Ruby driver)
>



Mime
View raw message