Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#2656] improvement(docs): Add more details in the document of trino-connector (#2658)

yijhenlin7f1f218f5a0f
diff --git a/docs/trino-connector/development.md b/docs/trino-connector/development.md
index 2e13f93fbe..306c4da3b7 100644
--- a/docs/trino-connector/development.md
+++ b/docs/trino-connector/development.md
@@ -50,7 +50,7 @@ then you can see the `gravitino-trino-connecor` source files and directories in
![trino-gravitino-structure](../assets/trino/add-link.jpg)
-5. Change the `pom.xml` file in the `trino-gravitino` module accordingly. This is an example content of the `pom.xml` file in the `trino-gravitino` module.
+5. Add `<module>plugin/trino-gravitino</module>` to `trino/pom.xml` and change the `pom.xml` file in the `trino-gravitino` module accordingly. This is an example content of the `pom.xml` file in the `trino-gravitino` module. Ensure that the version of trino-root is identical to the version of trino.
```xml
<?xml version="1.0" encoding="UTF-8"?>
@@ -77,6 +77,26 @@ then you can see the `gravitino-trino-connecor` source files and directories in
</properties>
<dependencies>
+ <!--
+ The following dependencies are required for the Gravitino connector. You can install them
+ locally (./gradlew publishToMavenLocal) or just use the release version like 0.4.0
+ -->
+ <dependency>
+ <groupId>com.datastrato.gravitino</groupId>
+ <artifactId>bundled-catalog</artifactId>
+ <version>0.5.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.datastrato.gravitino</groupId>
+ <artifactId>client-java-runtime</artifactId>
+ <version>0.5.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ </dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
@@ -92,8 +112,8 @@ then you can see the `gravitino-trino-connecor` source files and directories in
<artifactId>bootstrap</artifactId>
<exclusions>
<exclusion>
- <artifactId>log4j-to-slf4j</artifactId>
<groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-to-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
@@ -118,6 +138,23 @@ then you can see the `gravitino-trino-connecor` source files and directories in
<artifactId>jakarta.validation-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-collections4</artifactId>
+ <version>4.4</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.httpcomponents.client5</groupId>
+ <artifactId>httpclient5</artifactId>
+ <version>5.2.1</version>
+ </dependency>
+
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
@@ -154,39 +191,11 @@ then you can see the `gravitino-trino-connecor` source files and directories in
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- </dependency>
-
<dependency>
<groupId>io.airlift</groupId>
<artifactId>node</artifactId>
<scope>runtime</scope>
</dependency>
-
- <dependency>
- <groupId>org.apache.httpcomponents.client5</groupId>
- <artifactId>httpclient5</artifactId>
- <version>5.2.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.antlr</groupId>
- <artifactId>antlr4-runtime</artifactId>
- <version>4.9.2</version>
- </dependency>
-
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-memory</artifactId>
@@ -198,26 +207,10 @@ then you can see the `gravitino-trino-connecor` source files and directories in
<scope>test</scope>
</dependency>
- <!--
- The following dependencies are required for the Gravitino connector. You can install them
- locally (./gradlew publishToMavenLocal) or just use the release version like 0.5.0
- -->
<dependency>
- <groupId>com.datastrato.gravitino</groupId>
- <artifactId>client-java-runtime</artifactId>
- <version>0.5.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>com.datastrato.gravitino</groupId>
- <artifactId>bundled-catalog</artifactId>
- <version>0.5.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-collections4</artifactId>
- <version>4.4</version>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
</dependency>
</dependencies>
</project>
@@ -232,6 +225,10 @@ then you can see the `gravitino-trino-connecor` source files and directories in
# build the trino-gravitino module if we change the code in the trino-gravitino module
./mvnw clean -pl 'plugin/trino-gravitino' package -DskipTests -Dcheckstyle.skip -Dair.check.skip-checkstyle=true -DskipTests -Dair.check.skip-all=true
```
+:::note
+If a compile error occurs due to `The following artifacts could not be resolved: com.datastrato.gravitino:xxx:jar`, which can be resolved by executing `./gradlew publishToMavenLocal` in gravitino beforehand.
+:::
+
7. Set up the configuration for the Gravitino connector in the Trino project. You can do as the following picture shows:
![](../assets/trino/add-config.jpg)
@@ -302,7 +299,9 @@ plugin.bundles=\
node-scheduler.include-coordinator=true
```
-
+:::note
+Remove the file `/etc/catalogs/xxx.properties` if the corresponding `plugin/trino-xxx/pom.xml` is not recorded in the `/etc/config.properties`. For the hive plugin, please use `plugin/trino-hive/pom.xml` after release version 435. Others should use `plugin/trino-hive-hadoop2/pom.xml`.
+:::
8. Start the Trino server and connect to the Gravitino server.
![](../assets/trino/start-trino.jpg)
diff --git a/docs/trino-connector/installation.md b/docs/trino-connector/installation.md
index 759ee302d7..b2391ec902 100644
--- a/docs/trino-connector/installation.md
+++ b/docs/trino-connector/installation.md
@@ -52,7 +52,7 @@ You can see the connector directory `gravitino-trino-connector-<version>` after
Copy the connector directory to the Trino container's plugin directory.
```shell
-docker copy /tmp/gravitino-trino-connector-<version> trino-gravitino:/lib/trino/plugin
+docker cp /tmp/gravitino-trino-connector-<version> trino-gravitino:/lib/trino/plugin
```
Check the plugin directory in the container.
@@ -99,7 +99,7 @@ docker restart trino-gravitino
Use the Trino CLI to connect to the Trino container and run a query.
```text
-docker exec -it trino trino
+docker exec -it trino-gravitino trino
trino> SHOW CATALOGS;
Catalog
------------------------
@@ -116,7 +116,7 @@ You can see the `gravitino` catalog in the result set. This signifies the succes
Assuming you have created a catalog named `test.jdbc-mysql` in the Gravitino server, or please refer to [Create a Catalog](../manage-metadata-using-gravitino.md#create-a-catalog). Then you can use the Trino CLI to connect to the Trino container and run a query like this.
```text
-docker exec -it trino trino
+docker exec -it trino-gravitino trino
trino> SHOW CATALOGS;
Catalog
------------------------