Apache Cassandra 1.1 Documentation

ASSUME

This document corresponds to an earlier product version. Make sure you are using the version that corresponds to your version.

Latest Cassandra documentation | Earlier Cassandra documentation

Sets the client-side encoding for a cqlsh session.

Synopsis

ASSUME [<keyspace_name>].<columnfamily_name>
       <storage_type_definition>
       [, ...] ;

<storage_type_definition> is:

(<primary key column_name>) VALUES ARE <datatype>
     | NAMES ARE <datatype>
     | VALUES ARE <datatype>

Description

Cassandra is a schema-optional data model, meaning that column families are not required to have data type information explicitly defined for column names, column values or row key values. When type information is not explicitly defined, and implicit typing cannot be determined, data is displayed as raw hex bytes (blob type), which is not human-readable. The ASSUME command allows you to specify type information for particular column family values passed between the cqlsh client and the Cassandra server.

The name of the column family (optionally prefix the keyspace) for which to specify assumed types follows the ASSUME keyword. If keyspace is not supplied, the keyspace default is the currently connected one. Next, list the assumed type for column name, preceded by NAMES ARE, then list the assumed type for column values preceded by VALUES ARE.

To declare an assumed type for a particular column, such as the row key, use the column family row key name.

Examples

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

CQL Commands

CQL Commands CQL Shell Commands
ALTER TABLE ASSUME
ALTER KEYSPACE CAPTURE
BATCH COPY
CREATE TABLE DESCRIBE
CREATE INDEX EXIT
CREATE KEYSPACE SHOW
DELETE SOURCE
DROP TABLE  
DROP INDEX  
DROP KEYSPACE  
INSERT  
SELECT  
TRUNCATE  
UPDATE  
USE