1

I got this exception - "no viable alternative at input '?'", i feel it is because of "+" query statement.

private static final String CQL_BEAN = "cql:bean:cassandraCluster";

String updataQuery = "UPDATE user_preference SET preference = preference + ? WHERE user_id = ? AND tenant_id = ? IF EXISTS";

.to(CQL_BEAN + "/" + cassandraProperties.getKeyspaceName() + "?cql=" + this.updataQuery + "&prepareStatements=false") 

1 Answers1

1

Update: it could be because you are using prepareStatement=false - it looks like that in this case it won't substitute placeholders... Although I'm not expert in this integration.

....

What do you want to achieve with this syntax? Update only records that were inserted previously?

Usually LWTs are used only in very limited number of situations as they require coordination between nodes in the cluster, and seriously degrade performance. More details on LWTs you can find in documentation.

Alex Ott
  • 80,552
  • 8
  • 87
  • 132
  • Here "IF EXISTS" is used to avoid to insertion of the row if it does'nt exist (In cassandra update statement will insert row if it absent) The issue i am facing is in the SET statement of aforesaid query (SET preference = preference + ?) is failing. – Dharmendra S Oct 17 '18 at 10:42