Database Reference
In-Depth Information
Another difference between wide and skinny rows is that only wide rows will typically be con-
cerned about sorting order of column names. Which brings us to the next section.
Column Sorting
Columns have another aspect to their definition. In Cassandra, you specify how column names
will be compared for sort order when results are returned to the client. Columns are sorted
by the “Compare With” type defined on their enclosing column family, and you can choose
from the following: AsciiType , BytesType , LexicalUUIDType , IntegerType, LongType ,
TimeUUIDType , or UTF8Type .
AsciiType
AsciiType
This sorts by directly comparing the bytes, validating that the input can be parsed as US-
ASCII. US-ASCII is a character encoding mechanism based on the lexical order of the Eng-
lish alphabet. It defines 128 characters, 94 of which are printable.
BytesType
BytesType
This is the default, and sorts by directly comparing the bytes, skipping the validation step.
BytesType is the default for a reason: it provides the correct sorting for most types of data
(UTF-8 and ASCII included).
LexicalUUIDType
LexicalUUIDType
A 16-byte (128-bit) Universally Unique Identifier (UUID), compared lexically (by byte
value).
LongType
LongType
This sorts by an 8-byte (64-bit) long numeric type.
IntegerType
IntegerType
Introduced in 0.7, this is faster than LongType and allows integers of both fewer and more
bits than the 64 bits provided by LongType .
TimeUUIDType
TimeUUIDType
This sorts by a 16-byte (128-bit) timestamp. There are five common versions of generating
timestamp UUIDs. The scheme Cassandra uses is a version one UUID, which means
that it is generated based on conflating the computer's MAC address and the number of
100-nanosecond intervals since the beginning of the Gregorian calendar.
Search WWH ::




Custom Search