1

We have 10+ million rows in Cassandra, and all of them are under the same table. Recently we are planning to add a new column to the existing table and the new column for all rows are required to set be true.

Is there a way to initialize values for the new added column? What I am thinking now is iterating all rows and get all keys to a output file and update the new added column value based on all keys retrieved.

Please help. it doesn't matter which way we can solve it, CQL, Java, or Python. Thanks in advance.

Haifeng Zhang
  • 30,077
  • 19
  • 81
  • 125

1 Answers1

0

You do have a solution like "What I am thinking now is iterating all rows and get all keys to a output file and update the new added column value based on all keys retrieved." that will certainlly work.

You may need to using "COPY table to ***.csv"

then using python to insert true value to the csv

and restore the csv with sstableloader tool http://docs.datastax.com/en/cassandra/2.0/cassandra/tools/toolsBulkloader_t.html

You could restore the table to another namespace for test.

wherby
  • 704
  • 1
  • 5
  • 16