Skip to content
Merged
Show file tree
Hide file tree
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
21 changes: 21 additions & 0 deletions presto-docs/src/main/sphinx/connector/oracle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,27 @@ Finally, you can access the ``clicks`` table in the ``web`` database::
If you used a different name for your catalog properties file, use
that catalog name instead of ``oracle`` in the above examples.

Type mapping
------------

PrestoDB and Oracle each support types that the other does not. When reading from Oracle, Presto converts
the data types from Oracle to equivalent Presto data types.
Refer to the following section for type mapping in each direction.

Oracle to PrestoDB type mapping
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The connector maps Oracle types to the corresponding PrestoDB types:

.. list-table:: Oracle to PrestoDB type mapping
:widths: 50, 50
:header-rows: 1

* - Oracle type
- PrestoDB type
* - ``BLOB``
- ``VARBINARY``

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can have the same documentation as other JDBC connectors for Type mapping instead - https://prestodb.io/docs/current/connector/mysql.html#type-mapping

@steveburnett WDYT?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can have the same documentation as other JDBC connectors for Type mapping instead - https://prestodb.io/docs/current/connector/mysql.html#type-mapping

@steveburnett WDYT?

Yes! Consistency in doc structure helps readers find what they want quicker.

Oracle Connector Limitations
----------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import static com.facebook.presto.plugin.jdbc.mapping.StandardColumnMappings.doubleReadMapping;
import static com.facebook.presto.plugin.jdbc.mapping.StandardColumnMappings.realReadMapping;
import static com.facebook.presto.plugin.jdbc.mapping.StandardColumnMappings.smallintReadMapping;
import static com.facebook.presto.plugin.jdbc.mapping.StandardColumnMappings.varbinaryReadMapping;
import static com.facebook.presto.plugin.jdbc.mapping.StandardColumnMappings.varcharReadMapping;
import static com.facebook.presto.spi.StandardErrorCode.NOT_SUPPORTED;
import static java.lang.String.format;
Expand Down Expand Up @@ -144,6 +145,8 @@ public Optional<ReadMapping> toPrestoType(ConnectorSession session, JdbcTypeHand
switch (typeHandle.getJdbcType()) {
case Types.CLOB:
return Optional.of(varcharReadMapping(createUnboundedVarcharType()));
case Types.BLOB:
return Optional.of(varbinaryReadMapping());
case Types.SMALLINT:
return Optional.of(smallintReadMapping());
case Types.FLOAT:
Expand Down
Loading