-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add Oracle connector #1959
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
Merged
Merged
Add Oracle connector #1959
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| ================ | ||
| Oracle Connector | ||
| ================ | ||
|
|
||
| The Oracle connector allows querying and creating tables in an | ||
| external Oracle database. This can be used to join data between | ||
| different systems like Oracle and Hive, or between two different | ||
| Oracle instances. | ||
|
|
||
| Configuration | ||
| ------------- | ||
|
|
||
| To configure the Oracle connector, create a catalog properties file | ||
| in ``etc/catalog`` named, for example, ``oracle.properties``, to | ||
| mount the Oracle connector as the ``oracle`` catalog. | ||
| Create the file with the following contents, replacing the | ||
| connection properties as appropriate for your setup: | ||
|
|
||
| .. code-block:: none | ||
|
|
||
| connector.name=oracle | ||
| connection-url=jdbc:oracle:thin:@example.net:1521/ORCLCDB | ||
| connection-user=root | ||
| connection-password=secret | ||
|
|
||
| Multiple Oracle Servers | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| You can have as many catalogs as you need, so if you have additional | ||
| Oracle servers, simply add another properties file to ``etc/catalog`` | ||
| with a different name (making sure it ends in ``.properties``). For | ||
| example, if you name the property file ``sales.properties``, Presto | ||
| will create a catalog named ``sales`` using the configured connector. | ||
|
|
||
| Querying Oracle | ||
| --------------- | ||
|
|
||
| The Oracle connector provides a schema for every Oracle *database*. | ||
| You can see the available Oracle databases by running ``SHOW SCHEMAS``:: | ||
|
|
||
| SHOW SCHEMAS FROM oracle; | ||
|
|
||
| If you have a Oracle database named ``web``, you can view the tables | ||
| in this database by running ``SHOW TABLES``:: | ||
|
|
||
| SHOW TABLES FROM oracle.web; | ||
|
|
||
| You can see a list of the columns in the ``clicks`` table in the ``web`` database | ||
| using either of the following:: | ||
|
|
||
| DESCRIBE oracle.web.clicks; | ||
| SHOW COLUMNS FROM oracle.web.clicks; | ||
|
|
||
| Finally, you can access the ``clicks`` table in the ``web`` database:: | ||
|
|
||
| SELECT * FROM oracle.web.clicks; | ||
|
|
||
| If you used a different name for your catalog properties file, use | ||
| that catalog name instead of ``oracle`` in the above examples. | ||
|
|
||
| Oracle Connector Limitations | ||
| ---------------------------- | ||
|
|
||
| The following SQL statements are not yet supported: | ||
|
|
||
| * :doc:`/sql/delete` | ||
| * :doc:`/sql/grant` | ||
| * :doc:`/sql/revoke` | ||
| * :doc:`/sql/show-grants` | ||
| * :doc:`/sql/show-roles` | ||
| * :doc:`/sql/show-role-grants` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,154 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <parent> | ||
| <groupId>io.prestosql</groupId> | ||
| <artifactId>presto-root</artifactId> | ||
| <version>334-SNAPSHOT</version> | ||
| </parent> | ||
|
|
||
| <artifactId>presto-oracle</artifactId> | ||
| <description>Presto - Oracle Connector</description> | ||
| <packaging>presto-plugin</packaging> | ||
|
|
||
| <properties> | ||
| <air.main.basedir>${project.parent.basedir}</air.main.basedir> | ||
| </properties> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>com.oracle.ojdbc</groupId> | ||
| <artifactId>ojdbc8</artifactId> | ||
| <version>19.3.0.0</version> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>io.prestosql</groupId> | ||
| <artifactId>presto-base-jdbc</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>io.airlift</groupId> | ||
| <artifactId>configuration</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>io.airlift</groupId> | ||
| <artifactId>log</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>io.airlift</groupId> | ||
| <artifactId>log-manager</artifactId> | ||
| <scope>runtime</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>com.google.guava</groupId> | ||
| <artifactId>guava</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>com.google.inject</groupId> | ||
| <artifactId>guice</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>javax.inject</groupId> | ||
| <artifactId>javax.inject</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>javax.validation</groupId> | ||
| <artifactId>validation-api</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>io.airlift</groupId> | ||
| <artifactId>units</artifactId> | ||
| </dependency> | ||
|
|
||
| <!-- Presto SPI --> | ||
| <dependency> | ||
| <groupId>io.prestosql</groupId> | ||
| <artifactId>presto-spi</artifactId> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>io.airlift</groupId> | ||
| <artifactId>slice</artifactId> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>com.fasterxml.jackson.core</groupId> | ||
| <artifactId>jackson-annotations</artifactId> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.openjdk.jol</groupId> | ||
| <artifactId>jol-core</artifactId> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
|
|
||
| <!-- for testing --> | ||
| <dependency> | ||
| <groupId>org.testng</groupId> | ||
| <artifactId>testng</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>io.prestosql</groupId> | ||
| <artifactId>presto-main</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>io.prestosql</groupId> | ||
| <artifactId>presto-testing</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>io.prestosql.tpch</groupId> | ||
| <artifactId>tpch</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>io.prestosql</groupId> | ||
| <artifactId>presto-tpch</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.testcontainers</groupId> | ||
| <artifactId>testcontainers</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.testcontainers</groupId> | ||
| <artifactId>oracle-xe</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>io.airlift</groupId> | ||
| <artifactId>testing</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
|
|
||
|
ebyhr marked this conversation as resolved.
Outdated
|
||
| <dependency> | ||
| <groupId>org.assertj</groupId> | ||
| <artifactId>assertj-core</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| </dependencies> | ||
| </project> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.