Skip to content

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

[#4657] Improvement (docs): Add documentation for the Gravitino-Trino connector running on AWS S3. (#4658)

Yuhui344e98df0635
diff --git a/docs/trino-connector/catalog-hive.md b/docs/trino-connector/catalog-hive.md
index d162beaffd..d6e36ecba7 100644
--- a/docs/trino-connector/catalog-hive.md
+++ b/docs/trino-connector/catalog-hive.md
@@ -291,9 +291,9 @@ DROP TABLE hive_test.database_01.table_01;
## HDFS config and permissions
-For basic setups, Gravitino Trino connector configures the HDFS client automatically and does not require any configuration
-files.
-Gravitino Trino connector is not support user to config the `hdfs-site.xml` and `core-site.xml` files to the HDFS client.
+For basic setups, the Apache Gravitino Trino connector configures the HDFS client
+using catalog configurations. It supports configuring the HDFS client with `hdfs-site.xml`
+and `core-site.xml` files via the `trino.bypass.hive.config.resources` setting in the catalog configurations.
Before running any `Insert` statements for Hive tables in Trino,
you must check that the user Trino is using to access HDFS has access to the Hive warehouse directory.
@@ -303,3 +303,47 @@ replacing hdfs_user with the appropriate username:
```text
-DHADOOP_USER_NAME=hdfs_user
```
+
+## S3
+
+When using AWS S3 within the Hive catalog, users need to configure the Trino Hive connector's
+AWS S3-related properties in the catalog's properteis. Please refer to the documentation
+of [Hive connector with Amazon S3](https://trino.io/docs/435/connector/hive-s3.html).
+
+To create a Hive catalog with AWS S3 configuration in the Trino CLI, use the following command:
+
+```sql
+call gravitino.system.create_catalog(
+ 'gt_hive',
+ 'hive',
+ map(
+ array['metastore.uris',
+ 'trino.bypass.hive.s3.aws-access-key', 'trino.bypass.hive.s3.aws-secret-key', 'trino.bypass.hive.s3.region'
+ ],
+ array['thrift://hive:9083', '<aws-access-key>', '<aws-secret-key>', '<region>']
+ )
+);
+```
+
+- The settings for `trino.bypass.hive.s3.aws-access-key`, `trino.bypass.hive.s3.aws-secret-key` and `trino.bypass.hive.s3.region`
+are required by the Apache Gravitino Trino connector.
+
+Once the Hive catalog is successfully created, users can create schemas and tables as follows:
+
+```sql
+CREATE SCHEMA gt_hive.gt_db02
+WITH (location = 's3a://trino-test/dw/gt_db02');
+
+CREATE TABLE gt_hive.gt_db02.tb01 (
+ name varchar,
+ salary int
+);
+```
+
+The `location` specifies the AWS S3 storage path.
+
+After running the command, the tables are ready for data reading and writing operations on AWS S3.
+
+:::note
+Ensure the Hive Metastore service used by the Hive catalog supports AWS S3.
+:::
diff --git a/docs/trino-connector/catalog-iceberg.md b/docs/trino-connector/catalog-iceberg.md
index 62eac9f47a..ae827f17cc 100644
--- a/docs/trino-connector/catalog-iceberg.md
+++ b/docs/trino-connector/catalog-iceberg.md
@@ -32,8 +32,8 @@ CREATE SCHEMA catalog.schema_name
### Create table
-The Gravitino Trino connector currently supports basic Iceberg table creation statements, such as defining fields,
-allowing null values, and adding comments. The Gravitino Trino connector does not support `CREATE TABLE AS SELECT`.
+The Apache Gravitino Trino connector currently supports basic Iceberg table creation statements, such as defining fields,
+allowing null values, and adding comments. The Apache Gravitino Trino connector does not support `CREATE TABLE AS SELECT`.
The following example shows how to create a table in the Iceberg catalog:
@@ -57,7 +57,7 @@ Support for the following alter table operations:
## Select
-The Gravitino Trino connector supports most SELECT statements, allowing the execution of queries successfully.
+The Apache Gravitino Trino connector supports most SELECT statements, allowing the execution of queries successfully.
Currently, it doesn't support certain query optimizations, such as pushdown and pruning functionalities.
## Table and Schema properties
@@ -92,10 +92,10 @@ Reserved properties: A reserved property is one can't be set by users but can be
## Basic usage examples
-You need to do the following steps before you can use the Iceberg catalog in Trino through Gravitino.
+You need to do the following steps before you can use the Iceberg catalog in Trino through Apache Gravitino.
-- Create a metalake and catalog in Gravitino. Assuming that the metalake name is `test` and the catalog name is `iceberg_test`,
-then you can use the following code to create them in Gravitino:
+- Create a metalake and catalog in Apache Gravitino. Assuming that the metalake name is `test` and the catalog name is `iceberg_test`,
+then you can use the following code to create them in Apache Gravitino:
```bash
curl -X POST -H "Content-Type: application/json" \
@@ -125,7 +125,7 @@ For More information about the Iceberg catalog, please refer to [Iceberg catalog
Use the Trino CLI to connect to the Trino container and run a query.
-Listing all Gravitino managed catalogs:
+Listing all Apache Gravitino managed catalogs:
```sql
SHOW CATALOGS;
@@ -146,7 +146,7 @@ Query 20231017_082503_00018_6nt3n, FINISHED, 1 node
```
The `gravitino` catalog is a catalog defined By Trino catalog configuration.
-The `iceberg_test` catalog is the catalog created by you in Gravitino.
+The `iceberg_test` catalog is the catalog created by you in Apache Gravitino.
Other catalogs are regular user-configured Trino catalogs.
### Creating tables and schemas
@@ -236,3 +236,52 @@ replacing hdfs_user with the appropriate username:
```text
-DHADOOP_USER_NAME=hdfs_user
```
+
+## S3
+
+When using AWS S3 within the Iceberg catalog, users need to configure the Trino Iceberg connector's
+AWS S3-related properties in the catalog's properties. Please refer to the documentation
+of [Hive connector with Amazon S3](https://trino.io/docs/435/connector/hive-s3.html).
+These configurations must use the `trino.bypass.` prefix in the Iceberg catalog's attributes to be effective.
+
+To create an Iceberg catalog with AWS S3 configuration in the Trino CLI, use the following command:
+
+```sql
+call gravitino.system.create_catalog(
+ 'gt_iceberg',
+ 'lakehouse-iceberg',
+ map(
+ array['uri', 'catalog-backend', 'warehouse',
+ 'trino.bypass.hive.s3.aws-access-key', 'trino.bypass.hive.s3.aws-secret-key', 'trino.bypass.hive.s3.region',
+ 's3-access-key-id', 's3-secret-access-key', 's3-region', 'io-impl'
+ ],
+ array['thrift://hive:9083', 'hive', 's3a://trino-test-ice/dw2',
+ '<aws-access-key>', '<aws-secret-key>', '<region>',
+ '<aws-access-key>', '<aws-secret-key>', '<region>', 'org.apache.iceberg.aws.s3.S3FileIO']
+ )
+);
+```
+
+- The configurations of `trino.bypass.hive.s3.aws-access-key`, `trino.bypass.hive.s3.aws-secret-key`, `trino.bypass.hive.s3.region`
+are the required the configurations for the Apache Gravitino Trino connector.
+- The configurations of `s3-access-key-id`, `s3-secret-access-key`, `io-impl` and `s3-region`.
+are the required the configurations for the [Apache Gravitino Iceberg catalog](../lakehouse-iceberg-catalog.md#S3).
+- The `location` specifies the storage path on AWS S3. Ensure that the specified directory exists on AWS S3 before proceeding.
+
+Once the Iceberg catalog is successfully created, users can create schemas and tables as follows:
+
+```sql
+CREATE SCHEMA gt_iceberg.gt_db03;
+
+CREATE TABLE gt_iceberg.gt_db03.tb01 (
+ name varchar,
+ salary int
+);
+```
+
+After running the command, the tables are ready for data reading and writing operations on AWS S3.
+
+:::note
+TThe Iceberg catalog module in the Apache Gravitino server should add AWS S3 support.
+Please refer to [Apache Gravitino Iceberg catalog](../lakehouse-iceberg-catalog.md#S3).
+:::