October 2018
Beginner to intermediate
348 pages
10h
English
One common point of consternation for many folks new to Cassandra is converting between types. This can be done either by altering the existing table, or coercing the results at query-time with CAST. While some of the types may seem interchangeable, issues can arise when converting between types where the target type cannot support the amount of precision required. The following type conversions can be done without issue:
|
Starting type |
Compatible types |
|
ascii |
text, varchar |
|
bigint |
timestamp, varint |
|
date |
timestamp |
|
int |
bigint |
|
text |
varchar |
|
time |
bigint |
|
timestamp |
bigint, varint, date |
|
timeuuid |
UUID |
|
varchar |
text |
Some notes ...