I have two columns in cassandra of type bigint.
Using gocql I want to retrieve values from these columns using the IN clause.
My query looks something like this -
QUERY := select column1,column2,column3 from tableName
where id1 in (?)
and id2 in (?)
ALLOW FILTERING;
And I am calling this query from my code like -
query := db.CassandraSession.Query(QUERY, Ids1, Ids2)
where Ids1 and Ids2 are two slices of type int64 (i.e. []int64)
when executing this query using
iter := query.Iter()
for iter.Scan(.....
)
err := iter.Close()
I get error can not marshal []int64 into bigint
Can someone help me in resolving this?
I suspect the issue lies within your code but I have to admit I'm only guessing because of the lack of information in your post.
You'll need to provide additional information to make it easy for others to help you. At the very least, you should provide details to replicate the problem:
As a side note but a very important point to make is that it's almost always bad practice to use
ALLOW FILTERINGin your application queries and we definitely don't recommend using it in production because its performance can be very unpredictable.Similarly, try to avoid using the
IN()operator where possible. It's OK to use for 2 or 3 elements but any more than that can be detrimental to the performance of your app and cluster.In most cases, the use of
ALLOW FILTERINGor theIN()operator indicates that you got the data model wrong and you need to redesign your tables. Cheers!