Thanks Jeremy. The link is of great help. The pig query only cares about rows with certain key patterns. For example, it only cares about rows with key values beginning with "aaa". For each row, the query only care about one column in the row. For write, a new row with that column can be inserted. Or a row with that column can be deleted.
On Wed, Apr 20, 2011 at 5:36 PM, Jeremy Hanna <[email protected]>wrote: > The answer is that it depends on which consistency level you are reading > and writing at. You can make sure you are always reading consistent data by > using quorum for reads and quorum for writes. > > For more information on consistency level, see: > http://www.datastax.com/docs/0.7/consistency/index > > With Pig, you can specify the consistency level that you want to read at > with the following property in your hadoop configuration: > cassandra.consistencylevel.read > > So you can read at whatever consistency level you wish for each row. The > peculiarity with pig for reading and writing at the same time is that pig is > by nature a batch job. It's going to go over a set of columns for every row > in the column family. So when you say you're writing at the same time, > which row do you mean? But for example, if you are reading a particular row > with consistency level "quorum" and you're writing with consistency level > "quorum" to that row, you will see consistent results. > > On Apr 20, 2011, at 5:59 PM, Bing Wei wrote: > > > Hi, All. > > > > When I do a pig query on Cassandra, and the Cassandra is updated by > > application at the same time, what will happen? I may get inconsistent > > results, right? > > > > -- > > Bing > > > > Graduate Student > > Computer Science Department, UCSB :) > > -- Bing Graduate Student Computer Science Department, UCSB :)
