0
votes

I want to migrate my MySQL data to cassandra. I'am using old version of DSE i.e. 4.8 which supports the sqoop command. My query is that i want to insert row with dynamic timeuuid column value which is to be generated at the time of insertion and it is not present in MySQL table. Please help.

I'am using following query which inserts the data but without uuid column value.

bin/dse sqoop cql-import --connect jdbc:mysql://localhost:3306/testing --table tbl1 --username root -P --cassandra-keyspace test --cassandra-table testtable --cassandra-host localhost --split-by ID --cassandra-column-mapping id:ID,name:NAME --columns ID,NAME

Thanks,

1
Hi Horia, i have a field in cassandra db which stores unique id which is auto generated. How would I map writetime to any field let say UID of cassandra testtable ?jAi
The writetime is stored for each value added to a column, except for primary keys. So if your UID is a primary key, than you cannot retrieve it's writetime. Otherwise, you can do it for some other column with a cql statement: select writetime(<column_name>) from <table_name> where <clause>Horia
You don't have to map it, it is there by default. The value is in microseconds. All you have to do is query for it.Horia
I understand but i actually need individual column to have uuid and i just need a way to dynamically insert uuid value at the time of insertion in cassandrajAi

1 Answers

0
votes

I did lot of searching and found that sqoop can only be used to insert data exactly in the database. So, if you want to manipulate data at the time of insertion, you need to create some custom application or ETL tool can help you. However, I was running out of time so achieved by creating Java application. Hence, I'm closing this issue. Thanks for your help people on this matter.

Regards,

Aditya Jain