H2 type mapping
The tables below list every H2 column type (H2 Data Types) and the Kotlin type produced when the column is read into a DataFrame in H2.Mode.Regular. Aliases are canonicalized by H2 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.
For non-Regular modes, H2 delegates to the emulated dialect — see the Mode section below.
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).
Character types
Canonical | Aliases | DataFrame column type | Notes |
|---|---|---|---|
|
|
| Fixed-length text. |
|
|
| Variable-length text. |
| none |
| Case-insensitive comparison; stored as text. |
|
|
| Large text object. |
Binary types
Canonical | Aliases | DataFrame column type | Notes |
|---|---|---|---|
|
|
| Fixed-length binary. |
|
|
| Variable-length binary. |
|
|
| Large binary object. |
Boolean
Canonical | Aliases | DataFrame column type | Notes |
|---|---|---|---|
|
|
| Single-bit boolean. |
Numeric types
Canonical | Aliases | DataFrame column type | Notes |
|---|---|---|---|
| none |
| 1-byte signed integer. |
|
|
| 2-byte signed integer. |
|
|
| 4-byte signed integer. |
|
|
| 8-byte signed integer. |
|
|
| Fixed-point. |
|
|
| 4-byte float. |
|
|
| 8-byte float. |
| none |
| Decimal floating-point (H2 2.0+). |
Date and time types
Canonical | Aliases | DataFrame column type | Notes |
|---|---|---|---|
| none |
| |
| none |
| |
| none |
| |
|
|
| Preprocessed from |
|
|
| |
| none |
| Any of the 13 interval subtypes; read as text. |
Other types
Canonical | Aliases | DataFrame column type | Notes |
|---|---|---|---|
| none |
| Preprocessed from |
|
|
| Serialised Java object; read as opaque |
| none |
| User-declared enum labels. |
| none |
| Only WKT text. |
| none |
| JSON text. |
| none |
| Element type inferred; falls back to |
| none |
|
Unsupported types
ROW(...)composite / structured types; driver reportsTypes.OTHER; DataFrame column type isAny.INTERVALsubtypes (all 13); read as their text form to aStringcolumn.Domain types (H2 supports
CREATE DOMAIN); transparent at the JDBC layer — the underlying primitive's mapping applies with a column of the corresponding type.GEOMETRYin binary/WKB form; DataFrame reads only the WKT text form to aStringcolumn.
H2 modes
H2(mode = ...) selects the dialect H2 emulates and delegates its type mapping to that dialect. The default mode is Regular.
Mode | Delegates to |
|---|---|
| Default H2 mapping (this page) |
| |
| |
| |
|