When the Java driver throws an InvalidQueryException
, it's rethrowing an error from Cassandra. The error "Multiple definitions found for column..." indicates that a column is mentioned more than once in an update statement. You can simulate it in cqlsh:
cqlsh> create table test(i int primary key); cqlsh> insert into test (i, i) values (1, 2); code=2200 [Invalid query] message="Multiple definitions found for column i"
I'm not familiar with Astyanax, but my guess is that it already adds the id to the query when you call withRow
, so you don't need to add it again with putColumn
. Try removing that call (second line in reformatted sample below):
m.withRow(cf, lb.getLbId()) .putColumn(LEADERBOARD_ID, UUIDUtil.asByteArray(lb.getLbId()), null) ... // other putColumn calls
Read full article from astyanax - Why Cassandra throwing com.datastax.driver.core.exceptions.InvalidQueryException: Multiple definitions found for column - Stack Overflow
No comments:
Post a Comment