--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-user+unsubscribe@lists.datastax.com.
Can someone please help? I must be doing something wrong here because I just re-wrote what I have done in Spark using the Cassandra Java driver and have a similar problem. I run a batch inserting 10 unique records followed by batch insert of 100 records and only the first 10 records get inserted.object TestCassandraDriver {def main(args: Array[String]): Unit = {val cluster = Cluster.builder().addContactPoint("127.0.0.1").build()val session = cluster.connect()val batchStatement = new BatchStatement()val preparedStatement =session.prepare("INSERT INTO dev_data_lake.test_connector (id, sequence, value) VALUES (?, ?, ?) IF NOT EXISTS")for (sequence <- 1 to 10) {val seq: java.lang.Integer = sequenceval boundStatement = new BoundStatement(preparedStatement)boundStatement.bind("key1", seq, seq)batchStatement.add(boundStatement)}session.execute(batchStatement)batchStatement.clear()for (sequence <- 1 to 100) {val seq: java.lang.Integer = sequenceval boundStatement = new BoundStatement(preparedStatement)boundStatement.bind("key1", seq, seq)batchStatement.add(boundStatement)}session.execute(batchStatement)
session.close()cluster.close()}}
On Thursday, March 9, 2017 at 8:48:42 PM UTC-8, Antonio Ye wrote:Here is a simple project that shows the problem. When I run this locally, I end up with 975 records in Cassandra instead of the expected 1000.
On Thursday, March 9, 2017 at 1:42:28 PM UTC-8, Antonio Ye wrote:I have an issue where I am inserting some data in batch using "IF NOT EXISTS" in my insert statements. I have 9675 unique records but for some reason only 8642 are inserted. I enabled tracing but see never see the requests for the missing records in either system_traces.events nor system_traces.sessions. I suspect that for some reason the driver is not sending those records to Cassandra but have no error message anywhere to tell me why. I had brought this up on the Spark Connector for Cassandra forum but had no luck getting to the bottom of the problem. Here is the link to that post:https://groups.google.com/a/lists.datastax.com/d/topic/spark-connector-user/8yLSqqjtwJ0/discussionAny ideas of where to look to debug this issue?
--