I tried run this query with yugabyte-cassandra-driver (C#):
public async Task IncreaseUnread(int userId, long peerId, int count)
{
var statement = await Session.PrepareAsync("UPDATE messaging_db.dialog SET unreadCount = unreadCount + ? WHERE userId = ? AND longPeerId = ?");
var bounded = statement.Bind(count, userId, peerId);
await Session.ExecuteAsync(bounded);
}
And i faced with this error:
Cassandra.InvalidQueryException: Invalid Function Call. Failed calling '+(int,anytype)'. Found too many matches for builtin function '+'
UPDATE messaging_db.dialog SET unreadCount = unreadCount + ? WHERE userId = ? AND longPeerId = ?
^
What should i do to fix this?Is there any type casting available?
Update:
My table schema:
CREATE TABLE IF NOT EXISTS messaging_db.dialog(
userId INT,
longPeerId BIGINT,
topMessageId INT,
readInboxMaxId INT,
readOutboxMaxId INT,
unreadCount INT,
unreadMentionCount INT,
pts INT,
draft TEXT,
pinned BOOLEAN,
unreadMark BOOLEAN,
modificationTime TIMESTAMP,
PRIMARY KEY((userId), longPeerId)
);