Integers

Cassandra has five types that store integers:

  • The int type stores 32-bit integers, which can store values ranging from approximately -2.1 billion to 2.1 billion
  • The bigint type stores 64-bit integers, which can store values from about -9 quintillion to 9 quintillion
  • The smallint type stores 16-bit integers, which can store values from -32,768 to 32,767
  • The tinyint type stores 8-bit integers, which can store values from -128 to 127
  • The varint type stores integers of arbitrary size; it has no minimum or maximum value

All integer types are signed, meaning they can hold positive or negative integers. There are no unsigned numeric types in Cassandra. Integer literals in CQL, like in most languages, consist of an optional minus sign ...

Get Learning Apache Cassandra - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.