Data Type Mapping
Doris continuous load is experimental and supported starting with Doris 4.1.5.
The table below shows how each upstream MySQL column type maps to a Doris column type. There is a single mapping, shared by both sync methods — the only difference is who creates the target table:
- Auto Table Creation Sync: Doris reads the upstream schema and creates the target table with these Doris column types automatically.
- SQL Mapping Sync: you create the target table yourself, using a compatible Doris type for each column.
In both cases, the values are written following the same mapping. For types that are not supported, see Limitations.
JDBC URL Parameter Normalization
When you create a Streaming Job with a MySQL data source (or use the cdc_stream() table function), Doris automatically appends the following parameters to jdbc_url unless you set them explicitly:
| Parameter | Injected Value | Effect |
|---|---|---|
tinyInt1isBit | false | TINYINT(1) is read as TINYINT (1 / 0) instead of BOOLEAN (true / false) |
yearIsDateType | false | YEAR is read as an integer year instead of a date |
useUnicode | true | Use Unicode encoding |
characterEncoding | utf-8 | Use UTF-8 as the character set |
If any of these parameters is set explicitly in jdbc_url, Doris keeps your value and does not override it. The PostgreSQL jdbc_url is not normalized.
To read TINYINT(1) as BOOLEAN or YEAR as a date, explicitly set tinyInt1isBit=true or yearIsDateType=true, respectively, in jdbc_url.
MySQL to Doris
| MySQL Type | Doris Type | Notes |
|---|---|---|
BOOLEAN / TINYINT(1) | TINYINT | Maps to TINYINT (values 1 / 0). See JDBC URL Parameter Normalization for the reason |
TINYINT | TINYINT | UNSIGNED → SMALLINT |
SMALLINT | SMALLINT | UNSIGNED → INT |
MEDIUMINT | INT | UNSIGNED → INT |
INT | INT | UNSIGNED → BIGINT |
BIGINT | BIGINT | UNSIGNED → LARGEINT |
YEAR | SMALLINT | The value is read as an integer year rather than as a date; the MySQL zero year (0000) is kept as 0 |
FLOAT | FLOAT | |
DOUBLE | DOUBLE | |
DECIMAL(p,s) | DECIMAL(p,s) | Very high precision falls back to STRING |
DATE | DATE | |
DATETIME | DATETIME(s) | Microsecond scale (0–6) preserved |
TIMESTAMP | DATETIME(s) | Normalized to the server time zone |
TIME | STRING | Serialized as a string, e.g. 12:34:56.000000 |
CHAR | CHAR | |
VARCHAR | VARCHAR | |
TINYTEXT / TEXT / MEDIUMTEXT / LONGTEXT | STRING | |
BINARY / VARBINARY / TINYBLOB / BLOB / MEDIUMBLOB / LONGBLOB | STRING | Base64-encoded string |
BIT(1) | BOOLEAN | |
BIT(n>1) | STRING | Base64-encoded string |
JSON | STRING | Stored as JSON text |
ENUM | STRING | Resolved to the label value |
SET | STRING | Resolved to comma-separated labels |
Spatial types (GEOMETRY, POINT, …) and other types | Not supported | Auto Table Creation fails for tables with such columns; use SQL Mapping Sync (cast in SELECT) or exclude the column |