Beruflich Dokumente
Kultur Dokumente
CQL is a query language for Apache Cassandra, similar to SQL, that makes application development a snap. A growing ecosystem of drivers makes access from many languages/frameworks possible, but for quick tests and exploration, the interactive command interpreter that ships with the Python driver is a great place to start.
$ easy_install cql ... $ cqlsh [-C/--color] localhost 9160
Sessions are bound to a keyspace, to operate on one you must "USE" it rst
USE application;
Creating a new column family with text (utf8) key and column values
CREATE COLUMNFAMILY users (username text PRIMARY KEY, firstname text, middle text, surname text, birthdate text);
Creating an index
CREATE INDEX birthplace ON users (birthplace);
Select the last ten values in reverse order, from a range of columns
SELECT FIRST 10 REVERSED '2011-10-23 23:59'..'2011-10-23 00:00' FROM sessions WHERE username = cdickens;
CQL Datatypes
ascii bigint blob boolean counter decimal double US ASCII encoded string 8-byte long Arbitrary bytes (hex encoded) One of true or false Counter column (an 8-byte long) Decimal value of arbitrary precision 8-byte oating point oat int text timestamp uuid varchar varint 4-byte oating point 4-byte integer UTF-8 encoded string Date and time encoded as an 8-byte long Type 1, or type 4 UUID UTF-8 endoded string Integer value of arbitrary precision
www.acunu.com
Apache Cassandra is a trademark of the Apache Software Foundation