-1

i am new to Cassandra and i tried a simple join query like this

$result = new Cassandra\SimpleStatement(<<<EOD

    select city.*, state.* from city, state where
    city.city_id = state.city_id
EOD

); 

but it is not working so please anyone can help me ?

  • There is not enough information here to give you an answer. Try to provide more information, let us know what error you get, show us the surrounding code. As is this cannot be fixed. – Toby Allen Jan 02 '16 at 11:06
  • Actually i have a two tables city and state where state table contains state information and city table contains all state wise city and i want to fetch state details with its all city details. – jignesh patel Jan 02 '16 at 11:14
  • 1
    I have never used Cassandra, but I very much doubt it has an error message that reads: "*not working*" –  Jan 02 '16 at 11:32
  • What is the error you get? Further, you should give info about the schema of the table. Cassandra is not a RDBMS, and cqlsh is not strictly SQL. To know more about the `where` clause, read here: http://www.datastax.com/dev/blog/a-deep-look-to-the-cql-where-clause and the manual: https://docs.datastax.com/en/cql/3.0/cql/cql_reference/select_r.html. – Soumya Kanti Jan 06 '16 at 12:15
  • Possible duplicate of [Inner Join in cassandra CQL](https://stackoverflow.com/questions/16790297/inner-join-in-cassandra-cql) – Raedwald Jul 19 '17 at 08:39

1 Answers1

2

I'm not familiar with dbeaver, but Cassandra CQL does not support joins, so what you're trying to do may not be supported.

Jim Meyer
  • 9,275
  • 1
  • 24
  • 49
  • 1
    You should make it clear that it is not some kind of "unsupported" or "bug" or "missing feature", but that's actually the whole point / feature of Cassandra and this is just one manifestation of the data model in Cassandra. – Cedric H. Jan 02 '16 at 12:56
  • 1
    Hi Cedric, I don't agree with you that joins are precluded by the data model in Cassandra. We can see that distributed joins could be implemented in Cassandra, as shown for example in Spark. So I think it's accurate the say they are unsupported in Cassandra rather than suggest they are impossible to implement. – Jim Meyer Jan 02 '16 at 14:11