O'Reilly logo

Apache Cassandra Essentials by Nitin Padalia

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Data types

Cassandra has five categories or data types:

  1. Native types: These are built-in types in Cassandra. For each type there is a keyword to define.
  2. Collection types: These types can store a group of native type elements. There are three categories—set, list, and map.
  3. Tuple types: Tuple types can store a fixed length group of elements in a column similar to user-defined types, except that the tuple element field has no names. Hence, the ordering should be the same as during inserting a record in the order they are defined at table creation time. The following is an example of creating a column family with a tuple type:
    CREATE TABLE user_reviews ( useriduuid PRIMARY KEY, review frozen<tuple<text, text, decimal>> ) INSERT INTO user_reviews (userid, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required