Re: User Defined Types?
Thanks a lot Anup! :-) On Mon, Aug 6, 2018 at 5:45 AM, Anup Shirolkar < anup.shirol...@instaclustr.com> wrote: > Hi, > > Few of the caveats can be found here: > https://issues.apache.org/jira/browse/CASSANDRA-7423 > > The JIRA is implemented in version *3.6* and you are on 3.0, > So you are affected by UDT behaviour (stored as BLOB) mentioned in the > JIRA. > > Cheers, > Anup > > On 5 August 2018 at 23:29, shalom sagges wrote: > >> Hi All, >> >> Are there any known caveats for User Defined Types in Cassandra (version >> 3.0)? >> One of our teams wants to start using them. I wish to assess it and see >> if it'd be wise (or not) to refrain from using UDTs. >> >> >> Thanks! >> > > > > -- > > Anup Shirolkar > > Consultant > > +61 420 602 338 > > <https://www.instaclustr.com/solutions/managed-apache-kafka/> > > <https://www.facebook.com/instaclustr> <https://twitter.com/instaclustr> ><https://www.linkedin.com/company/instaclustr> > > Read our latest technical blog posts here > <https://www.instaclustr.com/blog/>. >
Re: User Defined Types?
Hi, Few of the caveats can be found here: https://issues.apache.org/jira/browse/CASSANDRA-7423 The JIRA is implemented in version *3.6* and you are on 3.0, So you are affected by UDT behaviour (stored as BLOB) mentioned in the JIRA. Cheers, Anup On 5 August 2018 at 23:29, shalom sagges wrote: > Hi All, > > Are there any known caveats for User Defined Types in Cassandra (version > 3.0)? > One of our teams wants to start using them. I wish to assess it and see if > it'd be wise (or not) to refrain from using UDTs. > > > Thanks! > -- Anup Shirolkar Consultant +61 420 602 338 <https://www.instaclustr.com/solutions/managed-apache-kafka/> <https://www.facebook.com/instaclustr> <https://twitter.com/instaclustr> <https://www.linkedin.com/company/instaclustr> Read our latest technical blog posts here <https://www.instaclustr.com/blog/>.
User Defined Types?
Hi All, Are there any known caveats for User Defined Types in Cassandra (version 3.0)? One of our teams wants to start using them. I wish to assess it and see if it'd be wise (or not) to refrain from using UDTs. Thanks!
Any notion of unions in C* user-defined types?
Hi all, I am building an application that keeps a time-series record of clickstream data (clicks, impressions, etc.). The data model looks something like: CREATE TABLE clickstream ( userid text, event_time timestamp, interaction frozen interaction_type, PRIMARY KEY (userid, timestamp) ) WITH CLUSTERING ORDER BY (event_time DESC); I would like to create a user-defined type interaction_type such that it can be different depending on whether the interaction was a click, view, etc. Previously we encoded such data with Avro, using Avro's unions ( http://avro.apache.org/docs/1.7.5/idl.html#unions) and encoded the data as blobs. I was hoping to get away from blobs now that we have UDTs in Cassandra 2.1, but I don't see any support for unions. Does anyone have any suggestions? I think I may be better of just sticking with Avro serialization. :( Best regards, Clint
RE: Problems with user defined types (cql) and Datastax Java Driver
Hi Alex, I did so. Thanks for that hint. Andi From: Alex Popescu [al...@datastax.com] Sent: 05 February 2015 18:14 To: user Subject: Re: Problems with user defined types (cql) and Datastax Java Driver Andreas, Can you please post your question to the Java driver ml https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user as you'll have better chances to get an answer there. thanks On Thu, Feb 5, 2015 at 9:10 AM, Andreas Finke andreas.fi...@solvians.commailto:andreas.fi...@solvians.com wrote: Hi, I encountered the problem that in Java the Session does not create a valid UserType for my corresponding CQL user defined type. CQL_SCHEMA: create keyspace if not exists quotes WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; CREATE TYPE IF NOT EXISTS quotes.price ( value double, size bigint, timestamp bigint, delay int ); JAVA UserType priceType = session.getCluster().getMetadata().getKeyspace(quotes).getUserType(price); Assert.assertNotNull(priceType); // true Assert.assertEquals(price, priceType.getTypeName()); // true Assert.assertEquals(4, priceType.getFieldNames().size()); // AssertionFailedError: expected:4 but was:0 I am testing with Cassandra v.2.1.2 on Windows using Datastax Java Driver 2.1.2. I am thankful for any suggestions. Regards Andi -- [:-a) Alex Popescu Sen. Product Manager @ DataStax @al3xandru
Re: Problems with user defined types (cql) and Datastax Java Driver
Andreas, Can you please post your question to the Java driver ml https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user as you'll have better chances to get an answer there. thanks On Thu, Feb 5, 2015 at 9:10 AM, Andreas Finke andreas.fi...@solvians.com wrote: Hi, I encountered the problem that in Java the Session does not create a valid UserType for my corresponding CQL user defined type. CQL_SCHEMA: create keyspace if not exists quotes WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; CREATE TYPE IF NOT EXISTS quotes.price ( value double, size bigint, timestamp bigint, delay int ); JAVA UserType priceType = session.getCluster().getMetadata().getKeyspace(quotes).getUserType(price); Assert.assertNotNull(priceType); // true Assert.assertEquals(price, priceType.getTypeName()); // true Assert.assertEquals(4, priceType.getFieldNames().size()); // AssertionFailedError: expected:4 but was:0 I am testing with Cassandra v.2.1.2 on Windows using Datastax Java Driver 2.1.2. I am thankful for any suggestions. Regards Andi -- [:-a) Alex Popescu Sen. Product Manager @ DataStax @al3xandru
Problems with user defined types (cql) and Datastax Java Driver
Hi, I encountered the problem that in Java the Session does not create a valid UserType for my corresponding CQL user defined type. CQL_SCHEMA: create keyspace if not exists quotes WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; CREATE TYPE IF NOT EXISTS quotes.price ( value double, size bigint, timestamp bigint, delay int ); JAVA UserType priceType = session.getCluster().getMetadata().getKeyspace(quotes).getUserType(price); Assert.assertNotNull(priceType); // true Assert.assertEquals(price, priceType.getTypeName()); // true Assert.assertEquals(4, priceType.getFieldNames().size()); // AssertionFailedError: expected:4 but was:0 I am testing with Cassandra v.2.1.2 on Windows using Datastax Java Driver 2.1.2. I am thankful for any suggestions. Regards Andi
Re: How should clients handle the user defined types in 2.1?
thanks for the high level description of the format, I'll see if I can make a stab at implementing support for custom types now. and maybe I should take all of the reverse engineering I've done of the type encoding and decoding and send a pull request for the protocol spec, or write an appendix. T# On Tue, Feb 25, 2014 at 12:10 PM, Sylvain Lebresne sylv...@datastax.comwrote: 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 see. Can't say there is much documentation so far for that. As for the spec, it was written in a time where user defined types didn't existed and so as far as the protocol is concerned so far, user defined types are handled by the protocol as a custom type, i.e the full internal class is returned. And so ... 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? ... yes, for now you're supposed to parse that description. Which is not really much documented outside of looking up the Cassandra code, but I can tell you that the first parameter of the UserType is the keyspace name the type has been defined in, the second is the type name hex encoded, and the rest is list of fields and their type. Each field name is hex encoded and separated from it's type by ':'. And that's about it. We will introduce much shorted definitions in the next iteration of the native protocol, but it's yet unclear when that will happen. -- Sylvain
Re: How should clients handle the user defined types in 2.1?
Please do. I too am working at a driver implementation and would be delighted to be spared the research. On Feb 25, 2014 11:29 AM, Theo Hultberg t...@iconara.net wrote: thanks for the high level description of the format, I'll see if I can make a stab at implementing support for custom types now. and maybe I should take all of the reverse engineering I've done of the type encoding and decoding and send a pull request for the protocol spec, or write an appendix. T# On Tue, Feb 25, 2014 at 12:10 PM, Sylvain Lebresne sylv...@datastax.comwrote: 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 see. Can't say there is much documentation so far for that. As for the spec, it was written in a time where user defined types didn't existed and so as far as the protocol is concerned so far, user defined types are handled by the protocol as a custom type, i.e the full internal class is returned. And so ... 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? ... yes, for now you're supposed to parse that description. Which is not really much documented outside of looking up the Cassandra code, but I can tell you that the first parameter of the UserType is the keyspace name the type has been defined in, the second is the type name hex encoded, and the rest is list of fields and their type. Each field name is hex encoded and separated from it's type by ':'. And that's about it. We will introduce much shorted definitions in the next iteration of the native protocol, but it's yet unclear when that will happen. -- Sylvain
How should clients handle the user defined types in 2.1?
(I posted this on the client-dev list the other day, but that list seems dead so I'm cross posting, sorry if it's the wrong thing to do) 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 see. 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)
Re: How should clients handle the user defined types in 2.1?
On Mon, Feb 24, 2014 at 7:52 PM, Theo Hultberg t...@iconara.net wrote: (I posted this on the client-dev list the other day, but that list seems dead so I'm cross posting, sorry if it's the wrong thing to do) I didn't even realize there was a list for driver implementors - is this used at all? Is it worth being on this list?
Re: How should clients handle the user defined types in 2.1?
There hasn't been any activity (apart from my question) since december, and only sporadic activity before that, so I think it's essentially dead. http://www.mail-archive.com/client-dev@cassandra.apache.org/ T# On Mon, Feb 24, 2014 at 10:34 PM, Ben Hood 0x6e6...@gmail.com wrote: On Mon, Feb 24, 2014 at 7:52 PM, Theo Hultberg t...@iconara.net wrote: (I posted this on the client-dev list the other day, but that list seems dead so I'm cross posting, sorry if it's the wrong thing to do) I didn't even realize there was a list for driver implementors - is this used at all? Is it worth being on this list?