Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to translate complex sql into the equivalent Cassandra representation

Tags:

cassandra

Consider a table with the following table structure ...

CREATE TABLE table1 ( id integer, name varchar(32), ts timestamp );

SELECT * FROM table1 WHERE id = xx and ts between '2010/04/01' and '2010/04/11'

Given this query, how would you represent the given data-set using Cassandra?

like image 897
Alex Avatar asked Apr 28 '10 09:04

Alex


People also ask

Can you use SQL with Cassandra?

You can use the SQL Gateway to configure a TDS (SQL Server) remoting service and set up a linked server for Cassandra data.

What query language does Cassandra use?

Cassandra Query Language (CQL) is a query language for the Apache Cassandra database. The Cassandra Query Language (CQL) is the primary language for communicating with the Apache Cassandra™ database. The most basic way to interact with Apache Cassandra is using the CQL shell, cqlsh.


1 Answers

build an index either on id or ts (whichever is more selective), query on that, and filter the other part manually.

(this is basically what a sql database does under the hood, btw.)

like image 145
jbellis Avatar answered Oct 31 '22 08:10

jbellis