skip to main content
About the Apache Cassandra Driver : Data Types
  

Try DataDirect Drivers Now

Data Types

The following table lists the Apache Cassandra data types and their default mapping for ODBC.
Table 1. Default Mapping for Apache Cassandra Data Types
Apache Cassandra Data Type
ODBC Data Type
ASCII 1
SQL_VARCHAR (12)
Bigint
SQL_BIGINT (-5)
Blob
SQL_LONGVARBINARY (-4)
Boolean
SQL_BIT (-7)
Counter 2
SQL_BIGINT (-5)
Date
SQL_TYPE_DATE (91)
Decimal 3
SQL_DECIMAL (3)
Double
SQL_DOUBLE (8)
Duration 4
SQL_VARCHAR (12)
Float
SQL_REAL (7)
Inet
SQL_VARCHAR (12)
Int
SQL_INTEGER (4)
List
SQL_WLONGVARCHAR (-10)
Map
SQL_WLONGVARCHAR (-10)
Set
SQL_WLONGVARCHAR (-10)
Smallint
SQL_SMALLINT (5)
Time
SQL_TYPE_TIME (92)
Timestamp
SQL_TYPE_TIMESTAMP (93)
TimeUUID
SQL_CHAR (1)
TinyInt
SQL_TINYINT (-6)
Tuple
SQL_WLONGVARCHAR (-10)
Usertype
SQL_WLONGVARCHAR (-10)
UUID
SQL_CHAR (1)
Varchar 5
SQL_WVARCHAR (9)
Varint 6
SQL_DECIMAL (3)

1 ASCII precision is set to 4000 by default, but you can use the AsciiSize connection option to configure Ascii precision. See "Ascii Size" for details.

2 Update is supported for Counter columns when all the other columns in the row comprise that row’s primary key. See "Update" for details.

3 By default, Decimal precision is set to 38 and scale is set to 10; however, you can use the DecimalPrecision and DecimalScale connection options to configure Decimal precision and scale. See "Decimal Precision" and "Decimal Scale" for details.

4 Currently, the Duration type is supported only in simple columns, and not in Collection types.

5 Varchar precision is set to 4000 by default, but you can use the VarcharSize connection option to configure Varchar precision. See "Varchar Size" for details.

6 Varint precision is set to 38 by default, but you can use the VarintPrecision connection option to configure Varint precision. See "Varint Precision" for details.

* Retrieving Data Type Information