Skip to content

Commit

Permalink
Improve type mapping documentation for Druid connector
Browse files Browse the repository at this point in the history
  • Loading branch information
Terry Blessing authored and hashhar committed Sep 6, 2022
1 parent 7f07c54 commit ce608b7
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions docs/src/main/sphinx/connector/druid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,45 @@ name from the properties file.
Type mapping
------------

Because Trino and Druid each support types that the other does not, this
connector modifies some types when reading data.

Druid type to Trino type mapping
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The connector maps Druid types to the corresponding Trino types according to the
following table:

.. list-table:: Druid type to Trino type mapping
:widths: 30, 30, 50
:header-rows: 1

* - Druid type
- Trino type
- Notes
* - ``STRING``
- ``VARCHAR``
-
* - ``FLOAT``
- ``REAL``
-
* - ``DOUBLE``
- ``DOUBLE``
-
* - ``LONG``
- ``BIGINT``
- Except for the special ``_time`` column, which is mapped to ``TIMESTAMP``.
* - ``TIMESTAMP``
- ``TIMESTAMP``
- Only applicable to the special ``_time`` column.

No other data types are supported.

Druid does not have a real ``NULL`` value for any data type. By
default, Druid treats ``NULL`` as the default value for a data type. For
example, ``LONG`` would be ``0``, ``DOUBLE`` would be ``0.0``, ``STRING`` would
be an empty string ``''``, and so forth.

.. include:: jdbc-type-mapping.fragment

.. _druid-sql-support:
Expand Down

0 comments on commit ce608b7

Please sign in to comment.