Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 108 additions & 34 deletions docs/src/main/sphinx/connector/phoenix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,40 +94,114 @@ that catalog name instead of ``phoenix`` in the above examples.
Type mapping
------------

The data type mappings are as follows:

========================== ============
Phoenix Trino
========================== ============
``BOOLEAN`` (same)
``TINYINT`` (same)
``UNSIGNED_TINYINT`` ``TINYINT``
``SMALLINT`` (same)
``UNSIGNED_SMALLINT`` ``SMALLINT``
``INTEGER`` (same)
``UNSIGNED_INTEGER`` ``INTEGER``
``BIGINT`` (same)
``UNSIGNED_LONG`` ``BIGINT``
``FLOAT`` ``REAL``
``UNSIGNED_FLOAT`` ``FLOAT``
``DOUBLE`` (same)
``UNSIGNED_DOUBLE`` ``DOUBLE``
``DECIMAL`` (same)
``BINARY`` ``VARBINARY``
``VARBINARY`` (same)
``TIME`` (same)
``UNSIGNED_TIME`` ``TIME``
``DATE`` (same)
``UNSIGNED_DATE`` ``DATE``
``CHAR`` (same)
``VARCHAR`` (same)
``ARRAY`` (same)
========================== ============

The Phoenix fixed length ``BINARY`` data type is mapped to the Trino
variable length ``VARBINARY`` data type. There is no way to create a
Phoenix table in Trino that uses the ``BINARY`` data type, as Trino
does not have an equivalent type.
Because Trino and Phoenix each support types that the other does not, this
connector modifies some types when reading or writing data. Data types may not
map the same way in both directions between Trino and the data source. Refer to
the following sections for type mapping in each direction.

Phoenix type to Trino type mapping
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The connector maps Phoenix types to the corresponding Trino types following this
table:

.. list-table:: Phoenix type to Trino type mapping
:widths: 30, 20
:header-rows: 1

* - Phoenix database type
- Trino type
* - ``BOOLEAN``
- ``BOOLEAN``
* - ``TINYINT``
- ``TINYINT``
* - ``UNSIGNED_TINYINT``
- ``TINYINT``
* - ``SMALLINT``
- ``SMALLINT``
* - ``UNSIGNED_SMALLINT``
- ``SMALLINT``
* - ``INTEGER``
- ``INTEGER``
* - ``UNSIGNED_INT``
- ``INTEGER``
* - ``BIGINT``
- ``BIGINT``
* - ``UNSIGNED_LONG``
- ``BIGINT``
* - ``FLOAT``
- ``REAL``
* - ``UNSIGNED_FLOAT``
- ``REAL``
* - ``DOUBLE``
- ``DOUBLE``
* - ``UNSIGNED_DOUBLE``
- ``DOUBLE``
* - ``DECIMAL(p,s)``
- ``DECIMAL(p,s)``
* - ``CHAR(n)``
- ``CHAR(n)``
* - ``VARCHAR(n)``
- ``VARCHAR(n)``
* - ``BINARY``
- ``VARBINARY``
* - ``VARBINARY``
- ``VARBINARY``
* - ``DATE``
- ``DATE``
* - ``UNSIGNED_DATE``
- ``DATE``
* - ``ARRAY``
- ``ARRAY``
Comment thread
Jessie212 marked this conversation as resolved.
Outdated

No other types are supported.

Trino type to Phoenix type mapping
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The Phoenix fixed length ``BINARY`` data type is mapped to the Trino variable
length ``VARBINARY`` data type. There is no way to create a Phoenix table in
Trino that uses the ``BINARY`` data type, as Trino does not have an equivalent
type.

The connector maps Trino types to the corresponding Phoenix types following this
table:

.. list-table:: Trino type to Phoenix type mapping
:widths: 30, 20
:header-rows: 1

* - Trino database type
- Phoenix type
* - ``BOOLEAN``
- ``BOOLEAN``
* - ``TINYINT``
- ``TINYINT``
* - ``SMALLINT``
- ``SMALLINT``
* - ``INTEGER``
- ``INTEGER``
* - ``BIGINT``
- ``BIGINT``
* - ``REAL``
- ``FLOAT``
* - ``DOUBLE``
- ``DOUBLE``
* - ``DECIMAL(p,s)``
- ``DECIMAL(p,s)``
* - ``CHAR(n)``
- ``CHAR(n)``
* - ``VARCHAR(n)``
- ``VARCHAR(n)``
* - ``VARBINARY``
- ``VARBINARY``
* - ``TIME``
- ``TIME``
* - ``DATE``
- ``DATE``
* - ``ARRAY``
- ``ARRAY``

No other types are supported.

Decimal type handling
^^^^^^^^^^^^^^^^^^^^^
Expand Down