View Source Data Types Comparison Table
This page contains a table that compares the data types used by Cassandra with their counterparts used by Xandra. Each Cassandra data type corresponds to one or more Elixir data types. What Elixir data type is used for a given Cassandra type is often controlled by a formatting option. For example, a date
value from Cassandra can be returned as a Date.t()
struct or as an integer representing the number of days since the Unix epoch depending on the :date_format
option passed to various Xandra functions.
Comparison Table
Cassandra data type | Elixir data type |
---|---|
ascii | String.t/0 |
bigint | integer/0 |
blob | binary/0 |
boolean | boolean/0 |
counter | integer/0 |
date | Date.t/0 (if date_format: :date ) |
date | integer/0 (if date_format: :integer ), days from Unix epoch |
decimal | {value, scale} (if decimal_format: :tuple ), where value * 10^(-1 * scale) |
decimal | Decimal.t/0 (if decimal_format: :decimal ) |
double | float/0 |
float | float/0 |
inet | :inet.ip_address/0 |
int | integer/0 |
list<T> | list/0 |
map<KeyT, ValueT> | map/0 |
NULL | nil |
set<T> | MapSet.t/0 |
smallint | integer/0 |
text | String.t/0 |
time | integer/0 (if time_format: :integer ), as nanoseconds from midnight |
time | Time.t/0 (if time_format: :time ) |
timestamp | DateTime.t/0 (if timestamp_format: :datetime ) |
timestamp | integer/0 (if timestamp_format: :integer ), as milliseconds from Unix epoch |
timeuuid | binary/0 |
tinyint | integer/0 |
tuple<...> | tuple/0 |
uuid | binary/0 |
varchar | String.t/0 |
varint | integer/0 |