| Kafka Type | SQL Type (PostgreSQL) | SQL Type (MySQL) | SQL Type (Oracle) |
|---|---|---|---|
| int8 | SMALLINT | TINYINT | NUMBER(3) |
| int16 | INTEGER | SMALLINT | NUMBER(5) |
| int32 | INTEGER | INT | NUMBER(10) |
| int64 | BIGINT | BIGINT | NUMBER(19) |
| float | REAL | FLOAT | NUMBER(7, 2) |
| double | DOUBLE PRECISION | DOUBLE | NUMBER(15, 6) |
| string | VARCHAR | VARCHAR | VARCHAR2 |
| bytes | BYTEA | BLOB | BLOB |
| boolean | BOOLEAN | BOOLEAN | NUMBER(1) |
{"type":"int64","optional":false,"name":"org.apache.kafka.connect.data.Timestamp"} | TIMESTAMP | TIMESTAMP | TIMESTAMP |
{"type":"bytes","optional":false,"name":"org.apache.kafka.connect.data.Decimal","parameters":{"scale":"4","connect.decimal.precision":"38"}} | DECIMAL(38,4) | DECIMAL(38,4) | DECIMAL(38,4) |
{"type":"int32","optional":false,"name":"org.apache.kafka.connect.data.Date"} | DATE | DATE | DATE |
{"type":"int64","optional":false,"name":"org.apache.kafka.connect.data.Time"} | TIME | TIME | N/A |
Transforms
Schema Transforms Supported Types
Mapping Kafka Data Types and SQL Types.
Very simple example of a JSON payload:
And the corresponding schema:
To make it easier to use the Kafka types, please find below the list of supported types mapped to usual SQL types that might be found in source database.
DECIMAL(38,4) means a decimal number with up to 38 digits in total, of which 4 digits can be after the decimal point, one can adjust the precision if needed.
Please see the example of primitive Kafka Schema definitions and their corresponding payloads: