A data type is a classification of data that determines the type of value a variable possesses and the types of mathematical, relational, or logical operations that can be performed on it. Dremio supports the following SQL data types: numeric, string and binary, boolean, date and time, and semi-structured.
The following topics related to data types are covered:
- Data Type Mappings for External Sources: Identifies how data types from external sources are mapped in Dremio.
- Time Zone Support: Covers how timestamp values are handled in Dremio.
- Coercions Support: Details how data types are coerced when there is a mismatch between the source file and the table.
Summary of Supported Data Types in Dremio
Dremio supports the following SQL data types.
|Numeric Data Types||DECIMAL||A DECIMAL type has precision (|
|INT||A 4-byte signed integer. The supported range is from |
|BIGINT||An 8-byte signed integer. The supported range is from |
|FLOAT||A 4-byte single-precision floating point. A FLOAT provides six decimal digits of precision.|
|DOUBLE||8-byte double-precision floating point. A DOUBLE provides 15 decimal digits of precision.|
|String & Binary Data Types||VARCHAR|
|Boolean Data Type||BOOLEAN||The supported values for |
|Date & Time Data Types||DATE||A date value that enables you to calculate and store consistent information about the date of the events and transactions.|
When using a string literal for the date,
|TIME||Identifies the time of day, which enables you to calculate and store consistent information about the time of the events and transactions.|
When using a string literal for the time,
|TIMESTAMP||Represents an absolute point in time with millisecond precision without a time zone. Timestamps are truncated to the nearest millisecond. For more information, see Time Zone Support.|
|INTERVAL (day to seconds)|
INTERVAL (years to months)
|Intervals are used to represent a measure of time. Dremio supports the two available types of intervals: year-month, which stores the year and month (YYYY-MM); and day-time (DD HH:MM:SS), which stores the days, hours, minutes, and seconds.|
Additionally, the following forms are supported:
|Semi-structured Data Types||STRUCT||Used to represent collections of key-value pairs. Keys are non-empty, case-insensitive strings, and values can be of any type. The example shows the required format for a query where the key (|
Dremio does not have STRUCT literals, but you can get the same result using
|LIST||Used to represent a list of arbitrary size, where the index is a non-negative integer and values can be of any type. The elements in a LIST must be of the same type (for example, a list consisting of only integers). The example shows the required format for a query where the index (|
Dremio does not have LIST literals, but you can get the same result using
|MAP||The MAP type is a collection of key-value pairs. MAP keys are case-insensitive strings. All values in a given map have the same type. For example, |
If you have queried tables with MAP data using an earlier release of Dremio, you must run