Skip to main content
Cassandra is supported as a source for Target Sync only — there is no CDC path. See the Cassandra Source Guide for configuration.

Schema Mapping

Wirekite projects a CQL keyspace onto a fundamentally relational target. The structural mapping is:
CQL conceptTarget concept
keyspaceschema (renamable via schemaRename)
tabletable
partition key + clustering columnscomposite PRIMARY KEY (in declaration order)
regular columnnullable column
static columnregular column (the static-ness is not modeled)
frozen<…>transparent — the inner type is used

Canonical Type Mapping

Wirekite first converts each CQL type to an internal Wirekite type, then each target’s loader maps that to a concrete column type. The source of truth is cassandra/db_utils.CQLToWirekite.
CQL typeWirekite typeNotes
text, varchar, asciiVARCHARlength synthesized to 4000 — see Synthesized Bounds
tinyintINT8
smallintINT16
intINT32
bigintINT64
counterINT64read as its current value
varintNUMERICarbitrary-precision integer — precision synthesized to (38,0)
decimalNUMERICprecision/scale synthesized to (38,18)
floatFLOAT32
doubleFLOAT64
booleanBOOL
timestampTIMESTAMPmillisecond precision, UTC
dateDATE
timeTIMEnanosecond-since-midnight rendered HH:MM:SS.ffffff
uuid, timeuuidUUIDrendered lowercase for stable ordering
inetVARCHARIP rendered as text
durationVARCHARISO-8601-ish text
blobBLOB
list<…>, set<…>, map<…>, tuple<…>JSONserialized to JSON — see how collections are encoded
user-defined type (UDT), any unknownJSONserialized to JSON

Mapping to Targets

The following tables show how each CQL type lands on every supported Target Sync target.

Integer Types

CassandraPostgreSQLMySQLSQL ServerOracleFireboltSnowflakeSpannerBigQuerySingleStoreDatabricks
tinyintsmallintTINYINTSMALLINTNUMBER(38)INTEGERtinyintINT64INT64TINYINTTINYINT
smallintsmallintSMALLINTSMALLINTNUMBER(38)INTEGERnumberINT64INT64SMALLINTSMALLINT
intintegerINTINTNUMBER(38)INTEGERintINT64INT64INTINT
bigintbigintBIGINTBIGINTNUMBER(38)BIGINTbigintINT64INT64BIGINTBIGINT
counterbigintBIGINTBIGINTNUMBER(38)BIGINTbigintINT64INT64BIGINTBIGINT

Decimal Types

CassandraPostgreSQLMySQLSQL ServerOracleFireboltSnowflakeSpannerBigQuerySingleStoreDatabricks
varintnumeric(38,0)NUMERIC(38,0)NUMERIC(38,0)NUMBER(38,0)NUMERIC(38,0)number(38,0)NUMERICNUMERICNUMERIC(38,0)DECIMAL(38,0)
decimalnumeric(38,18)NUMERIC(38,18)NUMERIC(38,18)NUMBER(38,18)NUMERIC(38,18)number(38,18)NUMERICNUMERICNUMERIC(38,18)DECIMAL(38,18)
Spanner and BigQuery use a fixed-scale NUMERIC. Spanner NUMERIC is precision/scale (38,9) and BigQuery NUMERIC caps at (38,9). A Cassandra decimal carries up to scale 18, so on these two targets the scale is clamped to 9. The validator compares decimal values numerically (not as strings), so padding/clamping on the other targets does not produce false diffs.

Floating Point Types

CassandraPostgreSQLMySQLSQL ServerOracleFireboltSnowflakeSpannerBigQuerySingleStoreDatabricks
floatrealFLOATREALBINARY_FLOATDOUBLEfloatFLOAT32FLOAT64FLOATFLOAT
doubledouble precisionDOUBLEFLOATBINARY_DOUBLEDOUBLEfloatFLOAT64FLOAT64DOUBLEDOUBLE

Boolean Type

CassandraPostgreSQLMySQLSQL ServerOracleFireboltSnowflakeSpannerBigQuerySingleStoreDatabricks
booleanbooleanTINYINT(1)BITCHAR(1)BOOLEANbooleanBOOLBOOLTINYINT(1)BOOLEAN

Date and Time Types

CassandraPostgreSQLMySQLSQL ServerOracleFireboltSnowflakeSpannerBigQuerySingleStoreDatabricks
timestamptimestamp without time zoneDATETIME(6)DATETIME2TIMESTAMPTIMESTAMPtimestamp_ntzTIMESTAMPDATETIMEDATETIME(6)TIMESTAMP_NTZ
datedateDATEDATEDATEDATEdateDATEDATEDATEDATE
timetime without time zoneTIME(6)TIMEVARCHAR2(64)TEXTtimeSTRINGTIMETIME(6)STRING

Character, Network & UUID Types

CassandraPostgreSQLMySQLSQL ServerOracleFireboltSnowflakeSpannerBigQuerySingleStoreDatabricks
text / varchar / asciicharacter varying(4000)VARCHAR(4000)VARCHAR(4000)VARCHAR2(4000)TEXTvarchar(4000)STRING(4000)STRINGVARCHAR(4000)STRING
inetcharacter varying(4000)VARCHAR(4000)VARCHAR(4000)VARCHAR2(4000)TEXTvarchar(4000)STRING(4000)STRINGVARCHAR(4000)STRING
durationcharacter varying(4000)VARCHAR(4000)VARCHAR(4000)VARCHAR2(4000)TEXTvarchar(4000)STRING(4000)STRINGVARCHAR(4000)STRING
uuid / timeuuiduuidVARCHAR(64)UNIQUEIDENTIFIERVARCHAR2(128)TEXTvarchar(64)STRINGSTRINGVARCHAR(64)STRING

Binary Type

CassandraPostgreSQLMySQLSQL ServerOracleFireboltSnowflakeSpannerBigQuerySingleStoreDatabricks
blobbyteaBLOBVARBINARY(MAX)BLOBBYTEAbinaryBYTESBYTESBLOBBINARY

Collection & Complex Types

CassandraPostgreSQLMySQLSQL ServerOracleFireboltSnowflakeSpannerBigQuerySingleStoreDatabricks
list / set / map / tuple / UDTjsonbJSONVARCHAR(MAX)CLOBTEXTvarcharJSONJSONJSONSTRING
MariaDB maps identically to MySQL, and TigerData identically to PostgreSQL. MongoDB is a schemaless target — scalar types land as native BSON values and JSON columns become sub-documents, so it is not shown as a column above.

Synthesized Bounds

Cassandra has no column lengths, precisions, or scalestext is unbounded and decimal/varint are arbitrary-precision. Relational targets, however, want bounded, precise column types, and some bulk loaders reject unbounded ones outright. So the schema extractor synthesizes sensible bounds:
  • varintNUMERIC(38,0) and decimalNUMERIC(38,18). Without an explicit precision, Databricks defaults NUMERIC to DECIMAL(10,0) and overflows on a 19-digit varint. 38 is the maximum Databricks/Oracle decimal precision; scale 0 keeps varint an exact integer, and scale 18 leaves room for a fraction. Targets that prefer arbitrary precision (PostgreSQL, Firebolt) simply pad the scale.
  • text / varchar / ascii / inet / duration → length 4000. A length-less VARCHAR becomes VARCHAR(MAX) on SQL Server (whose BCP loader cannot bind it) and CLOB on Oracle (whose OCI loader cannot bulk-load it). 4000 is Oracle’s VARCHAR2 standard maximum and within SQL Server’s 8000 non-MAX cap.
The fixed 4000-character bound is lossy for genuinely large Cassandra text. It is ample for typical keys, labels, and short documents; tables that need larger text should raise this bound.

How Collections Are Encoded

list, set, map, tuple, and user-defined types are serialized to a single JSON column on the target. Wirekite does not explode collections into child tables, normalize maps, or model UDT fields — the relational skeleton (primary key + scalar columns) stays queryable, and the complex values ride along as JSON. To keep the diff stable across runs, the JSON is canonicalized:
  • list and tuple → JSON array, order preserved.
  • set → JSON array, sorted (sets are unordered in Cassandra).
  • map → JSON object with keys sorted and coerced to strings.
  • UDT → JSON object, fields in declared order.
Complex columns cannot be part of a primary key, and frozen<…> wrappers are transparent (the inner type is used).