Am trying to insert values into my Cassandra database but am getting this error. Referred to data type mapping here everything seems to be ok...
CodePudding user response:
Fixed it by manually sending in an event ID but now getting this error - looked like it was a type mismatch.
reactor.core.Exceptions$ErrorCallbackNotImplemented: org.springframework.data.cassandra.CassandraInvalidQueryException: ReactivePreparedStatementCallback; CQL [INSERT INTO retail_lifecycle (itemnbr,price,status,clubnbr,pricestartts,createts,currency,lastupdatets,priceendts,pricereasoncode,pricereasoncodedesc,pricetype,pricetypedesc,statusdesc,submissionclient,submissionts,submissionuserid,uniqueid) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)]; table retail_lifecycle does not exist; nested exception is com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: table retail_lifecycle does not exist Caused by: org.springframework.data.cassandra.CassandraInvalidQueryException: ReactivePreparedStatementCallback; CQL [INSERT INTO retail_lifecycle (itemnbr,price,status,clubnbr,pricestartts,createts,currency,lastupdatets,priceendts,pricereasoncode,pricereasoncodedesc,pricetype,pricetypedesc,statusdesc,submissionclient,submissionts,submissionuserid,uniqueid) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)]; table retail_lifecycle does not exist; nested exception is com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: table retail_lifecycle does not exist
CodePudding user response:
Notice that:
- In your
test2
you are not using Cassandra what so ever, it would be valuable if you can add the associated code. - The table schema is still unclear as you share screenshots of a JDBC tools maybe. The best would be to get the output of
describe table retail_lifecycle
using cqlsh to have the detailed schema.
Error 1: CodecNotFoundException
reactor.core.Exceptions$ErrorCallbackNotImplemented:
com.datastax.oss.driver.api.core.type.codec.CodecNotFoundException:
Codec not found for requested operation: [UUID <-> java.lang.String]...
This message means that in your Java Entity there is an attribute with invalid type:
- either the java field is as an
UUID
whereas the column in the databases was rather aTEXT
or aVARCHAR
. - or the java field is as String and the expected column is an UUID.
Error 2: InvalidQueryException
table retail_lifecycle does not exist; nested exception is com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: table retail_lifecycle does not exist
This message tells you that the table your want to write does not exist. Either the table retail_lifecycle
does not exist at all or you may have not provide a keyspace in the CqlSession
definition.