Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve type mapping documentation for Druid connector #13776

Merged
merged 1 commit into from
Sep 6, 2022
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
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
tlblessing marked this conversation as resolved.
Show resolved Hide resolved

* - Druid type
- Trino type
tlblessing marked this conversation as resolved.
Show resolved Hide resolved
- Notes
* - ``STRING``
tlblessing marked this conversation as resolved.
Show resolved Hide resolved
- ``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