Data Types
Because HBase stores data in raw binary streams, the data can be stored in a variety of formats. The Simba HBase ODBC Driver supports many common data formats, converting the raw binary data into SQL types based on the data type selected for each column.
The table below lists the supported data type mappings.
HBase Type | SQL Type | Description |
---|---|---|
HB_ASCII |
SQL_VARCHAR |
Text encoded in ASCII |
HB_BINARY |
SQL_VARBINARY |
Raw binary data |
HB_BIT |
SQL_BIT |
1 byte zero (false)/one (true) |
HB_F32B |
SQL_REAL |
IEEE-745 single-precision 4 bytes big endian |
HB_F32L |
SQL_REAL |
IEEE-745 single-precision 4 bytes little endian |
HB_F64B |
SQL_DOUBLE |
IEEE-745 single-precision 8 bytes big endian |
HB_F64L |
SQL_DOUBLE |
IEEE-745 single-precision 8 bytes little endian |
HB_FILETIME |
SQL_TYPE_TIMESTAMP |
64-bit/8 bytes signed integer number of 100ns since 1601-01-01 00:00:00 little endian (Windows FILETIME equivalent) |
HB_SI8 |
SQL_TINYINT |
8-bit/1 byte signed integer |
HB_SI16B |
SQL_SMALLINT |
16-bit/2 bytes signed integer big endian |
HB_SI16L |
SQL_SMALLINT |
16-bit/2 bytes signed integer little endian |
HB_SI32B |
SQL_INTEGER |
32-bit/4 bytes signed integer big endian |
HB_SI32L |
SQL_INTEGER |
32-bit/4 bytes signed integer little endian |
HB_SI64B |
SQL_BIGINT |
64-bit/8 bytes signed integer big endian |
HB_SI64L |
SQL_BIGINT |
64-bit/8 bytes signed integer little endian |
HB_SYSTEMTIME |
SQL_TYPE_TIMESTAMP |
Serialized Windows SYSTEMTIME structure |
HB_UI8 |
SQL_TINYINT |
8-bit/1 byte unsigned integer |
HB_UI16B |
SQL_SMALLINT |
16-bit/2 bytes unsigned integer big endian |
HB_UI16L |
SQL_SMALLINT |
16-bit/2 bytes unsigned integer little endian |
HB_UI32B |
SQL_INTEGER |
32-bit/4 bytes unsigned integer big endian |
HB_UI32L |
SQL_INTEGER |
32-bit/4 bytes unsigned integer little endian |
HB_UI64B |
SQL_BIGINT |
64-bit/8 bytes unsigned integer big endian |
HB_UI64L |
SQL_BIGINT |
64-bit/8 bytes unsigned integer little endian |
HB_UT32B |
SQL_TYPE_TIMESTAMP |
32-bit/4 bytes signed integer number of seconds since 1970-01-01 00:00:00 big endian (valid to 2038) |
HB_UT32L |
SQL_TYPE_TIMESTAMP |
32-bit/4 bytes signed integer number of seconds since 1970-01-01 00:00:00 little endian (valid to 2038) |
HB_UT64B |
SQL_TYPE_TIMESTAMP |
64-bit/8 bytes signed integer number of seconds since 1970-01-01 00:00:00 big endian |
HB_UT64L |
SQL_TYPE_TIMESTAMP |
64-bit/8 bytes signed integer number of seconds since 1970-01-01 00:00:00 little endian |
HB_UTF8 |
SQL_WVARCHAR |
Text encoded as UTF-8 |
HB_UTF16 |
SQL_WVARCHAR |
Text encoded as UTF-16 |
HB_UMT64B |
SQL_TYPE_TIMESTAMP |
64-bit/8 bytes signed integer number of milliseconds since 1970-01-01 00:00:00 big endian |
HB_UMT64L |
SQL_TYPE_TIMESTAMP |
64-bit/8 bytes signed integer number of milliseconds since 1970-01-01 00:00:00 little endian |
HB_UUT64B |
SQL_TYPE_TIMESTAMP |
64-bit/8 bytes signed integer number of microseconds since 1970-01-01 00:00:00 big endian |
HB_UUT64L |
SQL_TYPE_TIMESTAMP |
64-bit/8 bytes signed integer number of microseconds since 1970-01-01 00:00:00 little endian |