Hi,own vote
favorite
<https://stackoverflow.com/questions/49049760/cassandra-filter-with-ordering-query-modeling#>

I am new to Cassandra and I am trying to model a table in Cassandra. My
queries look like the following

Query #1: select * from TableA where Id = "123"Query #2: select * from
TableA where name="test" orderby startTime DESCQuery #3: select * from
TableA where state="running" orderby startTime DESC

I have been able to build the table for Query #1 which looks like

    val tableAStatement = SchemaBuilder.createTable("tableA").ifNotExists.
    addPartitionKey(Id, DataType.uuid).
    addColumn(Name, DataType.text).
    addColumn(StartTime, DataType.timestamp).
    addColumn(EndTime, DataType.timestamp).
    addColumn(State, DataType.text)

    session.execute(tableAStatement)

but for Query#2 and 3, I have tried many different things but failed.
Everytime, I get stuck in a different error from cassandra.

Considering the above queries, what would be the right table model? What is
the right way to model such queries.
Regards,
Behroz

Reply via email to