> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Data types

> Spark SQL data types and their support in SparkSQL and Databricks compatibility modes.

Preview

Spark [data types](https://spark.apache.org/docs/latest/sql-ref-datatypes.html) in [SparkSQL and Databricks compatibility modes](https://docs.firebolt.io/reference-sql/spark/overview.md). A supported type name can be written as-is in casts and column definitions. Both modes map types the same way.

| Spark type | Support | Notes |
| :- | :- | :- |
| `BOOLEAN` | Supported | |
| `TINYINT`, `SMALLINT` | Supported | Stored as `INTEGER`: Firebolt has no narrower integer type. `BYTE` and `SHORT` are not supported. |
| `INT`, `INTEGER` | Supported | |
| `BIGINT` | Supported | |
| `LONG` | SparkSQL mode only | A synonym for `BIGINT`. Use `BIGINT` in Databricks mode. |
| `FLOAT`, `REAL` | Supported | 32-bit floating point. |
| `DOUBLE` | Supported | |
| `DECIMAL(p, s)`, `DEC`, `NUMERIC` | With limitations | Always `NUMERIC(38, 9)`: the declared precision and scale are not applied. |
| `STRING`, `VARCHAR(n)`, `CHAR(n)` | Supported | All map to `TEXT`. A declared length is not enforced, and `CHAR` is not blank-padded. |
| `BINARY` | Supported | |
| `DATE` | Supported | |
| `TIMESTAMP`, `TIMESTAMP_LTZ` | Supported | An instant, shown in the session time zone, as in Spark. |
| `TIMESTAMP_NTZ` | Supported | A wall-clock date and time with no time zone. |
| `ARRAY<T>` | Supported | Subscripts count from 0, as in Spark: `arr[0]` is the first element. |
| `STRUCT<name: T, ...>` | Supported | Fields are read with `.`, as in `s.name`. |
| `MAP<K, V>` | Not supported | Neither a column type nor a value: `map(...)` and the `map_` functions are rejected. |
| `INTERVAL` | With limitations | Interval literals and arithmetic work. An `INTERVAL` column type, or a cast to an interval type, is not supported. |
| `VARIANT`, `OBJECT` | Not supported | Store semi-structured data as `STRING` and read it with the JSON functions. |
| `TIME` | Not supported | |
| `VOID` | Not supported | |
| `GEOGRAPHY` | With limitations | The Databricks type name is accepted. The Spark `ST_` functions are not supported; see [Geospatial functions](https://docs.firebolt.io/reference-sql/spark/functions/geospatial.md). |
| `GEOMETRY` | Not supported | |

## Column definitions

`NOT NULL`, `DEFAULT <expr>`, and `GENERATED ALWAYS AS (expr)` are applied. A generated column cannot be computed from a `TIMESTAMP`, which is Firebolt's `TIMESTAMPTZ` and depends on the session time zone; use `TIMESTAMP_NTZ`. Identity columns, `GENERATED ALWAYS AS IDENTITY` and `GENERATED BY DEFAULT AS IDENTITY`, are not supported. A `PRIMARY KEY` constraint requires its columns to be declared `NOT NULL`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.