Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Cassandra Validation Classes / Types

DZone's Guide to

Cassandra Validation Classes / Types

· Database Zone
Free Resource

Learn how to create flexible schemas in a relational database using SQL for JSON.

Cassandra validates column names and row keys using validation classes.
This is put in place when you construct a columnFamily.

As an example, in the Thrift API:
CfDef columnFamily = new CfDef(KEYSPACE, COLUMN_FAMILY);
columnFamily.setKey_validation_class("UTF8Type");
columnFamily.setDefault_validation_class("UTF8Type"); 
The default_validation_class is used to validate row keys.
The key_validation_class is used to validate column names.

Googling didn't provide a handy list of validation classes for Cassandra.
So, here it is:

AsciiType.java BooleanType.java 
BytesType.java 
CompositeType.java 
DateType.java 
DecimalType.java 
DoubleType.java 
DynamicCompositeType.java 
FloatType.java 
Int32Type.java 
IntegerType.java 
LexicalUUIDType.java 
LocalByPartionerType.java 
LongType.java 
ReversedType.java 
TimeUUIDType.java 
TypeParser.java 
UTF8Type.java 
UUIDType.java

Source: http://brianoneill.blogspot.com/2012/02/cassandra-validation-classes-types.html

Create flexible schemas using dynamic columns for semi-structured data. Learn how.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}