Five Stars

[resolved] Insert data from delimited file to Cassandra.

Hi,
I want to insert data from delimited file to Cassandra composite column Family using tCassandraRow.
First record is getting inserted successfully into column Family. But other records are not getting inserted.
So, how to insert all record from delimited file to Cassandra column Family.
We have to perform below activities on Cassandra:
1. Insert all data into composite Column Family from delimited file using tCassandraRow.
2. Insert data into collection columns like SET, LIST & MAP.

Regards
Rahul.
1 ACCEPTED SOLUTION

Accepted Solutions
Moderator

Re: [resolved] Insert data from delimited file to Cassandra.

Hi,
You should use a tjavarow to put your global variable.
Please have a look at my screenshots for details
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
9 REPLIES
Moderator

Re: [resolved] Insert data from delimited file to Cassandra.

Hi,
You should use a tjavarow to put your global variable.
Please have a look at my screenshots for details
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Moderator

Re: [resolved] Insert data from delimited file to Cassandra.

Hi Rahul,
Is there any update for your issue?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: [resolved] Insert data from delimited file to Cassandra.

Thanks Sabrina, Now its working.
Moderator

Re: [resolved] Insert data from delimited file to Cassandra.

Hi rahul.nawale,
Thanks for your feedback. Don't hesitate to post your issue on forum
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Insert data from delimited file to Cassandra.

Dear Administrator,

I have two questions:
How can I read from a cassandra table using a composite key using tcassandrainput?
Rows I am receiving are coming out as NULL even though they are integers... I think schema is not correctly setup... what is the DBType of int @ Cassandra?

Thanks.
Moderator

Re: [resolved] Insert data from delimited file to Cassandra.

Hi,
How can I read from a cassandra table using a composite key using tcassandrainput?

Could you give us more description about your composite key?
Rows I am receiving are coming out as NULL even though they are integers... I think schema is not correctly setup... what is the DBType of int @ Cassandra?

You can go to Window-->Preference-->Specific Setting-->Metadata of Talend to check mapping file.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: [resolved] Insert data from delimited file to Cassandra.

Hi Sabrina,
I am new to talend,I had a query.
You adviced to use tjavarow.
Is this applicable to composite Column Family also or only Insert data into collection columns.
If no,then could you suggest one.
Thanks and Regards,
Ojasvi Gambhir
Moderator

Re: [resolved] Insert data from delimited file to Cassandra.

Hi Ojasvi Gambhir,
Could you please describe your requirement better? What's your meaning of composite Column Family? 
Could you please elaborate your case with an example with input and expected output values?

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: [resolved] Insert data from delimited file to Cassandra.

Hi Sabrina,
Appreciate your quick response.
My requirement is to insert data from hive/delimited file into cassandra columnfamily which has 3 columns as composite primary key. 
 
For example:
Source Data from hive/file as five columns namely
Column1,Column2,Column3,Column4,Column5.
I want to Upsert these columns into cassandra where three columns constitute as primary key.
CQL for cassandra columnfamily looks like this:
 CREATE TABLE hivetoCasdra (
Column1 text,
Column2 text,
Column3 text,
Column4 text,
Column5 text,
PRIMARY KEY(Column1,Column2,Column3));
I used tCassandraOutput component but its failing with :
Exception in component tCassandraOutput_1
me.prettyprint.hector.api.exceptions.HInvalidRequestException: InvalidRequestException(why:Not enough bytes to read value of component 0)
Because of which searching for an alternate solution.
Kindly let me know in case you need further details.
Thanks and Regards,
Ojasvi Gambhir