What happens when a new value for an existing column is added? Will the older value be overwritten by the new value? Or the older value will also retain and can be retrieved (similar to simpleDB)?
The older value is overwritten (technically, hidden by the new and eventually garbage collected).
Hi
In my test application, it is not overwrite by the new value, still exist the older value I don't know why.Here is my code :
*TTransport transport = new TSocket("xxxx", 9160);
TProtocol protocol = new TBinaryProtocol(transport);
Cassandra.Client client = new Cassandra.Client(protocol);
Console.WriteLine("Opening connection");
transport.Open();
System.Text.Encoding utf8Encoding = System.Text.Encoding.UTF8;
long timeStamp = DateTime.Now.Millisecond;
ColumnPath nameColumnPath = new ColumnPath()
{
Column_family = "CF1",
Column = utf8Encoding.GetBytes("Col1")
};
Console.WriteLine("Inserting name columns");
client.insert("KeySpace1","1",nameColumnPath,utf8Encoding.GetBytes("1"),timeStamp,ConsistencyLevel.ALL);
//Simple single value get using the key to get column 'name'
ColumnOrSuperColumn returnedColumn = client.get("KeySpace1", "1",
nameColumnPath, ConsistencyLevel.ONE); Console.WriteLine("Column Data in Keyspace1/Standard1: name: {0}, value: {1}", utf8Encoding.GetString(returnedColumn.Column.Name),
utf8Encoding.GetString(returnedColumn.Column.Value));
Console.WriteLine("Closing connection");
transport.Close();*
When I change :
client.insert("KeySpace1", "1", nameColumnPath, utf8Encoding.GetBytes("1"), timeStamp, ConsistencyLevel.ALL);
to :
client.insert("KeySpace1", "1", nameColumnPath, utf8Encoding.GetBytes("2"), timeStamp, ConsistencyLevel.ALL);
The program still write value = 1
Please help me to solve this problem, thanks!
Note : I use .Net library, in PHP, it run ok
I have the exact same problem... If you got the solution since your post, I'd be happy to learn the answer from you ! Thank you.