Data Types
The Simba Amazon Athena JDBC Connector supports many common data formats, converting between Athena, JDBC, and Java data types.
The following table lists the supported data type mappings.
Athena Type | JDBC Type | Java Type |
---|---|---|
ARRAY |
ARRAY or VARCHAR (See UseArraySupport) |
java.sql.Array of strings or string |
BIGINT |
BIGINT |
long |
BINARY |
VARBINARY |
byte[] |
BOOLEAN |
BOOLEAN |
boolean |
CHAR |
CHAR |
string |
DATE |
DATE |
java.sql.Date |
DECIMAL (p, s) |
DECIMAL |
java.math.BigDecimal |
DOUBLE |
DOUBLE |
double |
FLOAT |
REAL |
float |
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. |
INTEGER |
int |
MAP |
VARCHAR |
String |
SMALLINT |
SMALLINT |
short |
STRING |
VARCHAR |
String |
STRUCT |
VARCHAR |
String |
TIMESTAMP |
TIMESTAMP |
java.sql.Timestamp |
TINYINT |
TINYINT |
byte |
VARCHAR |
VARCHAR |
String |
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.