Data Types

The Simba Apache Spark ODBC Connector supports many common data formats, converting between Spark data types and SQL data types.

The following table lists the supported data type mappings.

Spark Type SQL Type

BIGINT

SQL_BIGINT

BINARY

SQL_VARBINARY

BOOLEAN

SQL_BIT

CHAR(n)

SQL_CHAR

DATE

SQL_TYPE_DATE

DECIMAL

SQL_DECIMAL

DECIMAL(p,s)

SQL_DECIMAL

DOUBLE

SQL_DOUBLE

FLOAT

SQL_REAL

INT

SQL_INTEGER

SMALLINT

SQL_SMALLINT

STRING

SQL_VARCHAR

TIMESTAMP

SQL_TYPE_TIMESTAMP

TINYINT

SQL_TINYINT

VARCHAR(n)

SQL_VARCHAR

Note:

The aggregate types (ARRAY, MAP, and STRUCT) are not supported. Columns of aggregate types are treated as STRING columns.