One Star

How to define clustering keys in Cassandra table

I'm new in Talend Open Studio. I'm trying to use Cassandra through the Talend Open Studio for Big Data instead of CQL Shell due to the treatment of data. My question is: when creating a table (tCassandraInput) how do I set clustering key?
3 REPLIES
Employee

Re: How to define clustering keys in Cassandra table

Hi,
first, I suggest you use the Datastax API for all the tCassandra components. it based on the CQL
then when you using tCassandraOutput component to create column family, you can simply check the key checkbox of column in schema,
if there only one key column, then it will be the primary key
if there two or more key column, then the first one will be primary key, and others will be clustering columns
for this setting, the generate CQL will be 
CREATE TABLE ks.tb (id text,\"song_order\" int,album text,PRIMARY KEY(id,\"song_order\"))
refer to the document: http://docs.datastax.com/en/cql/3.1/cql/ddl/ddl_compound_keys_c.html
song_order is the clustering column
One Star

Re: How to define clustering keys in Cassandra table

hello
What do you mean by Datastax?
I have the same problem, i want to create family column with composite key and then insert in the family columb by Tcassandra Output.
But in tCassandraOutput component, it is possible to select only 1 column like key column, do you have a solution?
regards
One Star

Re: How to define clustering keys in Cassandra table

Ok I understand , I have to select DataStax like API when  I define my connection