0

I have this table in cassandra

FileProcess_ErrorLog

I have mapped this table with class:

@Table("FileProcess_ErrorLog")

public class FileProcessErrorLog {

    @PrimaryKey
    private UUID FileProcessErrorLogId;
    private int FileProcessAuditLogId;

When I am trying to insert data into this table using the above class, I am getting this:

Caused by: com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured table fileprocess_errorlog
at com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:50) ~[cassandra-driver-core-3.4.0.jar:na]
at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37) ~[cassandra-driver-core-3.4.0.jar:na]
at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:245) ~[cassandra-driver-core-3.4.0.jar:na]
at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:68) ~[cassandra-driver-core-3.4.0.jar:na]
at org.springframework.data.cassandra.core.cql.CqlTemplate.query(CqlTemplate.java:296) ~[spring-data-cassandra-2.0.8.RELEASE.jar:2.0.8.RELEASE]
... 40 common frames omitted

Note that Cassandra table names are case-sensitive. I think the error is because it converts the table name to all lower-case and that is why it can not find the table.

I have tried escaping the table name using `(backticks) as this answer suggested (I thought they could be using the same strategy.)

How can I insert data without changing table name.

KumarAnkit
  • 713
  • 1
  • 9
  • 26
  • Have you considered that you maybe have an unconfigured table? Uppercase is not your issue, see here - https://docs.datastax.com/en/archived/cql/3.1/cql/cql_reference/ucase-lcase_r.html . Could you show us your configuration class and a table structure? – Urosh T. Nov 27 '18 at 12:46
  • @Urosh T. So, it is saying, the db stores table names in lower case. But that means I have to change the table names to lower case. – KumarAnkit Nov 27 '18 at 12:53
  • I don't think so, even if you have a `FileProcess_ErrorLog` table, it is later transformed to a `fileprocess_errorlog`. Do you have such a table created in your Cassandra? – Urosh T. Nov 27 '18 at 12:56
  • Yes @Urosh, I have mentioned it in question. – KumarAnkit Nov 27 '18 at 12:59
  • Yes, but is it created in lowercase or uppercase? :) I just wanted to prove my point that it doesn't really matter, you can test with some simple queries – Urosh T. Nov 27 '18 at 13:00
  • it was created in UpperCase. The question is how can I pass the Table name, So it is interpreted as it is. – KumarAnkit Nov 27 '18 at 13:05

0 Answers0