Hi
Have any one met the issue below:
when the query contains "IN" in criteria, the python driver will sometimes return the wrong record count.
Details:1. The total count of records which meet some specific criteria is 1000.
2. Query is: "select XXX from XXX where col in (XXX, XXX, XXX) limit 100". (meet above specific criteria)
3. Set fetch_size to 800.
The problem1 is: Even the limit size (100) is smaller than fetch_size (1000), the returned result is still a PagedResult (which I think should be a list).
The problem2 is: The total size of returned is bigger than the limit size, which is 100.
BTW, when I removed "IN" part from criteria, and everything works fine.
And the version I am using is 2.1.2
My simple code is:# Initialize cluster
cluster = Cluster(['mynode'])
session = cluster.connect('mycolumnfamily')
# Fetch all the records and get the count
cql = SimpleStatement("select * from table where pkcol in ('val1', 'val2', 'val3', 'val4', 'val5')", fetch_size=None)
print "Total count is: %d" % len(session.execute(cql))
# Fetch 20 records and set fetch_size to 40
cql = SimpleStatement("select * from table where pkcol in ('val1', 'val2', 'val3', 'val4', 'val5') limit 20", fetch_size=40)
result = session.execute(cql)
# print out result type and count of records
print "Type of result is: %s" % type(result)
result = list(result)
print "Count returned: %d (should only return 20)" % len(result)
The output is:
Total count is: 54
Type of result is: <class 'cassandra.cluster.PagedResult'>
Count returned: 32 (should only return 20)
Please correct me if I am wrong at some place.