CQL for Cassandra 2.x

Introduction

This document describes CQL for Cassandra 2.1 and 2.0.x. Cassandra 2.1 documentation and Cassandra 2.0 documentation supplement this document and assume you are familiar with one of these documents.

Cassandra 2.1 features

Cassandra 2.1 new CQL features include:
The cqlsh utility also has been improved: DataStax Java Driver 2.0.0 supports Cassandra 2.1 with limitations. This version of the driver is incompatible with the new features.

Cassandra 2.0.x features

Cassandra 2.0.x key features are:
  • Lightweight transactions using the IF keyword in INSERT and UPDATE statements.
  • Prevention of application errors by performing conditional tests for the existence of a table, keyspace, or index.

    Simply include IF EXISTS or IF NOT EXISTS in DROP or CREATE statements, such as DROP KEYSPACE or CREATE TABLE.

  • Initial support for triggers that fire events executed in or out of a database cluster.
  • The ALTER TABLE DROP command, which had been removed in the earlier release.
  • Column aliases, similar to aliases in RDBMS SQL, in a SELECT statement.
  • Indexing of the any part, partition key or clustering columns, portion of a compound primary key.

DataStax drivers support Cassandra 2.0.

CQL for Cassandra 2.0 deprecated super columns. Cassandra continues to support apps that query super columns, translating super columns on the fly into CQL constructs and results.

Some changes were made to the cqlsh commands in CQL Cassandra 2.0:
  • The ASSUME command has been removed.

    Use the blobAsType and typeAsBlob conversion functions instead of ASSUME.

  • The COPY command now supports for collections.
Several CQL table attributes were added in CQL included with Cassandra 2.0:
  • default_time_to_live
  • memtable_flush_period_in_ms
  • populate_io_cache_on_flush
  • speculative_retry
Show/hide