saurav
saurav

Reputation: 219

Cassandra: Populating a new column in cql

I have added a new column to my admin table.I want to populate revision column against effective_date column.

        ALTER TABLE prod.admin ADD revision int;

The revision number will start with 100 and increment by 1. The revisions will be based on the effective_date. So, the oldest effective_date, will get 100, then next oldest will get 101, and so on.

          Effective date 1/1/2014 – Revision 100
          Effective date 1/1/2015 – Revision 101
          Effective date 7/1/2015 – Revision 102
          Effective date 1/1/2016 – Revision 103

something like below statement??

          revision =100
          UPDATE prod.admin 
          SET revision= revision+ 1
          WHERE effective_date = /'

Upvotes: 0

Views: 135

Answers (1)

doanduyhai
doanduyhai

Reputation: 8812

You are typically falling in the use-case of data normalization (http://www.slideshare.net/doanduyhai/fast-track-to-getting-started-with-dse-max-ing/66), it's an excellent use-case for Apache Spark over Cassandra

Plus, you can benefit from data locality for this use-case

Upvotes: 1

Related Questions