> In both cases the array is the PRIMARY_KEY. I'm not sure what you mean by the "array"
The vector_name and list_name columns are used as "variable names" to identify a particular vector or list. They are the storage engine "row key". Cheers ----------------- Aaron Morton Freelance Cassandra Developer New Zealand @aaronmorton http://www.thelastpickle.com On 14/11/2012, at 5:31 PM, Kevin Burton <rkevinbur...@charter.net> wrote: > Does the array have to be a KEY? > Sorry I don't understand this question. > > In the samples you give you specify array as > > CREATE COLUMNFAMILY Description ( > PRIMARY_KEY > (vector_name, index), > Age text, > Gender text, > vector_name text, > index bigint, > ….. > > Or > CREATE COLUMNFAMILY Description ( > PRIMARY_KEY > (listr_name, sort_key), > Age text, > Gender text, > sort_key bigint, > list_name text > …. > > In both cases the array is the PRIMARY_KEY. In order for an array to work > does the array have to be a KEY? > > From: aaron morton [mailto:aa...@thelastpickle.com] > Sent: Tuesday, November 13, 2012 10:18 PM > To: user@cassandra.apache.org > Subject: Re: CF metadata syntax for an array > > Would this syntax be the same for CREATE COLUMNFAMILY (as an aside what is a > ‘TABLE’ in Cassandra)? > Yes, CQL 2 uses COLUMN FAMILY or Table and CQL 3 uses TABLE > > http://www.datastax.com/dev/blog/cql3-evolutions > > In other words is this valid: > Does it work ? Is so it's valid. > > Does the array have to be a KEY? > Sorry I don't understand this question. > > Finally, what would be the syntax for inserting data into the CF? > Depends on what you want to do. > Docs are a good starting point > http://www.datastax.com/docs/1.1/references/cql/index > > Cheers > > ----------------- > Aaron Morton > Freelance Developer > @aaronmorton > http://www.thelastpickle.com > > On 14/11/2012, at 2:42 AM, Kevin Burton <rkevinbur...@charter.net> wrote: > > > Sorry to be so slow but I am just learning CQL. Would this syntax be the same > for CREATE COLUMNFAMILY (as an aside what is a ‘TABLE’ in Cassandra)? In > other words is this valid: > > CREATE COLUMNFAMILY Description ( > PRIMARY_KEY > (vector_name, index), > Age text, > Gender text, > vector_name text, > index bigint, > ….. > > Or > CREATE COLUMNFAMILY Description ( > PRIMARY_KEY > (listr_name, sort_key), > Age text, > Gender text, > sort_key bigint, > list_name text > …. > > > Does the array have to be a KEY? Finally, what would be the syntax for > inserting data into the CF? > > Thanks again. > > From: aaron morton [mailto:aa...@thelastpickle.com] > Sent: Tuesday, November 13, 2012 4:09 AM > To: user@cassandra.apache.org > Subject: Re: CF metadata syntax for an array > > While this solves the problem for an array of 'primitive' types. What if I > want an array or collection of an arbitrary type like list<foo>, where foo is > a user defined type? > Do you mean a custom Cassandra data type that sub classes AbstractType? I > dont think CQL can support those, I may be wrong though. > > If you mean a basic client side data type you could serialise it and store as > a string or byte buffer in a CQL collection. > > What are the options to solve this type of array? > ... > > > arbitrary type like list<foo>, > Do you mean an array such as int[] or do you mean the equivalent of a java > List<T> with functions like remove that actually delete items and from the > list? > > If it's the former a CQL table such as below would work > > CREATE TABLE vectors ( > vector_name text, > index bigint, > object_property_1 text, > object_property_2 text, > PRIMARY_KEY (vector_name, index) > ); > > The problem is, if you delete a element at (vector, index) the remaining > indexes will be off. > > If it's the later, a List<T>, then it depends a little on what features you > want to support. If you want a sorted list of objects the table is roughly > the same > > CREATE TABLE List ( > list_name text, > sort_key bigint, > object_property_1 text, > object_property_2 text, > PRIMARY_KEY (list_name, sort_key) > ); > > Hope that helps. > > ----------------- > Aaron Morton > Freelance Developer > @aaronmorton > http://www.thelastpickle.com > > ----------------- > Aaron Morton > Freelance Developer > @aaronmorton > http://www.thelastpickle.com > > On 13/11/2012, at 9:46 AM, Kevin Burton <rkevinbur...@charter.net> wrote: > > > > While this solves the problem for an array of 'primitive' types. What if I > want an array or collection of an arbitrary type like list<foo>, where foo is > a user defined type? I am guessing that this cannot be done with > 'collections'. What are the options to solve this type of array? > > On Nov 12, 2012, at 2:28 PM, aaron morton <aa...@thelastpickle.com> wrote: > > This may help http://www.datastax.com/dev/blog/cql3_collections > > I have gotten as far as feeling a need to understand a ‘super-column’ > You can happily ignore them. > > > Cheers > > ----------------- > Aaron Morton > Freelance Developer > @aaronmorton > http://www.thelastpickle.com > > On 12/11/2012, at 8:35 PM, Kevin Burton <rkevinbur...@charter.net> wrote: > > > > I am sorry if this is an FAQ. But I was wondering what the syntax for > describing an array? I have gotten as far as feeling a need to understand a > ‘super-column’ but I fail after that. Once I have the metadata in place to > describe an array how do I insert data into the array? Get data from the > array? Thank you. > >