0

I'm utilizing the C# DataStax driver to retrieve data from a Cassandra database. To incorporate result paging into my application, I'm utilizing the FetchPageAsync method. However, there are instances where this method returns a page state string for a non-existent page on the last page.I have only 40 records in my table, and I want to get them in page sizes of 20. the driver is returning the page state on the last page(second page) iteration.

this the sample code

string query="select * from data.student Where department_id =10 and student_id in(1,2,3,4,5) and date_time>='2022-12-31 21:00:00'  and date_time<='2023-06-14 08:00:00'  and score >60"

byte[] pageState = string.IsNullOrEmpty(pageStateString) ? null : Convert.FromBase64String(pageStateString);
var pageResult = await cassandraMapper.FetchPageAsync<Student>(15, pageState, query, parameters);
var pageStateRespone = pageResult.PagingState != null ? Convert.ToBase64String(pageResult.PagingState) : string.Empty;
Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
Coder
  • 406
  • 9
  • 22

0 Answers0