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:

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.

Mapping to Targets

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

Integer Types

Decimal Types

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

Boolean Type

Date and Time Types

Character, Network & UUID Types

Binary Type

Collection & Complex Types

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).