Data Types

The Simba Cassandra JDBC Connector supports many common data formats, converting between CQL, SQL, and Java data types. The following table lists the supported data type mappings.

To support complex data types such as lists, maps, and sets, the connector renormalizes the data into virtual tables. For more information, see Virtual Tables.

Additionally, the connector can be configured to flatten UDT data into columns. For more information, see User-Defined Types.

CQL Type SQL Type Java Type

ASCII

VARCHAR

String

BIGINT

BIGINT

Long

BLOB

See the note below.

LONGVARBINARY

String

BOOLEAN

BOOLEAN

Long

COUNTER

BIGINT

Long

DATE

DATE

java.sql.Date

DECIMAL

DECIMAL

See the note below.

java.math.BigDecimal

DOUBLE

DOUBLE

Double

FLOAT

REAL

Float

INET

See the note below.

VARCHAR

String

INT

INTEGER

Integer

LIST

N/A

The data is renormalized into a virtual table.

N/A

MAP

N/A

The data is renormalized into a virtual table.

N/A

SET

N/A

The data is renormalized into a virtual table.

N/A

SMALLINT

SMALLINT

Short

TINYINT TINYINT Byte

TEXT

VARCHAR

String

TIME

TIME

java.sql.Time

TIMESTAMP

See the note below.

TIMESTAMP

java.sql.Timestamp

TIMEUUID

VARCHAR

String

TUPLE

VARCHAR

String

UDT

VARCHAR

String

UUID

VARCHAR

String

VARCHAR

VARCHAR

String

VARINT

NUMERIC

See the note below.

java.math.BigDecimal

Note:
  • The scale and precision for data of type DECIMAL are determined by configurable settings in the connector. For more information, see DecimalColumnScale and DecimalColumnPrecision.
  • The precision for data of type NUMERIC are determined by configurable settings in the connector. For more information, see VarintColumnPrecision.
  • If you insert a BLOB type, then the number of HEX digits must be even. 0xABC is not accepted as a valid binary literal. When you insert binary literal input as a string the connector truncates the last digit. "ABC" is inserted as "AB", for example.
  • Cassandra internally represents a TIMESTAMP value as a 64-bit signed integer value representing the number of milliseconds since epoch January 1 1970 at 00:00:00 GMT. The range of TIMESTAMP values supported by the Simba Cassandra JDBC Connector is from "1601-01-01 00:00:00.000" to "9999-12-31 23:59:59.999".