-1

I am trying to add UDT bom_object column in my table.

       bom_object type= list<bom_object>

which will replace the old column 'product'. for that i need to write conversion script.I will appreciate Any suggestion or idea. Since i am new to cassandra.

JOGO
  • 285
  • 2
  • 7
  • 16

1 Answers1

0

I couldn't completely understand your question. I am just guessing that you want to change the type of an existing column and you want a script to convert the existing data. Is it?

In that case, it is better to create a new column with your requirement. Read the previous data using an iterator and convert it to suit your new column and reinsert it.

Hope it helps!

chaitan64arun
  • 783
  • 8
  • 20
  • yes, I wanted to read old data and insert in newely added column. any sample document is available to write that script? – JOGO Apr 21 '16 at 10:28
  • You will need to write a JAVA or Python program to do it. eg: https://docs.datastax.com/en/developer/java-driver/2.0/java-driver/reference/queryBuilder_r.html Please read the data and then write it. If the data is huge, you might want to distribute it using analytics. – chaitan64arun Apr 21 '16 at 11:49