Skip to content

Commit e1cf5af

Browse files
committed
[#12682] improve(paimon): make Hadoop S3A optional
1 parent d3fa274 commit e1cf5af

3 files changed

Lines changed: 40 additions & 6 deletions

File tree

catalogs/catalog-lakehouse-paimon/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ dependencies {
133133
implementation(libs.hadoop3.mapreduce.client.core) {
134134
exclude("*")
135135
}
136-
runtimeOnly(libs.hadoop3.aws)
137136

138137
// Required by Paimon HiveCatalog#createView, which calls hive ql metadata Table APIs.
139138
runtimeOnly(libs.hive2.exec) {
@@ -211,6 +210,8 @@ dependencies {
211210
testImplementation(libs.testcontainers.localstack)
212211
testImplementation(libs.testcontainers.mysql)
213212

213+
// Hadoop S3A is an optional filesystem for Paimon catalogs.
214+
testRuntimeOnly(libs.hadoop3.aws)
214215
testRuntimeOnly(libs.junit.jupiter.engine)
215216
}
216217

catalogs/catalog-lakehouse-paimon/src/test/java/org/apache/gravitino/catalog/lakehouse/paimon/integration/test/CatalogPaimonS3AIT.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,6 @@ void testAccessS3AFileSystem() {
105105
String.format(
106106
"http://localhost:%d",
107107
localStackContainer.getMappedPort(GravitinoLocalStackContainer.PORT)));
108-
catalogProperties.put(S3A_PROPERTY_PREFIX + "impl", "org.apache.hadoop.fs.s3a.S3AFileSystem");
109-
catalogProperties.put(
110-
S3A_PROPERTY_PREFIX + "aws.credentials.provider",
111-
"org.apache.hadoop.fs.s3a.SimpleAWSCredentialsProvider");
112108
catalogProperties.put(S3A_PROPERTY_PREFIX + "path.style.access", "true");
113109
catalogProperties.put(S3A_PROPERTY_PREFIX + "connection.ssl.enabled", "false");
114110

docs/lakehouse-paimon-catalog.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Builds with Apache Paimon `1.2`.
5656
| `dlf-token-loader` | The token loader for Aliyun DLF. | (none) | No |
5757

5858
:::note
59-
- If you want to use the `oss` or `s3` warehouse, you need to place related jars in the `catalogs/lakehouse-paimon/lib` directory, more information can be found in the [Paimon S3](https://paimon.apache.org/docs/1.2/maintenance/filesystems/#s3).
59+
- If you want to use the `oss` or `s3` warehouse, you need to place related jars in the `catalogs/lakehouse-paimon/libs` directory, more information can be found in the [Paimon S3](https://paimon.apache.org/docs/1.2/maintenance/filesystems/#s3).
6060
- If you use an S3 warehouse, also download [`gravitino-aws-<version>.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-aws) and place it in the `catalogs/lakehouse-paimon/libs` directory to enable credential vending. For OSS, use [`gravitino-aliyun-<version>.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-aliyun) instead.
6161
- If you want to use REST backend, Gravitino Paimon catalog supports Aliyun DLF (Data Lake Formation) as the REST catalog service. You need to configure the DLF-related properties eg:
6262
```
@@ -80,6 +80,43 @@ connect to Aliyun DLF, more information can be found in the [Paimon REST Catalog
8080

8181
Any properties not defined by Gravitino with `gravitino.bypass.` prefix will pass to Paimon catalog properties and HDFS configuration. For example, if specify `gravitino.bypass.table.type`, `table.type` will pass to Paimon catalog properties.
8282

83+
#### Hadoop S3A (optional)
84+
85+
Paimon's native S3 filesystem uses an `s3://` warehouse and the `paimon-s3` dependency. As an
86+
alternative, you can use Hadoop S3A with an `s3a://` warehouse. Gravitino does not package the
87+
optional S3A dependencies by default. To enable it, add the following JARs to
88+
`catalogs/lakehouse-paimon/libs` and restart Gravitino:
89+
90+
- `hadoop-aws-<hadoop-version>.jar`, with the same version as the Hadoop libraries packaged by
91+
Gravitino.
92+
- The `aws-java-sdk-bundle` version required by that `hadoop-aws` release.
93+
94+
The following example configures static credentials and a custom HTTP S3 endpoint:
95+
96+
```json
97+
{
98+
"name": "paimon_s3a",
99+
"type": "RELATIONAL",
100+
"provider": "lakehouse-paimon",
101+
"properties": {
102+
"catalog-backend": "filesystem",
103+
"warehouse": "s3a://bucket/warehouse",
104+
"gravitino.bypass.hadoop.fs.s3a.access.key": "<access-key-id>",
105+
"gravitino.bypass.hadoop.fs.s3a.secret.key": "<secret-access-key>",
106+
"gravitino.bypass.hadoop.fs.s3a.endpoint": "http://s3.example.com",
107+
"gravitino.bypass.hadoop.fs.s3a.path.style.access": "true",
108+
"gravitino.bypass.hadoop.fs.s3a.connection.ssl.enabled": "false"
109+
}
110+
}
111+
```
112+
113+
The endpoint-related properties are only needed for a custom endpoint. Omit
114+
`gravitino.bypass.hadoop.fs.s3a.connection.ssl.enabled` when the endpoint uses HTTPS, and enable
115+
path-style access only when the S3-compatible service requires it. Hadoop S3A automatically
116+
discovers `S3AFileSystem` and uses its default credential provider chain, so `fs.s3a.impl` and
117+
`fs.s3a.aws.credentials.provider` do not need to be configured for this example. You can pass other
118+
Hadoop S3A properties by prefixing them with `gravitino.bypass.hadoop.`.
119+
83120
#### JDBC Backend
84121

85122
If you are using JDBC backend, you must specify the properties like `jdbc-user`, `jdbc-password` and `jdbc-driver`.

0 commit comments

Comments
 (0)