Strings

Cassandra has two types that store string data:

  • The text type stores the UTF-8 encoded strings. It's also aliased as the varchar type; you can use these interchangeably
  • The ascii type stores strings of ASCII characters (bytes 0-127)

Neither of the previous string types has a limit on the length of strings that can be stored. In CQL, string literals are surrounded by single quotes, 'like this'.

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.