0
votes

--Update: it seems it was a glitch with the Virtual Machine. I restarted Cassandra service and it works as expected. --Update: It seems that the problem is not in the code, I tried to execute the insert statement in a Cassandra client and I get the same behavior, No error is displayed, nothing is inserted. The column that causes this behavior is of type timestamp. When I set this column value to some values (ex. '2015-08-25 22:15:12') The table is: create table player (msisdn varchar primary key, game int,keyword varchar, inserted timestamp,lang int,mo int,mt int,qid int,score int)

I am new to Cassandra, downloaded the VirtualBox snapshot to test it. I am trying the example code of the batch and it did nothing, so I tried as people suggested to execute the prepared statement directly.

var addPlayer = casDemoSession.Prepare("INSERT INTO player (msisdn,qid,keyword,mo,mt,game,score,lang,inserted) Values (?,?,?,?,?,?,?,?,?)");

for (int i = 0; i < 20; i++) {
    var bs = addPlayer.Bind(getRandMSISDN(), 1, "", 1, 0, 0, 10, 0,  DateTime.Now);
    bs.EnableTracing(true);
    casDemoSession.Execute(bs);
}

The code above does not throw any exceptions nor insert any data. I tried to trace the query but it does not show the actual cql query. PlannetCassandra V0.1 VM running Cassandra 2.0.1 datastax driver 2.6 https://github.com/datastax/csharp-driver

1
Can you update with the CQL that you tested in the client and your table schema?Alec Collier
@Tamer, did you intend DateTime.Now instead of DateTime.Now()? Also, which driver are you using?Patricia
it seems it was a glitch with the Virtual Machine. should I delete the question?Tamer

1 Answers

0
votes

One thing that might be missing is the keyspace name for your player table. Usually you would have "INSERT INTO <keyspace>.name (..."

If you're able to run cqlsh, could you add the output from "DESCRIBE TABLE <keyspace>.player" to your question, and show what happens when you attempt to do the insert in cqlsh.