i am starting with cassandra, but i have some difficult to understand how the queries work.
i have this
[default@Keyspace1] get Users[jsmith];
=> (column=adress, value=London, timestamp=1311087089506000)
=> (column=age, value=*, timestamp=1311086896514000)
=> (column=first, value=John, timestamp=1311086884652000)
=> (column=last, value=Smith, timestamp=1311086891619000)
Returned 4 results.
In SQL i can do: SELECT last FROM Keyspace1 WHERE first="John"
But in cassandra language?
I am trying something like this, but i confess that i’m totally confused about the sintax.
[default@Keyspace1] keyspace1.get("column_family","John","last")
...
But, you have to know row-key for this. It will be hard to do this kind of search; look at this thread, they discuss the same.
Update (thanks @jbellis for the hint)
It seem that there are quite a few things added in Cassandra 0.7 and newer releases. I have been working on 0.6. So, yes, you can do it.
In Cassandra 0.7 you can
But not
because:
CQL is a better option here it seems. It’s a part of Cassandra 0.8 release. Refer this. There you can:
and then
Refer complete CQL commands here.