Data Types
The Simba Athena ODBC Driver supports many common data formats, converting between Athena data types and SQL data types.
The following table lists the supported data type mappings.
Athena Type | SQL Type |
---|---|
ARRAY |
|
BIGINT |
SQL_BIGINT |
BINARY |
SQL_VARBINARY |
BOOLEAN |
SQL_BIT |
CHAR |
|
DATE Note: Not supported for Parquet files. |
|
DECIMAL (p, s) |
SQL_DECIMAL |
DOUBLE |
SQL_DOUBLE |
FLOAT | SQL_REAL |
INTEGER Note: Although Athena reports integer data as type INT, the connector reports integer data as type INTEGER to ensure compatibility with standard BI tools. For more information, see Integer Support. |
SQL_INTEGER |
MAP |
|
SMALLINT |
SQL_SMALLINT |
STRING |
|
STRUCT |
|
TIMESTAMP |
|
TINYINT |
SQL_TINYINT |
VARCHAR |
|
Integer Support
Athena combines two different implementations of the integer data type:
- In Data Definition Language (DDL) queries, Athena uses the INT data type from Apache Hive.
- In all other queries, Athena uses the INTEGER data type from Presto.
To support the CAST queries that are used in many BI tools, the connector reports integer data as type INTEGER even though Athena reports the data as type INT.
Be aware that, when executing DDL queries, you must specify integer data using INT as the data type.
Note:
Athena supports some but not all DDL statements. For a list of the supported DDL statements, see "SQL and HiveQL Reference" in the Amazon Athena API Reference: http://docs.aws.amazon.com/athena/latest/ug/language-reference.html.