MariaDB type mapping
The tables below list every MariaDB column type (MariaDB Data Types) and the Kotlin type produced when the column is read into a DataFrame. MariaDB canonicalizes aliases at CREATE TABLE time, so DataFrame only ever sees the canonical type; they are listed in the same row as the canonical type for reference.
API reference: MariaDB
Column nullability is determined from the metadata provided by the JDBC driver. If the driver does not explicitly report a column as non-nullable, it is mapped to a nullable Kotlin type (Int? instead of Int).
Numeric types
Canonical | Aliases | DataFrame column type | Notes |
|---|---|---|---|
|
|
| 1-byte signed integer ( |
|
|
| 1-byte unsigned integer ( |
| alias for |
| Stored as |
|
|
| 2-byte signed integer. The MariaDB driver reports the column class as |
|
|
| 2-byte unsigned integer. |
|
|
| 3-byte signed integer. |
|
|
| 3-byte unsigned integer. |
|
|
| 4-byte signed integer. |
|
|
| MariaDB override: fits in |
|
|
| 8-byte signed integer. |
|
|
| MariaDB override: exceeds |
|
|
| Fixed-point. |
|
|
| 4-byte float. Becomes |
|
|
| 8-byte float. |
| none |
| Single-bit column; the driver reports it as |
| none |
| Reported as |
Date and time types
Canonical | Aliases | DataFrame column type | Notes |
|---|---|---|---|
| none |
| |
| none |
|
|
| none |
| Preprocessed from |
| none |
| Preprocessed from |
| none |
| 1-byte year ( |
String types
Canonical | Aliases | DataFrame column type | Notes |
|---|---|---|---|
|
|
| Fixed-length text. Max |
|
|
| Variable-length text. |
| none |
| Fixed-length binary. |
|
|
| Variable-length binary. |
| none |
| Up to 255 bytes. |
| none |
| Up to 255 bytes. |
| none |
| Up to 64 KiB. |
| none |
| Up to 64 KiB. |
|
|
| Up to 16 MiB. |
|
|
| Up to 16 MiB. |
| none |
| Up to 4 GiB. |
| none |
| Up to 4 GiB. |
| none |
| Enumeration; values read as their string form. |
| none |
| Comma-separated set of values, as a single string. |
JSON and UUID
Canonical | Aliases | DataFrame column type | Notes |
|---|---|---|---|
| none |
| Physically stored as |
| none |
| Available in MariaDB 10.7+. Read as text. Use |
| none |
| Available in MariaDB 10.10+. |
| none |
| Available in MariaDB 10.10+. |
| none | unsupported | Anonymous row types are not currently mapped; see Unsupported types. |
Spatial types
All spatial types are read as ByteArray (WKB / EWKB binary as reported by the driver).
Canonical | Aliases | DataFrame column type | Notes |
|---|---|---|---|
| none |
| |
| none |
| |
| none |
| |
| none |
| |
| none |
| |
| none |
| |
| none |
| |
| none |
|
MariaDB specifics
INT UNSIGNED/INTEGER UNSIGNEDandBIGINT UNSIGNEDare the only types that need MariaDB-specific handling.INT UNSIGNEDis widened toLongandBIGINT UNSIGNEDbecomesBigIntegerbecause its range exceedsLong.SMALLINTmay becomeShort(rather thanInt) when the JDBC driver reports the column class asjava.lang.Short.BIT(1)andBOOLEANare stored the same way (asTINYINT(1)) — see MariaDB's BOOLEAN and BIT pages. Which Kotlin type surfaces depends on how the driver reports the column'sjdbcTypeandjavaClassName.Display width (
INT(11)) andZEROFILLare server-side metadata and are not surfaced by the MariaDB JDBC driver ingetColumnTypeName(); DataFrame only ever sees the canonical name — see Numeric Data Type Overview.