Apache Cassandra 1.2 Documentation

ASSUME

Treats a column name or value as a specified type, even if that type information is not specified in the table's metadata.

Synopsis

ASSUME keyspace_name.table_name
storage_type_definition , storage_type_definition ..., ...

storage_type_definition is:

(column_name) VALUES ARE datatype
| NAMES ARE datatype
| VALUES ARE datatype

Synopsis legend

Description

ASSUME treats all values in the given column in the given table as being of the specified type when the storage_type_definition is:

(column_name) VALUES ARE datatype

This overrides any other information about the type of a value.

ASSUME treats all column names in the given table as being of the given type when the storage_type_definition is:

NAMES ARE <type>

ASSUME treats all column values in the given table as being of the given type unless overridden by a column-specific ASSUME or column-specific metadata in the table's definition.

Assigning multiple data type overrides

Assign multiple overrides at once for the same table by separating storage_type_definitions with commas:

ASSUME ks.table NAMES ARE uuid,
  VALUES ARE int, (col)
  VALUES ARE ascii

Examples

ASSUME users NAMES ARE text, VALUES are text;
ASSUME users(user_id) VALUES are uuid;