Skip to content

Data type mapping

TwinCommit maps each source column type to the closest target type when twincommit ddl creates tables. Values are transferred losslessly unless a note says otherwise.

Db2 PostgreSQL SQL Server Databricks (Delta) Snowflake
SMALLINT, INTEGER, BIGINT smallint, integer, bigint smallint, int, bigint SMALLINT, INT, BIGINT NUMBER(5/10/19,0)
DECIMAL(p,s) numeric(p,s) decimal(p,s) DECIMAL(p,s) NUMBER(p,s)
REAL, DOUBLE real, double precision real, float(53) FLOAT, DOUBLE FLOAT
CHAR(n), VARCHAR(n) char(n), varchar(n) nchar(n), nvarchar(n); nvarchar(max) above 4000 STRING VARCHAR(n)
CHAR/VARCHAR FOR BIT DATA, BINARY, VARBINARY bytea binary(n), varbinary(n); varbinary(max) above 8000 BINARY BINARY
DATE date date DATE DATE
TIME time(0) time(0) STRING (HH:MM:SS) TIME(0)
TIMESTAMP(p) timestamp(p), max 6 digits (rounded) datetime2(p), max 7 digits (truncated) TIMESTAMP_NTZ (µs) TIMESTAMP_NTZ(p)
BOOLEAN boolean bit BOOLEAN BOOLEAN

LOB, XML, DECFLOAT and GRAPHIC columns must be listed under exclude_columns.

Oracle PostgreSQL SQL Server Databricks (Delta) Snowflake
NUMBER(p,s) numeric(p,s) decimal(p,s) DECIMAL(p,s) NUMBER(p,s)
NUMBER (no precision) numeric decimal(38,10) DECIMAL(38,10) NUMBER(38,10)
BINARY_FLOAT, BINARY_DOUBLE real, double precision real, float(53) FLOAT, DOUBLE FLOAT
VARCHAR2(n), NVARCHAR2(n), CHAR(n) varchar(n), char(n) nvarchar(n), nchar(n) STRING VARCHAR(n)
DATE timestamp(0) datetime2(0) TIMESTAMP_NTZ TIMESTAMP_NTZ(0)
TIMESTAMP(p) timestamp(p) datetime2(p) TIMESTAMP_NTZ TIMESTAMP_NTZ(p)
TIMESTAMP WITH TIME ZONE timestamptz datetimeoffset TIMESTAMP TIMESTAMP_TZ
RAW(n) bytea varbinary(n) BINARY BINARY
CLOB, NCLOB (≤ 16 MiB) text nvarchar(max) STRING VARCHAR
BLOB (≤ 16 MiB) bytea varbinary(max) BINARY BINARY
SQL Server PostgreSQL Databricks (Delta) Snowflake
tinyint, smallint, int, bigint smallint, smallint, integer, bigint TINYINT, SMALLINT, INT, BIGINT NUMBER
decimal(p,s), money numeric(p,s), numeric(19,4) DECIMAL NUMBER
nvarchar(n), varchar(n) varchar(n) STRING VARCHAR(n)
nvarchar(max), varchar(max) text STRING VARCHAR
datetime2(p), datetime timestamp(p), timestamp(3) TIMESTAMP_NTZ TIMESTAMP_NTZ
datetimeoffset timestamptz TIMESTAMP TIMESTAMP_TZ
uniqueidentifier uuid STRING VARCHAR(36)
bit boolean BOOLEAN BOOLEAN
varbinary(n) bytea BINARY BINARY
MySQL / MariaDB PostgreSQL SQL Server Databricks (Delta) Snowflake / BigQuery
TINYINT, SMALLINT, INT, BIGINT (signed) smallint, smallint, integer, bigint tinyint, smallint, int, bigint TINYINT … BIGINT NUMBER / INT64
BIGINT UNSIGNED numeric(20,0) decimal(20,0) DECIMAL(20,0) NUMBER(20,0) / NUMERIC
DECIMAL(p,s) numeric(p,s) decimal(p,s) DECIMAL(p,s) NUMBER(p,s) / NUMERIC or BIGNUMERIC
FLOAT, DOUBLE real, double precision real, float(53) FLOAT, DOUBLE FLOAT / FLOAT64
CHAR(n), VARCHAR(n) char(n), varchar(n) nchar(n), nvarchar(n) STRING VARCHAR(n) / STRING
TEXT, MEDIUMTEXT, LONGTEXT text nvarchar(max) STRING VARCHAR / STRING
BLOB family, BINARY, VARBINARY bytea varbinary(max) BINARY BINARY / BYTES
DATETIME(p), TIMESTAMP(p) timestamp(p), timestamptz(p) datetime2(p), datetimeoffset TIMESTAMP_NTZ, TIMESTAMP TIMESTAMP_NTZ, TIMESTAMP_TZ / DATETIME, TIMESTAMP
DATE, TIME date, time date, time DATE, STRING DATE, TIME
JSON jsonb nvarchar(max) STRING VARIANT / JSON
ENUM, SET text nvarchar(255) STRING VARCHAR / STRING
BIT(1) / BOOLEAN boolean bit BOOLEAN BOOLEAN / BOOL

Zero dates (0000-00-00) are written as NULL. Set zero_date: epoch on the table to use 1970-01-01 instead.

SAP HANA PostgreSQL SQL Server Databricks (Delta) Snowflake
TINYINT, SMALLINT, INTEGER, BIGINT smallint, smallint, integer, bigint tinyint, smallint, int, bigint TINYINT … BIGINT NUMBER
DECIMAL(p,s), SMALLDECIMAL numeric(p,s), numeric decimal(p,s), decimal(38,10) DECIMAL NUMBER
NVARCHAR(n), VARCHAR(n), ALPHANUM(n) varchar(n) nvarchar(n) STRING VARCHAR(n)
NCLOB, CLOB (≤ 16 MiB) text nvarchar(max) STRING VARCHAR
VARBINARY(n), BLOB (≤ 16 MiB) bytea varbinary BINARY BINARY
DATE, TIME, SECONDDATE, TIMESTAMP date, time, timestamp(0), timestamp(6) date, time, datetime2(0), datetime2(7) DATE, STRING, TIMESTAMP_NTZ DATE, TIME, TIMESTAMP_NTZ
BOOLEAN boolean bit BOOLEAN BOOLEAN

ABAP DATS and TIMS fields stored as NVARCHAR(8) / NVARCHAR(6) are replicated as strings. Add cast: {ERDAT: date} on the table to convert them.

With flatten: true, top-level fields map to columns. Without it, the whole document is stored in a single JSON column next to the _id key.

BSON PostgreSQL SQL Server Snowflake / BigQuery Databricks
ObjectId text (24 hex) char(24) VARCHAR(24) / STRING STRING
int32, int64 integer, bigint int, bigint NUMBER / INT64 INT, BIGINT
double, decimal128 double precision, numeric float(53), decimal(38,10) FLOAT, NUMBER / FLOAT64, BIGNUMERIC DOUBLE, DECIMAL(38,10)
string text nvarchar(max) VARCHAR / STRING STRING
date timestamptz(3) datetimeoffset(3) TIMESTAMP_TZ / TIMESTAMP TIMESTAMP
bool boolean bit BOOLEAN / BOOL BOOLEAN
object, array jsonb nvarchar(max) (JSON) VARIANT / JSON STRING (JSON)
binData bytea varbinary(max) BINARY / BYTES BINARY

Relational → MongoDB, Cassandra, Redis and Elasticsearch

Section titled “Relational → MongoDB, Cassandra, Redis and Elasticsearch”
  • MongoDB: numbers map to int32, int64 or decimal128; timestamps map to date; binary maps to binData; DECIMAL keeps its precision as decimal128.
  • Cassandra: the column types follow CQL (int, bigint, decimal, text, timestamp, blob, boolean). The source primary key becomes the partition key unless partition_key is set on the table.
  • Redis: every value is stored as a string in the hash, with timestamps in ISO 8601 and decimals as exact strings, or as native JSON types when json: true.
  • Elasticsearch: twincommit ddl generates an index template with keyword, long, scaled_float/double, date and binary fields.