Skip to content

CQLC: Go Cassandra query returning page token for boundary limit? #40

@tanmay-saha

Description

@tanmay-saha

In my Cassandra database for a particular query, I have 8 records, and I am using relops/cqlc library to query.

When I query with limit = 8, it returns 8 records with a PageState which is to be used as page token for the next set of results. First of all, I don't think it should have returned that PageState. And also as expected when I query again with that page_token and the same query parameters, it returns no data.

This is a representative of the way I am using to query

query, err := cx.Select().From(db.MY_TABLE).Where(db.MY_TABLE.NAME.Eq(name), db.MY_TABLE.EV_START.Ge(begin), db.MY_TABLE.EV_START.Lt(end)).Prepare(cass)
query.PageSize(8)
iter := query.Iter()
data, err = db.BindMyTable(iter)

err = iter.Close()
next_page_token = iter.PageState()

*cass is a gocql.Session

Why is it returning a value for the next_page_token?

The same thing does not happen if I increase the limit by one more, say 9.

Did someone else face a similar issue? Any hints as to what might be the issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions