com.datastax.driver.core.exceptions.InvalidTypeException: Invalid type for value 1 of CQL type text, expecting class java.lang.String but class [Ljava.lang.Object; provided

2013-12-07 Thread Techy Teck
I am trying to insert into Cassandra database using Datastax Java driver. But everytime I am getting below exception at `prBatchInsert.bind` line- com.datastax.driver.core.exceptions.InvalidTypeException: Invalid type for value 1 of CQL type text, expecting class java.lang.String but class

Re: com.datastax.driver.core.exceptions.InvalidTypeException: Invalid type for value 1 of CQL type text, expecting class java.lang.String but class [Ljava.lang.Object; provided

2013-12-07 Thread Keith Wright
As the comment in your code suggests, you need to cast the array passed to the bind method as Object[]. This is true anytime you pass an array to a varargs method. On Dec 7, 2013 4:01 PM, Techy Teck comptechge...@gmail.com wrote: I am trying to insert into Cassandra database using Datastax

Re: com.datastax.driver.core.exceptions.InvalidTypeException: Invalid type for value 1 of CQL type text, expecting class java.lang.String but class [Ljava.lang.Object; provided

2013-12-07 Thread Dave Brosius
BoundStatement query = prBatchInsert.bind(userId, attributes.values().toArray(new *String*[attributes.size()])) On 12/07/2013 03:59 PM, Techy Teck wrote: I am trying to insert into Cassandra database using Datastax Java driver. But everytime I am getting below exception at