You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "whua3 (via GitHub)" <gi...@apache.org> on 2026/06/17 08:53:00 UTC

[PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

whua3 opened a new pull request, #11713:
URL: https://github.com/apache/gravitino/pull/11713

   ### What changes were proposed in this pull request?
   
   Add Tencent Cloud Object Storage (COS) support for the fileset catalog. The layout follows the existing OSS / S3 / GCS / Azure modules.
   
   - `bundles/tencent`: source module containing
     - `COSFileSystemProvider`: builds a Hadoop `CosNFileSystem` for the `cosn://` scheme.
     - `COSCredentialsProvider`: Hadoop-side provider that bridges Gravitino-vended `COSSecretKey` credentials to `hadoop-cos`.
     - `COSSecretKeyProvider`: server-side `CredentialProvider` that returns long-lived COS Secret Key credentials.
     - `COSUtils`: helper that maps Gravitino properties to Hadoop `Configuration`.
   - `bundles/tencent-bundle`: shaded fat-jar (`gravitino-tencent-bundle-<version>.jar`) that bundles `hadoop-cos` and `cos_api-bundle` with relocated packages.
   - `api`: new `COSSecretKeyCredential` type.
   - `catalogs/catalog-common`: `COSProperties` and `COSCredentialConfig`.
   - `catalogs/catalog-fileset`: wire `cosn://` into `FilesetCatalogPropertiesMetadata`.
   - `catalogs/hadoop-common`: register the `cosn` scheme.
   - `clients/filesystem-hadoop3-runtime`: include `bundles/tencent` in the GVFS runtime jar.
   - `docs`: new `fileset-catalog-with-cos.md` and a cross-link from `fileset-catalog.md`.
   - Tests: `TestCOSFileSystemProvider`, `TestCOSCredentialProvider`, and `FilesetCOSCatalogIT`. The IT is skipped on CI when no real COS credentials are provided, the same way `FilesetOSSCatalogIT` is.
   
   ### Why are the changes needed?
   
   #6490 tracks adding Tencent COS support. Without it, users on Tencent Cloud have to either rely on S3-compatible workarounds, which do not work with Gravitino's credential vending, or maintain their own fork.
   
   This PR is the first of a chain of PRs against `main`:
   
   - PR-A (this PR): Java side, with the static `cos-secret-key` credential.
   - PR-B: server-side STS credential vending (`cos-token`).
   - PR-C: Python GVFS support (`COSStorageHandler` and Python-side `COSSecretKeyCredential`).
   - PR-D: Python `COSTokenCredential` wiring. Can be folded into PR-C if reviewers prefer fewer PRs.
   
   Part of #6490
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, additive only. Existing fileset / catalog behavior is unchanged. New surface:
   
   - New fileset location scheme: `cosn://<bucket>/<path>`.
   - New fileset catalog properties: `cos-region`, `cos-endpoint` (optional, defaults to `cos.${region}.myqcloud.com`), `cos-access-key-id`, `cos-secret-access-key`.
   - New credential provider value: `credential-providers=cos-secret-key` (static AK/SK; STS will follow in PR-B).
   - New deployable artifact: `gravitino-tencent-bundle-<version>.jar`.
   - New documentation page: [Fileset Catalog with COS](docs/fileset-catalog-with-cos.md).
   
   ### How was this patch tested?
   
   - Unit tests: `:bundles:tencent:test`, `:catalogs:catalog-common:test`, `:catalogs:catalog-fileset:test`, `:api:test` all pass locally.
   - Build: `:bundles:tencent-bundle:shadowJar`, `:clients:filesystem-hadoop3-runtime:shadowJar`, and `assemble` for all touched modules pass locally.
   - Spotless and Checkstyle pass.
   - `FilesetCOSCatalogIT` passes locally against a real COS bucket in `ap-guangzhou`. It is skipped on CI when no credentials are provided.
   - Manual end-to-end verification on a local Gravitino server with the new bundle jars: created a fileset catalog backed by `cosn://`, then exercised `hadoop fs -ls`, `-put`, `-get`, `-cat`, `-rm` over `gvfs://fileset/...`, plus schema/fileset CRUD via the REST API and direct `cosn://...` access.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "whua3 (via GitHub)" <gi...@apache.org>.
whua3 commented on code in PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#discussion_r3487760355


##########
gradle/libs.versions.toml:
##########
@@ -45,6 +45,7 @@ hadoop3 = "3.3.6"
 hadoop3-gcs = "1.9.4-hadoop3"
 hadoop3-abs = "3.3.6"
 hadoop3-aliyun = "3.3.6"
+hadoop-cos = "3.3.0-8.3.23"

Review Comment:
   Tencent Cloud only ships hadoop-cos against the 3.3.0-x.x.x line on Maven Central — there is no 3.3.6-aligned build available. hadoop-cos only depends on hadoop-common APIs that are stable across the 3.3.x line, so it is binary-compatible with Hadoop 3.3.6. Verified end-to-end with PySpark 3.5.0 + Hadoop 3.2.2, reading/writing CSV via cosn:// with no compatibility issues.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#11748] feat(catalog-hadoop): support Tencent Cloud COS as fileset storage backend (Java side) [gravitino]

Posted by "whua3 (via GitHub)" <gi...@apache.org>.
whua3 commented on PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#issuecomment-4873827763

   > I'm going to merge this PR, @whua3. Thanks for your hard work. I'm looking forward to more PRs
   
   @yuqi1129 Thanks for reviewing my PRs and providing lots of valuable suggestions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#issuecomment-4753183327

   I suggest you to create subtasks for this epic issue #6490 . And each PR should have a related issue for that dedicated thing. Not tracking all the PRs in one issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "whua3 (via GitHub)" <gi...@apache.org>.
whua3 commented on code in PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#discussion_r3437485523


##########
catalogs/catalog-common/src/main/java/org/apache/gravitino/credential/config/COSCredentialConfig.java:
##########
@@ -0,0 +1,79 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.gravitino.credential.config;
+
+import java.util.Map;
+import javax.validation.constraints.NotNull;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.gravitino.Config;
+import org.apache.gravitino.config.ConfigBuilder;
+import org.apache.gravitino.config.ConfigConstants;
+import org.apache.gravitino.config.ConfigEntry;
+import org.apache.gravitino.storage.COSProperties;
+
+/**
+ * Slim credential config for Tencent Cloud COS, covering only the static secret-key path. STS /
+ * token-related entries (role arn, token expire) will be added by a follow-up PR that introduces
+ * the dynamic credential vending support.
+ */
+public class COSCredentialConfig extends Config {
+
+  public static final ConfigEntry<String> COS_REGION =
+      new ConfigBuilder(COSProperties.GRAVITINO_COS_REGION)
+          .doc("The region of the Tencent Cloud COS service")
+          .version(ConfigConstants.VERSION_1_3_0)
+          .stringConf()
+          .create();
+
+  public static final ConfigEntry<String> COS_ACCESS_KEY_ID =
+      new ConfigBuilder(COSProperties.GRAVITINO_COS_ACCESS_KEY_ID)
+          .doc("The static access key ID (Tencent Cloud SecretId) used to access COS data")
+          .version(ConfigConstants.VERSION_1_3_0)
+          .stringConf()
+          .checkValue(StringUtils::isNotBlank, ConfigConstants.NOT_BLANK_ERROR_MSG)
+          .create();
+
+  public static final ConfigEntry<String> COS_SECRET_ACCESS_KEY =
+      new ConfigBuilder(COSProperties.GRAVITINO_COS_ACCESS_KEY_SECRET)
+          .doc("The static secret access key (Tencent Cloud SecretKey) used to access COS data")
+          .version(ConfigConstants.VERSION_1_3_0)
+          .stringConf()
+          .checkValue(StringUtils::isNotBlank, ConfigConstants.NOT_BLANK_ERROR_MSG)
+          .create();
+
+  public COSCredentialConfig(Map<String, String> properties) {
+    super(false);
+    loadFromMap(properties, k -> true);
+  }
+
+  public String region() {

Review Comment:
   Yep, it's a placeholder for the STS PR — will be wired up there. Keeping it here just to avoid touching this file again in the follow-up.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "whua3 (via GitHub)" <gi...@apache.org>.
whua3 commented on PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#issuecomment-4825887475

   <img width="1509" height="954" alt="Clipboard_Screenshot_1782644516" src="https://github.com/user-attachments/assets/92602aa5-aafe-4073-8b11-851a0cd0d1e7" />
   <img width="1520" height="668" alt="Clipboard_Screenshot_1782644520" src="https://github.com/user-attachments/assets/8e9efb84-537e-4161-a716-98e369fae46f" />
   <img width="1516" height="859" alt="Clipboard_Screenshot_1782644524" src="https://github.com/user-attachments/assets/339f33d6-3099-4f73-869b-b91839476131" />
   <img width="1348" height="645" alt="Clipboard_Screenshot_1782644530" src="https://github.com/user-attachments/assets/9ea3c090-8003-4452-893a-a33c5fbb243d" />
   <img width="1522" height="680" alt="Clipboard_Screenshot_1782644537" src="https://github.com/user-attachments/assets/c794f12b-d52b-4aa4-81cc-9d42e49806e9" />
   there are  screenshots of the manual tests.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "whua3 (via GitHub)" <gi...@apache.org>.
whua3 commented on code in PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#discussion_r3437283102


##########
catalogs/catalog-common/src/main/java/org/apache/gravitino/credential/config/COSCredentialConfig.java:
##########
@@ -0,0 +1,79 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.gravitino.credential.config;
+
+import java.util.Map;
+import javax.validation.constraints.NotNull;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.gravitino.Config;
+import org.apache.gravitino.config.ConfigBuilder;
+import org.apache.gravitino.config.ConfigConstants;
+import org.apache.gravitino.config.ConfigEntry;
+import org.apache.gravitino.storage.COSProperties;
+
+/**
+ * Slim credential config for Tencent Cloud COS, covering only the static secret-key path. STS /
+ * token-related entries (role arn, token expire) will be added by a follow-up PR that introduces
+ * the dynamic credential vending support.
+ */
+public class COSCredentialConfig extends Config {
+
+  public static final ConfigEntry<String> COS_REGION =
+      new ConfigBuilder(COSProperties.GRAVITINO_COS_REGION)
+          .doc("The region of the Tencent Cloud COS service")
+          .version(ConfigConstants.VERSION_1_3_0)

Review Comment:
   Targeting 1.4.0.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#discussion_r3452861500


##########
api/src/main/java/org/apache/gravitino/credential/COSSecretKeyCredential.java:
##########
@@ -0,0 +1,120 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.gravitino.credential;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.util.Map;
+import org.apache.commons.lang3.StringUtils;
+
+/** Tencent Cloud COS secret key credential. */
+public class COSSecretKeyCredential implements Credential {
+
+  /** COS secret key credential type. */
+  public static final String COS_SECRET_KEY_CREDENTIAL_TYPE = "cos-secret-key";
+  /** The static access key ID (a.k.a. SecretId in Tencent Cloud) used to access COS data. */
+  public static final String GRAVITINO_COS_STATIC_ACCESS_KEY_ID = "cos-access-key-id";
+  /** The static secret access key (a.k.a. SecretKey in Tencent Cloud) used to access COS data. */
+  public static final String GRAVITINO_COS_STATIC_SECRET_ACCESS_KEY = "cos-secret-access-key";
+
+  private String accessKeyId;
+  private String secretAccessKey;
+
+  /**
+   * Constructs an instance of {@link COSSecretKeyCredential} with the static COS access key ID and
+   * secret access key.
+   *
+   * @param accessKeyId The COS static access key ID.
+   * @param secretAccessKey The COS static secret access key.
+   */
+  public COSSecretKeyCredential(String accessKeyId, String secretAccessKey) {
+    validate(accessKeyId, secretAccessKey, 0);
+    this.accessKeyId = accessKeyId;
+    this.secretAccessKey = secretAccessKey;
+  }
+
+  /**
+   * This is the constructor that is used by credential factory to create an instance of credential
+   * according to the credential information.
+   */
+  public COSSecretKeyCredential() {}
+
+  @Override
+  public String credentialType() {
+    return COS_SECRET_KEY_CREDENTIAL_TYPE;
+  }
+
+  @Override
+  public long expireTimeInMs() {
+    return 0;
+  }
+
+  @Override
+  public Map<String, String> credentialInfo() {
+    return (new ImmutableMap.Builder<String, String>())
+        .put(GRAVITINO_COS_STATIC_ACCESS_KEY_ID, accessKeyId)
+        .put(GRAVITINO_COS_STATIC_SECRET_ACCESS_KEY, secretAccessKey)
+        .build();
+  }
+
+  /**
+   * Initialize the credential with the credential information.
+   *
+   * <p>This method is invoked to deserialize the credential in client side.
+   *
+   * @param credentialInfo The credential information from {@link #credentialInfo}.
+   * @param expireTimeInMs The expire-time from {@link #expireTimeInMs()}.
+   */
+  @Override
+  public void initialize(Map<String, String> credentialInfo, long expireTimeInMs) {
+    String accessKeyId = credentialInfo.get(GRAVITINO_COS_STATIC_ACCESS_KEY_ID);
+    String secretAccessKey = credentialInfo.get(GRAVITINO_COS_STATIC_SECRET_ACCESS_KEY);
+    validate(accessKeyId, secretAccessKey, expireTimeInMs);
+    this.accessKeyId = accessKeyId;
+    this.secretAccessKey = secretAccessKey;
+  }
+
+  /**
+   * Get COS static access key ID.
+   *
+   * @return The COS access key ID.
+   */
+  public String accessKeyId() {
+    return accessKeyId;
+  }
+
+  /**
+   * Get COS static secret access key.
+   *
+   * @return The COS secret access key.
+   */
+  public String secretAccessKey() {
+    return secretAccessKey;
+  }
+
+  private void validate(String accessKeyId, String secretAccessKey, long expireTimeInMs) {
+    Preconditions.checkArgument(
+        StringUtils.isNotBlank(accessKeyId), "COS access key Id should not empty");
+    Preconditions.checkArgument(
+        StringUtils.isNotBlank(secretAccessKey), "COS secret access key should not empty");

Review Comment:
   The validation error messages are grammatically incorrect ("should not empty") and use inconsistent capitalization ("Id"). These messages are user-facing via Preconditions and should be corrected for clarity.



##########
gradle/libs.versions.toml:
##########
@@ -45,6 +45,7 @@ hadoop3 = "3.3.6"
 hadoop3-gcs = "1.9.4-hadoop3"
 hadoop3-abs = "3.3.6"
 hadoop3-aliyun = "3.3.6"
+hadoop-cos = "3.3.0-8.3.23"

Review Comment:
   The project’s Hadoop dependency version is 3.3.6, but the selected hadoop-cos artifact version encodes Hadoop 3.3.0 ("3.3.0-8.3.23"). Please confirm binary compatibility with Hadoop 3.3.6 (and the other bundled Hadoop 3.3.6 artifacts), or pick a hadoop-cos build that matches the repo’s Hadoop minor/patch level if available.



##########
docs/fileset-catalog.md:
##########
@@ -12,9 +12,10 @@ Fileset catalog is a fileset catalog that using Hadoop Compatible File System (H
 the storage location of the fileset. It supports the local filesystem and HDFS. Since
 0.7.0-incubating, Gravitino supports [S3](fileset-catalog-with-s3.md), [GCS](fileset-catalog-with-gcs.md),
 [OSS](fileset-catalog-with-oss.md) and [Azure Blob Storage](fileset-catalog-with-adls.md) through Fileset catalog.
+Since 1.3.0, Gravitino also supports [Tencent Cloud COS](fileset-catalog-with-cos.md).

Review Comment:
   The Fileset catalog doc says COS support is available since 1.3.0, but the COS-specific documentation and new config entries indicate this feature is introduced in 1.4.0. This inconsistency will confuse users and should be aligned to the actual release version.



##########
catalogs/catalog-fileset/src/test/java/org/apache/gravitino/catalog/fileset/integration/test/FilesetCOSCatalogIT.java:
##########
@@ -0,0 +1,219 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.catalog.fileset.integration.test;
+
+import static org.apache.gravitino.catalog.fileset.FilesetCatalogPropertiesMetadata.FILESYSTEM_PROVIDERS;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Maps;
+import java.io.IOException;
+import java.net.URI;
+import java.util.Map;
+import org.apache.gravitino.Catalog;
+import org.apache.gravitino.NameIdentifier;
+import org.apache.gravitino.Schema;
+import org.apache.gravitino.file.Fileset;
+import org.apache.gravitino.integration.test.util.GravitinoITUtils;
+import org.apache.gravitino.storage.COSProperties;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIf;
+import org.junit.platform.commons.util.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Integration test for the fileset catalog backed by Tencent Cloud COS. It is disabled unless the
+ * required environment variables (COS_*) are present, mirroring the OSS / AWS counterparts.
+ */
+@EnabledIf(value = "cosIsConfigured", disabledReason = "Tencent Cloud COS is not configured.")
+public class FilesetCOSCatalogIT extends FilesetCatalogIT {
+  private static final Logger LOG = LoggerFactory.getLogger(FilesetCOSCatalogIT.class);
+
+  public static final String BUCKET_NAME = System.getenv("COS_BUCKET_NAME");
+  public static final String COS_ACCESS_KEY = System.getenv("COS_ACCESS_KEY_ID");
+  public static final String COS_SECRET_KEY = System.getenv("COS_SECRET_ACCESS_KEY");
+  public static final String COS_REGION = System.getenv("COS_REGION");
+  // Optional: caller may override the endpoint suffix (e.g. for cos-internal endpoints).
+  public static final String COS_ENDPOINT = System.getenv("COS_ENDPOINT");
+
+  @VisibleForTesting
+  public void startIntegrationTest() throws Exception {}
+
+  @BeforeAll
+  public void setup() throws IOException {
+    copyBundleJarsToHadoop("tencent-bundle");
+
+    try {
+      super.startIntegrationTest();
+    } catch (Exception e) {
+      throw new RuntimeException("Failed to start integration test", e);
+    }
+
+    metalakeName = GravitinoITUtils.genRandomName("CatalogFilesetIT_metalake");
+    catalogName = GravitinoITUtils.genRandomName("CatalogFilesetIT_catalog");
+    schemaName = GravitinoITUtils.genRandomName(SCHEMA_PREFIX);
+    Configuration conf = new Configuration();
+
+    conf.set("fs.cosn.userinfo.secretId", COS_ACCESS_KEY);
+    conf.set("fs.cosn.userinfo.secretKey", COS_SECRET_KEY);
+    conf.set("fs.cosn.bucket.region", COS_REGION);
+    if (StringUtils.isNotBlank(COS_ENDPOINT)) {
+      conf.set("fs.cosn.bucket.endpoint_suffix", COS_ENDPOINT);
+    }
+    conf.set("fs.cosn.impl", "org.apache.hadoop.fs.CosFileSystem");
+    fileSystem = FileSystem.get(URI.create(String.format("cosn://%s", BUCKET_NAME)), conf);
+
+    createMetalake();
+    createCatalog();
+    createSchema();
+  }
+
+  @AfterAll
+  public void stop() throws IOException {
+    Catalog catalog = metalake.loadCatalog(catalogName);
+    catalog.asSchemas().dropSchema(schemaName, true);
+    metalake.dropCatalog(catalogName, true);
+    client.dropMetalake(metalakeName, true);
+
+    try {
+      closer.close();
+    } catch (Exception e) {
+      LOG.error("Failed to close CloseableGroup", e);
+    }
+  }

Review Comment:
   This `@AfterAll` cleanup duplicates the parent implementation but omits resource cleanup (e.g., closing the COS FileSystem and the HTTP client) that FilesetCatalogIT#stop() performs. This can leak FS/client resources across integration tests.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#discussion_r3450541921


##########
docs/fileset-catalog-with-cos.md:
##########
@@ -0,0 +1,548 @@
+---
+title: "Fileset Catalog with COS"
+slug: "/fileset-catalog-with-cos"
+date: 2026-06-17
+keyword: "Fileset catalog COS Tencent"
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Introduction
+
+This document explains how to configure a Fileset catalog with Tencent Cloud COS (Cloud Object Storage) in Gravitino.
+
+## Prerequisites
+
+To set up a Fileset catalog with COS, follow these steps:
+
+1. Download the [`gravitino-tencent-bundle-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-tencent-bundle) file.
+2. Place the downloaded file into the Gravitino Fileset catalog classpath at `${GRAVITINO_HOME}/catalogs/fileset/libs/`.
+3. Start the Gravitino server by running the following command:
+
+```bash
+$ ${GRAVITINO_HOME}/bin/gravitino-server.sh start
+```
+
+Once the server is up and running, you can proceed to configure the Fileset catalog with COS. In the rest of this document we will use `http://localhost:8090` as the Gravitino server URL, replace with your actual server URL.
+
+## COS Catalog Configuration
+
+### COS Fileset Catalog Configuration
+
+In addition to the basic configurations mentioned in [Fileset-catalog-catalog-configuration](./fileset-catalog.md#catalog-properties), the following properties are required to configure a Fileset catalog with COS:
+
+| Configuration item            | Description                                                                                                                                                                                                                                                                                                                                                | Default value | Required | Since version |
+|-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------|---------------|
+| `cos-region`                  | The region of the Tencent Cloud COS bucket, e.g. `ap-guangzhou`, `ap-shanghai`.                                                                                                                                                                                                                                                                            | (none)        | Yes      | 1.4.0         |
+| `cos-endpoint`                | The endpoint *suffix* of the Tencent Cloud COS service (mapped to `fs.cosn.bucket.endpoint_suffix`). It is a host suffix, not a full URL — e.g. `cos.ap-guangzhou.myqcloud.com`, **not** `https://cos.ap-guangzhou.myqcloud.com`. Optional; when not set, hadoop-cos derives it from `cos-region` (`cos.${region}.myqcloud.com`). Set this only if you need to point to a non-public endpoint (e.g. an internal/VPC endpoint).                                                                                                                | (none)        | No       | 1.4.0         |
+| `cos-access-key-id`           | The static access key ID (Tencent Cloud `SecretId`) used to access COS data.                                                                                                                                                                                                                                                                               | (none)        | Yes      | 1.4.0         |
+| `cos-secret-access-key`       | The static secret access key (Tencent Cloud `SecretKey`) used to access COS data.                                                                                                                                                                                                                                                                          | (none)        | Yes      | 1.4.0         |
+| `credential-providers`        | The credential provider types, separated by comma. The currently supported value is `cos-secret-key`. Setting this enables credential vending provided by the Gravitino server, so the GVFS client no longer needs `cos-access-key-id` / `cos-secret-access-key` locally. See [cos-credential-vending](#fileset-with-credential-vending) below for details. | (none)        | No       | 1.4.0         |
+
+:::note
+The fileset catalog automatically loads filesystem providers on the classpath. The COS provider is registered when the `gravitino-tencent-bundle` jar is present, so `default-filesystem-provider` and `filesystem-providers` do not need to be set.
+:::
+
+:::note
+`cos-region` is mandatory for hadoop-cos: signing requests, building the default endpoint and selecting the right CAM scope all require the region. Even if you also set `cos-endpoint`, please keep `cos-region` set.

Review Comment:
   If possible, please just merge these two blocks



##########
docs/fileset-catalog-with-cos.md:
##########
@@ -0,0 +1,548 @@
+---
+title: "Fileset Catalog with COS"
+slug: "/fileset-catalog-with-cos"
+date: 2026-06-17
+keyword: "Fileset catalog COS Tencent"
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Introduction
+
+This document explains how to configure a Fileset catalog with Tencent Cloud COS (Cloud Object Storage) in Gravitino.
+
+## Prerequisites
+
+To set up a Fileset catalog with COS, follow these steps:
+
+1. Download the [`gravitino-tencent-bundle-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-tencent-bundle) file.
+2. Place the downloaded file into the Gravitino Fileset catalog classpath at `${GRAVITINO_HOME}/catalogs/fileset/libs/`.
+3. Start the Gravitino server by running the following command:
+
+```bash
+$ ${GRAVITINO_HOME}/bin/gravitino-server.sh start
+```
+
+Once the server is up and running, you can proceed to configure the Fileset catalog with COS. In the rest of this document we will use `http://localhost:8090` as the Gravitino server URL, replace with your actual server URL.
+
+## COS Catalog Configuration
+
+### COS Fileset Catalog Configuration
+
+In addition to the basic configurations mentioned in [Fileset-catalog-catalog-configuration](./fileset-catalog.md#catalog-properties), the following properties are required to configure a Fileset catalog with COS:
+
+| Configuration item            | Description                                                                                                                                                                                                                                                                                                                                                | Default value | Required | Since version |
+|-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------|---------------|
+| `cos-region`                  | The region of the Tencent Cloud COS bucket, e.g. `ap-guangzhou`, `ap-shanghai`.                                                                                                                                                                                                                                                                            | (none)        | Yes      | 1.4.0         |
+| `cos-endpoint`                | The endpoint *suffix* of the Tencent Cloud COS service (mapped to `fs.cosn.bucket.endpoint_suffix`). It is a host suffix, not a full URL — e.g. `cos.ap-guangzhou.myqcloud.com`, **not** `https://cos.ap-guangzhou.myqcloud.com`. Optional; when not set, hadoop-cos derives it from `cos-region` (`cos.${region}.myqcloud.com`). Set this only if you need to point to a non-public endpoint (e.g. an internal/VPC endpoint).                                                                                                                | (none)        | No       | 1.4.0         |
+| `cos-access-key-id`           | The static access key ID (Tencent Cloud `SecretId`) used to access COS data.                                                                                                                                                                                                                                                                               | (none)        | Yes      | 1.4.0         |
+| `cos-secret-access-key`       | The static secret access key (Tencent Cloud `SecretKey`) used to access COS data.                                                                                                                                                                                                                                                                          | (none)        | Yes      | 1.4.0         |
+| `credential-providers`        | The credential provider types, separated by comma. The currently supported value is `cos-secret-key`. Setting this enables credential vending provided by the Gravitino server, so the GVFS client no longer needs `cos-access-key-id` / `cos-secret-access-key` locally. See [cos-credential-vending](#fileset-with-credential-vending) below for details. | (none)        | No       | 1.4.0         |
+
+:::note
+The fileset catalog automatically loads filesystem providers on the classpath. The COS provider is registered when the `gravitino-tencent-bundle` jar is present, so `default-filesystem-provider` and `filesystem-providers` do not need to be set.
+:::
+
+:::note
+`cos-region` is mandatory for hadoop-cos: signing requests, building the default endpoint and selecting the right CAM scope all require the region. Even if you also set `cos-endpoint`, please keep `cos-region` set.
+:::
+
+### Schema Configuration
+
+To create a schema, refer to [Schema configurations](./fileset-catalog.md#schema-properties).
+
+### Fileset Configuration
+
+For instructions on how to create a fileset, refer to [Fileset configurations](./fileset-catalog.md#fileset-properties) for more details.
+
+## Create the Catalog, Schema, and Fileset
+
+This section will show you how to use the Fileset catalog with COS in Gravitino, including detailed examples.
+
+### Step 1: Create a Fileset Catalog with COS
+
+First, you need to create a Fileset catalog for COS. The following examples demonstrate how to create a Fileset catalog with COS:
+
+<Tabs groupId="language" queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "test_catalog",
+  "type": "FILESET",
+  "comment": "This is a COS fileset catalog",
+  "properties": {
+    "location": "cosn://my-bucket-1250000000/root",
+    "cos-region": "ap-guangzhou",
+    "cos-access-key-id": "access_key",
+    "cos-secret-access-key": "secret_key"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient gravitinoClient = GravitinoClient
+    .builder("http://localhost:8090")
+    .withMetalake("metalake")
+    .build();
+
+Map<String, String> cosProperties = ImmutableMap.<String, String>builder()
+    .put("location", "cosn://my-bucket-1250000000/root")
+    .put("cos-region", "ap-guangzhou")
+    .put("cos-access-key-id", "access_key")
+    .put("cos-secret-access-key", "secret_key")
+    .build();
+
+Catalog cosCatalog = gravitinoClient.createCatalog("test_catalog",
+    Type.FILESET,
+    "This is a COS fileset catalog",
+    cosProperties);
+// ...
+
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="metalake")
+cos_properties = {
+    "location": "cosn://my-bucket-1250000000/root",
+    "cos-region": "ap-guangzhou",
+    "cos-access-key-id": "access_key",
+    "cos-secret-access-key": "secret_key"
+}
+
+cos_catalog = gravitino_client.create_catalog(name="test_catalog",
+                                              catalog_type=Catalog.Type.FILESET,
+                                              provider=None,
+                                              comment="This is a COS fileset catalog",
+                                              properties=cos_properties)
+```
+
+</TabItem>
+</Tabs>
+
+:::note
+Tencent Cloud COS bucket names always end with the appid suffix, for example `my-bucket-1250000000`. Use that full bucket name in `location` and in any `cosn://` URI.
+:::
+
+### Step 2: Create a Schema
+
+Once the Fileset catalog with COS is created, you can create a schema inside that catalog. Below are examples of how to do this:
+
+<Tabs groupId="language" queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "test_schema",
+  "comment": "This is a COS schema",
+  "properties": {
+    "location": "cosn://my-bucket-1250000000/root/schema"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs/test_catalog/schemas
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+Catalog catalog = gravitinoClient.loadCatalog("test_catalog");
+
+SupportsSchemas supportsSchemas = catalog.asSchemas();
+
+Map<String, String> schemaProperties = ImmutableMap.<String, String>builder()
+    .put("location", "cosn://my-bucket-1250000000/root/schema")
+    .build();
+Schema schema = supportsSchemas.createSchema("test_schema",
+    "This is a COS schema",
+    schemaProperties
+);
+// ...
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="metalake")
+catalog: Catalog = gravitino_client.load_catalog(name="test_catalog")
+catalog.as_schemas().create_schema(name="test_schema",
+                                   comment="This is a COS schema",
+                                   properties={"location": "cosn://my-bucket-1250000000/root/schema"})
+```
+
+</TabItem>
+</Tabs>
+
+
+### Step 3: Create a Fileset
+
+Now that the schema is created, you can create a fileset inside it. Here's how:
+
+<Tabs groupId="language" queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "example_fileset",
+  "comment": "This is an example fileset",
+  "type": "MANAGED",
+  "storageLocation": "cosn://my-bucket-1250000000/root/schema/example_fileset",
+  "properties": {
+    "k1": "v1"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs/test_catalog/schemas/test_schema/filesets
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient gravitinoClient = GravitinoClient
+    .builder("http://localhost:8090")
+    .withMetalake("metalake")
+    .build();
+
+Catalog catalog = gravitinoClient.loadCatalog("test_catalog");
+FilesetCatalog filesetCatalog = catalog.asFilesetCatalog();
+
+Map<String, String> propertiesMap = ImmutableMap.<String, String>builder()
+        .put("k1", "v1")
+        .build();
+
+filesetCatalog.createFileset(
+    NameIdentifier.of("test_schema", "example_fileset"),
+    "This is an example fileset",
+    Fileset.Type.MANAGED,
+    "cosn://my-bucket-1250000000/root/schema/example_fileset",
+    propertiesMap,
+);
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="metalake")
+
+catalog: Catalog = gravitino_client.load_catalog(name="test_catalog")
+catalog.as_fileset_catalog().create_fileset(ident=NameIdentifier.of("test_schema", "example_fileset"),
+                                            type=Fileset.Type.MANAGED,
+                                            comment="This is an example fileset",
+                                            storage_location="cosn://my-bucket-1250000000/root/schema/example_fileset",
+                                            properties={"k1": "v1"})
+```
+
+</TabItem>
+</Tabs>
+
+## Access a Fileset with COS
+
+### Access the Fileset with the GVFS Java Client
+
+To access fileset with COS using the GVFS Java client, based on the [basic GVFS configurations](./how-to-use-gvfs.md#configuration-1), you need to add the following configurations:
+
+| Configuration item      | Description                                                  | Default value | Required | Since version |
+|-------------------------|--------------------------------------------------------------|---------------|----------|---------------|
+| `cos-region`            | The region of the Tencent Cloud COS bucket.                  | (none)        | Yes      | 1.4.0         |
+| `cos-endpoint`          | The endpoint *suffix* of the Tencent Cloud COS service (e.g. `cos.ap-guangzhou.myqcloud.com`, not a full URL). Optional. | (none)        | No       | 1.4.0         |
+| `cos-access-key-id`     | The access key ID (Tencent Cloud SecretId) for COS data.     | (none)        | Yes      | 1.4.0         |
+| `cos-secret-access-key` | The secret access key (Tencent Cloud SecretKey) for COS data.| (none)        | Yes      | 1.4.0         |
+
+:::note
+If the catalog has enabled [credential vending](security/credential-vending.md), the AK/SK properties above can be omitted. More details can be found in [Fileset with credential vending](#fileset-with-credential-vending).
+:::
+
+```java
+Configuration conf = new Configuration();
+conf.set("fs.AbstractFileSystem.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.Gvfs");
+conf.set("fs.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.GravitinoVirtualFileSystem");
+conf.set("fs.gravitino.server.uri", "http://localhost:8090");
+conf.set("fs.gravitino.client.metalake", "test_metalake");
+conf.set("cos-region", "ap-guangzhou");
+conf.set("cos-access-key-id", "access_key");
+conf.set("cos-secret-access-key", "secret_key");
+Path filesetPath = new Path("gvfs://fileset/test_catalog/test_schema/test_fileset/new_dir");
+FileSystem fs = filesetPath.getFileSystem(conf);
+fs.mkdirs(filesetPath);
+...
+```
+
+Similar to Spark configurations, you need to add COS (bundle) jars to the classpath according to your environment.
+If you want to customise your hadoop version or there is already a hadoop version in your project, you can add the following dependencies to your `pom.xml`:
+
+```xml
+  <dependency>
+    <groupId>org.apache.hadoop</groupId>
+    <artifactId>hadoop-common</artifactId>
+    <version>${HADOOP_VERSION}</version>
+  </dependency>
+
+  <!-- hadoop-cos is published by Tencent Cloud, not by Apache Hadoop. -->
+  <dependency>
+    <groupId>com.qcloud.cos</groupId>
+    <artifactId>hadoop-cos</artifactId>
+    <version>3.3.0-8.3.23</version>
+  </dependency>
+
+  <dependency>
+    <groupId>org.apache.gravitino</groupId>
+    <artifactId>gravitino-filesystem-hadoop3-runtime</artifactId>
+    <version>${GRAVITINO_VERSION}</version>
+  </dependency>
+```
+
+:::note
+Unlike the S3, OSS, GCS and Azure connectors, COS does **not** ship with Apache Hadoop. The HCFS adapter for COS is published by Tencent Cloud as `com.qcloud.cos:hadoop-cos`. Make sure the version you pick is compatible with your Hadoop version (the `<hadoop>-<sdk>` form encodes both, e.g. `3.3.0-8.3.23` targets Hadoop 3.3.0).
+:::
+
+:::note
+Since version 1.4.0, the `gravitino-tencent` JAR is no longer required separately, as it is included in the `gravitino-filesystem-hadoop3-runtime` JAR.
+:::

Review Comment:
   You can remove this block.



##########
docs/fileset-catalog.md:
##########
@@ -12,9 +12,10 @@ Fileset catalog is a fileset catalog that using Hadoop Compatible File System (H
 the storage location of the fileset. It supports the local filesystem and HDFS. Since
 0.7.0-incubating, Gravitino supports [S3](fileset-catalog-with-s3.md), [GCS](fileset-catalog-with-gcs.md),
 [OSS](fileset-catalog-with-oss.md) and [Azure Blob Storage](fileset-catalog-with-adls.md) through Fileset catalog.
+Since 1.3.0, Gravitino also supports [Tencent Cloud COS](fileset-catalog-with-cos.md).

Review Comment:
   1.4.0?



##########
catalogs/catalog-fileset/src/test/java/org/apache/gravitino/catalog/fileset/integration/test/FilesetCOSCatalogIT.java:
##########
@@ -0,0 +1,219 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.catalog.fileset.integration.test;
+
+import static org.apache.gravitino.catalog.fileset.FilesetCatalogPropertiesMetadata.FILESYSTEM_PROVIDERS;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Maps;
+import java.io.IOException;
+import java.net.URI;
+import java.util.Map;
+import org.apache.gravitino.Catalog;
+import org.apache.gravitino.NameIdentifier;
+import org.apache.gravitino.Schema;
+import org.apache.gravitino.file.Fileset;
+import org.apache.gravitino.integration.test.util.GravitinoITUtils;
+import org.apache.gravitino.storage.COSProperties;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIf;
+import org.junit.platform.commons.util.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Integration test for the fileset catalog backed by Tencent Cloud COS. It is disabled unless the
+ * required environment variables (COS_*) are present, mirroring the OSS / AWS counterparts.
+ */
+@EnabledIf(value = "cosIsConfigured", disabledReason = "Tencent Cloud COS is not configured.")
+public class FilesetCOSCatalogIT extends FilesetCatalogIT {

Review Comment:
   Please also add GVFS-related ITs to cover the changes.



##########
docs/fileset-catalog-with-cos.md:
##########
@@ -0,0 +1,548 @@
+---
+title: "Fileset Catalog with COS"
+slug: "/fileset-catalog-with-cos"
+date: 2026-06-17
+keyword: "Fileset catalog COS Tencent"
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Introduction
+
+This document explains how to configure a Fileset catalog with Tencent Cloud COS (Cloud Object Storage) in Gravitino.
+
+## Prerequisites

Review Comment:
   Have you tested manually based on the document?



##########
docs/fileset-catalog-with-cos.md:
##########
@@ -0,0 +1,548 @@
+---
+title: "Fileset Catalog with COS"
+slug: "/fileset-catalog-with-cos"
+date: 2026-06-17
+keyword: "Fileset catalog COS Tencent"
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Introduction
+
+This document explains how to configure a Fileset catalog with Tencent Cloud COS (Cloud Object Storage) in Gravitino.
+
+## Prerequisites
+
+To set up a Fileset catalog with COS, follow these steps:
+
+1. Download the [`gravitino-tencent-bundle-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-tencent-bundle) file.
+2. Place the downloaded file into the Gravitino Fileset catalog classpath at `${GRAVITINO_HOME}/catalogs/fileset/libs/`.
+3. Start the Gravitino server by running the following command:
+
+```bash
+$ ${GRAVITINO_HOME}/bin/gravitino-server.sh start
+```
+
+Once the server is up and running, you can proceed to configure the Fileset catalog with COS. In the rest of this document we will use `http://localhost:8090` as the Gravitino server URL, replace with your actual server URL.
+
+## COS Catalog Configuration
+
+### COS Fileset Catalog Configuration
+
+In addition to the basic configurations mentioned in [Fileset-catalog-catalog-configuration](./fileset-catalog.md#catalog-properties), the following properties are required to configure a Fileset catalog with COS:
+
+| Configuration item            | Description                                                                                                                                                                                                                                                                                                                                                | Default value | Required | Since version |
+|-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------|---------------|
+| `cos-region`                  | The region of the Tencent Cloud COS bucket, e.g. `ap-guangzhou`, `ap-shanghai`.                                                                                                                                                                                                                                                                            | (none)        | Yes      | 1.4.0         |
+| `cos-endpoint`                | The endpoint *suffix* of the Tencent Cloud COS service (mapped to `fs.cosn.bucket.endpoint_suffix`). It is a host suffix, not a full URL — e.g. `cos.ap-guangzhou.myqcloud.com`, **not** `https://cos.ap-guangzhou.myqcloud.com`. Optional; when not set, hadoop-cos derives it from `cos-region` (`cos.${region}.myqcloud.com`). Set this only if you need to point to a non-public endpoint (e.g. an internal/VPC endpoint).                                                                                                                | (none)        | No       | 1.4.0         |
+| `cos-access-key-id`           | The static access key ID (Tencent Cloud `SecretId`) used to access COS data.                                                                                                                                                                                                                                                                               | (none)        | Yes      | 1.4.0         |
+| `cos-secret-access-key`       | The static secret access key (Tencent Cloud `SecretKey`) used to access COS data.                                                                                                                                                                                                                                                                          | (none)        | Yes      | 1.4.0         |
+| `credential-providers`        | The credential provider types, separated by comma. The currently supported value is `cos-secret-key`. Setting this enables credential vending provided by the Gravitino server, so the GVFS client no longer needs `cos-access-key-id` / `cos-secret-access-key` locally. See [cos-credential-vending](#fileset-with-credential-vending) below for details. | (none)        | No       | 1.4.0         |
+
+:::note
+The fileset catalog automatically loads filesystem providers on the classpath. The COS provider is registered when the `gravitino-tencent-bundle` jar is present, so `default-filesystem-provider` and `filesystem-providers` do not need to be set.
+:::
+
+:::note
+`cos-region` is mandatory for hadoop-cos: signing requests, building the default endpoint and selecting the right CAM scope all require the region. Even if you also set `cos-endpoint`, please keep `cos-region` set.
+:::
+
+### Schema Configuration
+
+To create a schema, refer to [Schema configurations](./fileset-catalog.md#schema-properties).
+
+### Fileset Configuration
+
+For instructions on how to create a fileset, refer to [Fileset configurations](./fileset-catalog.md#fileset-properties) for more details.
+
+## Create the Catalog, Schema, and Fileset
+
+This section will show you how to use the Fileset catalog with COS in Gravitino, including detailed examples.
+
+### Step 1: Create a Fileset Catalog with COS
+
+First, you need to create a Fileset catalog for COS. The following examples demonstrate how to create a Fileset catalog with COS:
+
+<Tabs groupId="language" queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "test_catalog",
+  "type": "FILESET",
+  "comment": "This is a COS fileset catalog",
+  "properties": {
+    "location": "cosn://my-bucket-1250000000/root",
+    "cos-region": "ap-guangzhou",
+    "cos-access-key-id": "access_key",
+    "cos-secret-access-key": "secret_key"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient gravitinoClient = GravitinoClient
+    .builder("http://localhost:8090")
+    .withMetalake("metalake")
+    .build();
+
+Map<String, String> cosProperties = ImmutableMap.<String, String>builder()
+    .put("location", "cosn://my-bucket-1250000000/root")
+    .put("cos-region", "ap-guangzhou")
+    .put("cos-access-key-id", "access_key")
+    .put("cos-secret-access-key", "secret_key")
+    .build();
+
+Catalog cosCatalog = gravitinoClient.createCatalog("test_catalog",
+    Type.FILESET,
+    "This is a COS fileset catalog",
+    cosProperties);
+// ...
+
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="metalake")
+cos_properties = {
+    "location": "cosn://my-bucket-1250000000/root",
+    "cos-region": "ap-guangzhou",
+    "cos-access-key-id": "access_key",
+    "cos-secret-access-key": "secret_key"
+}
+
+cos_catalog = gravitino_client.create_catalog(name="test_catalog",
+                                              catalog_type=Catalog.Type.FILESET,
+                                              provider=None,
+                                              comment="This is a COS fileset catalog",
+                                              properties=cos_properties)
+```
+
+</TabItem>
+</Tabs>
+
+:::note
+Tencent Cloud COS bucket names always end with the appid suffix, for example `my-bucket-1250000000`. Use that full bucket name in `location` and in any `cosn://` URI.
+:::
+
+### Step 2: Create a Schema
+
+Once the Fileset catalog with COS is created, you can create a schema inside that catalog. Below are examples of how to do this:
+
+<Tabs groupId="language" queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "test_schema",
+  "comment": "This is a COS schema",
+  "properties": {
+    "location": "cosn://my-bucket-1250000000/root/schema"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs/test_catalog/schemas
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+Catalog catalog = gravitinoClient.loadCatalog("test_catalog");
+
+SupportsSchemas supportsSchemas = catalog.asSchemas();
+
+Map<String, String> schemaProperties = ImmutableMap.<String, String>builder()
+    .put("location", "cosn://my-bucket-1250000000/root/schema")
+    .build();
+Schema schema = supportsSchemas.createSchema("test_schema",
+    "This is a COS schema",
+    schemaProperties
+);
+// ...
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="metalake")
+catalog: Catalog = gravitino_client.load_catalog(name="test_catalog")
+catalog.as_schemas().create_schema(name="test_schema",
+                                   comment="This is a COS schema",
+                                   properties={"location": "cosn://my-bucket-1250000000/root/schema"})
+```
+
+</TabItem>
+</Tabs>
+
+
+### Step 3: Create a Fileset
+
+Now that the schema is created, you can create a fileset inside it. Here's how:
+
+<Tabs groupId="language" queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "example_fileset",
+  "comment": "This is an example fileset",
+  "type": "MANAGED",
+  "storageLocation": "cosn://my-bucket-1250000000/root/schema/example_fileset",
+  "properties": {
+    "k1": "v1"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs/test_catalog/schemas/test_schema/filesets
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient gravitinoClient = GravitinoClient
+    .builder("http://localhost:8090")
+    .withMetalake("metalake")
+    .build();
+
+Catalog catalog = gravitinoClient.loadCatalog("test_catalog");
+FilesetCatalog filesetCatalog = catalog.asFilesetCatalog();
+
+Map<String, String> propertiesMap = ImmutableMap.<String, String>builder()
+        .put("k1", "v1")
+        .build();
+
+filesetCatalog.createFileset(
+    NameIdentifier.of("test_schema", "example_fileset"),
+    "This is an example fileset",
+    Fileset.Type.MANAGED,
+    "cosn://my-bucket-1250000000/root/schema/example_fileset",
+    propertiesMap,
+);
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="metalake")
+
+catalog: Catalog = gravitino_client.load_catalog(name="test_catalog")
+catalog.as_fileset_catalog().create_fileset(ident=NameIdentifier.of("test_schema", "example_fileset"),
+                                            type=Fileset.Type.MANAGED,
+                                            comment="This is an example fileset",
+                                            storage_location="cosn://my-bucket-1250000000/root/schema/example_fileset",
+                                            properties={"k1": "v1"})
+```
+
+</TabItem>
+</Tabs>
+
+## Access a Fileset with COS
+
+### Access the Fileset with the GVFS Java Client
+
+To access fileset with COS using the GVFS Java client, based on the [basic GVFS configurations](./how-to-use-gvfs.md#configuration-1), you need to add the following configurations:
+
+| Configuration item      | Description                                                  | Default value | Required | Since version |
+|-------------------------|--------------------------------------------------------------|---------------|----------|---------------|
+| `cos-region`            | The region of the Tencent Cloud COS bucket.                  | (none)        | Yes      | 1.4.0         |
+| `cos-endpoint`          | The endpoint *suffix* of the Tencent Cloud COS service (e.g. `cos.ap-guangzhou.myqcloud.com`, not a full URL). Optional. | (none)        | No       | 1.4.0         |
+| `cos-access-key-id`     | The access key ID (Tencent Cloud SecretId) for COS data.     | (none)        | Yes      | 1.4.0         |
+| `cos-secret-access-key` | The secret access key (Tencent Cloud SecretKey) for COS data.| (none)        | Yes      | 1.4.0         |
+
+:::note
+If the catalog has enabled [credential vending](security/credential-vending.md), the AK/SK properties above can be omitted. More details can be found in [Fileset with credential vending](#fileset-with-credential-vending).
+:::
+
+```java
+Configuration conf = new Configuration();
+conf.set("fs.AbstractFileSystem.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.Gvfs");
+conf.set("fs.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.GravitinoVirtualFileSystem");
+conf.set("fs.gravitino.server.uri", "http://localhost:8090");
+conf.set("fs.gravitino.client.metalake", "test_metalake");
+conf.set("cos-region", "ap-guangzhou");
+conf.set("cos-access-key-id", "access_key");
+conf.set("cos-secret-access-key", "secret_key");
+Path filesetPath = new Path("gvfs://fileset/test_catalog/test_schema/test_fileset/new_dir");
+FileSystem fs = filesetPath.getFileSystem(conf);
+fs.mkdirs(filesetPath);
+...
+```
+
+Similar to Spark configurations, you need to add COS (bundle) jars to the classpath according to your environment.
+If you want to customise your hadoop version or there is already a hadoop version in your project, you can add the following dependencies to your `pom.xml`:
+
+```xml
+  <dependency>
+    <groupId>org.apache.hadoop</groupId>
+    <artifactId>hadoop-common</artifactId>
+    <version>${HADOOP_VERSION}</version>
+  </dependency>
+
+  <!-- hadoop-cos is published by Tencent Cloud, not by Apache Hadoop. -->
+  <dependency>
+    <groupId>com.qcloud.cos</groupId>
+    <artifactId>hadoop-cos</artifactId>
+    <version>3.3.0-8.3.23</version>
+  </dependency>
+
+  <dependency>
+    <groupId>org.apache.gravitino</groupId>
+    <artifactId>gravitino-filesystem-hadoop3-runtime</artifactId>
+    <version>${GRAVITINO_VERSION}</version>
+  </dependency>
+```
+
+:::note
+Unlike the S3, OSS, GCS and Azure connectors, COS does **not** ship with Apache Hadoop. The HCFS adapter for COS is published by Tencent Cloud as `com.qcloud.cos:hadoop-cos`. Make sure the version you pick is compatible with your Hadoop version (the `<hadoop>-<sdk>` form encodes both, e.g. `3.3.0-8.3.23` targets Hadoop 3.3.0).
+:::
+
+:::note
+Since version 1.4.0, the `gravitino-tencent` JAR is no longer required separately, as it is included in the `gravitino-filesystem-hadoop3-runtime` JAR.
+:::
+
+Or use the bundle jar with Hadoop environment if there is no Hadoop environment:
+
+```xml
+  <dependency>
+    <groupId>org.apache.gravitino</groupId>
+    <artifactId>gravitino-tencent-bundle</artifactId>
+    <version>${GRAVITINO_VERSION}</version>
+  </dependency>
+
+  <dependency>
+    <groupId>org.apache.gravitino</groupId>
+    <artifactId>gravitino-filesystem-hadoop3-runtime</artifactId>
+    <version>${GRAVITINO_VERSION}</version>
+  </dependency>
+```
+
+### Access the Fileset with Spark
+
+The following code snippet shows how to use **PySpark 3.5.0 with Hadoop environment(Hadoop 3.3.4)** to access the fileset:
+
+Before running the following code, you need to install required packages:
+
+```bash
+pip install pyspark==3.5.0
+pip install apache-gravitino==${GRAVITINO_VERSION}
+```
+Then you can run the following code:
+
+```python
+from pyspark.sql import SparkSession
+import os
+
+gravitino_url = "http://localhost:8090"
+metalake_name = "test"
+
+catalog_name = "your_cos_catalog"
+schema_name = "your_cos_schema"
+fileset_name = "your_cos_fileset"
+
+# JDK8 as follows. JDK17 will be slightly different, you need to add
+# '--conf "spark.driver.extraJavaOptions=--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"
+#  --conf "spark.executor.extraJavaOptions=--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"'
+# to the submit args.
+os.environ["PYSPARK_SUBMIT_ARGS"] = (
+    "--jars "
+    "/path/to/gravitino-filesystem-hadoop3-runtime-{gravitino-version}.jar,"
+    "/path/to/hadoop-cos-3.3.0-8.3.23.jar,"
+    "/path/to/cos_api-bundle-5.6.227.jar "
+    "--master local[1] pyspark-shell"
+)
+spark = SparkSession.builder \
+    .appName("cos_fileset_test") \
+    .config("spark.hadoop.fs.AbstractFileSystem.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.Gvfs") \
+    .config("spark.hadoop.fs.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.GravitinoVirtualFileSystem") \
+    .config("spark.hadoop.fs.gravitino.server.uri", gravitino_url) \
+    .config("spark.hadoop.fs.gravitino.client.metalake", "test") \
+    .config("spark.hadoop.cos-region", "ap-guangzhou") \
+    .config("spark.hadoop.cos-access-key-id", os.environ["COS_ACCESS_KEY_ID"]) \
+    .config("spark.hadoop.cos-secret-access-key", os.environ["COS_SECRET_ACCESS_KEY"]) \
+    .config("spark.driver.memory", "2g") \
+    .config("spark.driver.port", "2048") \
+    .getOrCreate()
+
+data = [("Alice", 25), ("Bob", 30), ("Cathy", 45)]
+columns = ["Name", "Age"]
+spark_df = spark.createDataFrame(data, schema=columns)
+gvfs_path = f"gvfs://fileset/{catalog_name}/{schema_name}/{fileset_name}/people"
+
+spark_df.coalesce(1).write \
+    .mode("overwrite") \
+    .option("header", "true") \
+    .csv(gvfs_path)
+```
+
+If your Spark is **without Hadoop environment**, you can use the following code snippet to access the fileset:
+
+```python
+## Replace the following code snippet with the above code snippet with the same environment variables
+
+os.environ["PYSPARK_SUBMIT_ARGS"] = "--jars /path/to/gravitino-tencent-bundle-{gravitino-version}.jar,/path/to/gravitino-filesystem-hadoop3-runtime-{gravitino-version}.jar --master local[1] pyspark-shell"
+```
+
+- [`gravitino-tencent-bundle-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-tencent-bundle): A "fat" JAR that includes `gravitino-tencent` functionality and all necessary dependencies like `hadoop-cos` and the Tencent Cloud COS Java SDK. Use this if your Spark environment doesn't have a pre-existing Hadoop setup.
+- [`gravitino-filesystem-hadoop3-runtime-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-filesystem-hadoop3-runtime): A "fat" JAR that bundles Gravitino's virtual filesystem client and includes the functionality of `gravitino-tencent`. It is required for accessing Gravitino filesets.
+- `hadoop-cos-3.3.0-8.3.23.jar` and `cos_api-bundle-5.6.227.jar`: The Tencent-Cloud-published HCFS adapter and Java SDK for COS. If you are running in an existing Hadoop environment, you need to provide these JARs yourself; they are not part of the standard Apache Hadoop distribution and must be downloaded from Maven Central or Tencent's release page.
+- [`gravitino-tencent-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-tencent): A "thin" JAR that only provides the COS integration code. Its functionality is already included in the `gravitino-tencent-bundle` and `gravitino-filesystem-hadoop3-runtime` JARs, so you do not need to add it as a direct dependency unless you want to manage all Hadoop and COS dependencies manually.

Review Comment:
   Why do we need `hadoop-cos-3.3.0-8.3.23.jar`, `gravitino-tencent-${gravitino-version}.jar` here again?
   
   `gravitino-tencent-bundle-${gravitino-version}.jar` and `gravitino-filesystem-hadoop3-runtime-${gravitino-version}.jar` should be enough.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "whua3 (via GitHub)" <gi...@apache.org>.
whua3 commented on PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#issuecomment-4825935125

   Additionally, I encountered a problem in the testing phase, so I created an independent PR(#11814) to fix it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "whua3 (via GitHub)" <gi...@apache.org>.
whua3 commented on code in PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#discussion_r3437456313


##########
bundles/tencent/src/main/java/org/apache/gravitino/cos/credential/COSSecretKeyProvider.java:
##########
@@ -0,0 +1,60 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.gravitino.cos.credential;
+
+import java.util.Map;
+import org.apache.gravitino.credential.COSSecretKeyCredential;
+import org.apache.gravitino.credential.Credential;
+import org.apache.gravitino.credential.CredentialContext;
+import org.apache.gravitino.credential.CredentialProvider;
+import org.apache.gravitino.credential.config.COSCredentialConfig;
+
+/** Generate COS access key and secret key to access Tencent Cloud COS data. */
+public class COSSecretKeyProvider implements CredentialProvider {
+
+  private String accessKey;
+  private String secretKey;
+
+  @Override
+  public void initialize(Map<String, String> properties) {
+    COSCredentialConfig cosCredentialConfig = new COSCredentialConfig(properties);
+    this.accessKey = cosCredentialConfig.accessKeyID();
+    this.secretKey = cosCredentialConfig.secretAccessKey();
+  }
+
+  @Override
+  public void close() {}
+
+  @Override
+  public boolean supportsScheme(String scheme) {
+    // hadoop-cos exposes the `cosn://` scheme; we accept both spellings to be lenient.
+    return "cosn".equalsIgnoreCase(scheme) || "cos".equalsIgnoreCase(scheme);

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#issuecomment-4728927155

   <!-- coverage-report -->
   ### Code Coverage Report
   |Overall Project|67.04% **`-0.06%`**|:green_circle:|
   |:-|:-|:-:|
   |Files changed|20.91%|:red_circle:|
   <br>
   
   |Module|Coverage||
   |:-|:-|:-:|
   |aliyun|1.72%|:red_circle:|
   |api|46.52% **`-0.3%`**|:green_circle:|
   |authorization-common|85.96%|:green_circle:|
   |aws|3.66%|:red_circle:|
   |azure|2.47%|:red_circle:|
   |catalog-common|9.92% **`-0.47%`**|:red_circle:|
   |catalog-fileset|80.23%|:green_circle:|
   |catalog-glue|66.91%|:green_circle:|
   |catalog-hive|79.44%|:green_circle:|
   |catalog-jdbc-clickhouse|80.02%|:green_circle:|
   |catalog-jdbc-common|44.22%|:green_circle:|
   |catalog-jdbc-doris|80.28%|:green_circle:|
   |catalog-jdbc-hologres|54.03%|:green_circle:|
   |catalog-jdbc-mysql|79.23%|:green_circle:|
   |catalog-jdbc-oceanbase|78.38%|:green_circle:|
   |catalog-jdbc-postgresql|82.29%|:green_circle:|
   |catalog-jdbc-starrocks|78.51%|:green_circle:|
   |catalog-kafka|77.01%|:green_circle:|
   |catalog-lakehouse-generic|58.53%|:green_circle:|
   |catalog-lakehouse-hudi|79.1%|:green_circle:|
   |catalog-lakehouse-iceberg|85.94%|:green_circle:|
   |catalog-lakehouse-paimon|82.14%|:green_circle:|
   |catalog-model|77.72%|:green_circle:|
   |cli|44.51%|:green_circle:|
   |client-java|78.01%|:green_circle:|
   |common|50.17%|:green_circle:|
   |core|82.45%|:green_circle:|
   |filesystem-hadoop3|77.27%|:green_circle:|
   |flink|0.0%|:red_circle:|
   |flink-common|46.84%|:green_circle:|
   |flink-runtime|0.0%|:red_circle:|
   |gcp|14.12%|:red_circle:|
   |hadoop-common|10.88% **`-0.04%`**|:red_circle:|
   |hive-metastore-common|53.77%|:green_circle:|
   |iceberg-common|58.15%|:green_circle:|
   |iceberg-rest-server|73.98%|:green_circle:|
   |idp-basic|86.18%|:green_circle:|
   |integration-test-common|0.0%|:red_circle:|
   |jobs|66.17%|:green_circle:|
   |lance-common|20.83%|:red_circle:|
   |lance-rest-server|60.13%|:green_circle:|
   |lineage|53.02%|:green_circle:|
   |optimizer|82.95%|:green_circle:|
   |optimizer-api|21.95%|:red_circle:|
   |server|85.96%|:green_circle:|
   |server-common|74.21%|:green_circle:|
   |spark|28.57%|:red_circle:|
   |spark-common|41.66%|:green_circle:|
   |tencent|38.33%|:red_circle:|
   |trino-connector|40.13%|:green_circle:|
   
   <details>
   <summary>Files</summary>
   
   |Module|File|Coverage||
   |:-|:-|:-|:-:|
   |api|[COSSecretKeyCredential.java](https://github.com/whua3/gravitino/blob/86af744b1d9bc2a045fb92105a0ef43e3e3b2fb3/api/src/main/java/org/apache/gravitino/credential/COSSecretKeyCredential.java)|0.0%|:red_circle:|
   |catalog-common|[COSCredentialConfig.java](https://github.com/whua3/gravitino/blob/86af744b1d9bc2a045fb92105a0ef43e3e3b2fb3/catalogs/catalog-common/src/main/java/org/apache/gravitino/credential/config/COSCredentialConfig.java)|0.0%|:red_circle:|
   ||[COSProperties.java](https://github.com/whua3/gravitino/blob/86af744b1d9bc2a045fb92105a0ef43e3e3b2fb3/catalogs/catalog-common/src/main/java/org/apache/gravitino/storage/COSProperties.java)|0.0%|:red_circle:|
   |hadoop-common|[Constants.java](https://github.com/whua3/gravitino/blob/86af744b1d9bc2a045fb92105a0ef43e3e3b2fb3/catalogs/hadoop-common/src/main/java/org/apache/gravitino/catalog/hadoop/fs/Constants.java)|0.0%|:red_circle:|
   |tencent|[COSUtils.java](https://github.com/whua3/gravitino/blob/86af744b1d9bc2a045fb92105a0ef43e3e3b2fb3/bundles/tencent/src/main/java/org/apache/gravitino/cos/fs/COSUtils.java)|100.0%|:green_circle:|
   ||[COSSecretKeyProvider.java](https://github.com/whua3/gravitino/blob/86af744b1d9bc2a045fb92105a0ef43e3e3b2fb3/bundles/tencent/src/main/java/org/apache/gravitino/cos/credential/COSSecretKeyProvider.java)|88.89%|:green_circle:|
   ||[COSFileSystemProvider.java](https://github.com/whua3/gravitino/blob/86af744b1d9bc2a045fb92105a0ef43e3e3b2fb3/bundles/tencent/src/main/java/org/apache/gravitino/cos/fs/COSFileSystemProvider.java)|45.83%|:red_circle:|
   ||[COSCredentialsProvider.java](https://github.com/whua3/gravitino/blob/86af744b1d9bc2a045fb92105a0ef43e3e3b2fb3/bundles/tencent/src/main/java/org/apache/gravitino/cos/fs/COSCredentialsProvider.java)|0.0%|:red_circle:|
   
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "whua3 (via GitHub)" <gi...@apache.org>.
whua3 commented on code in PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#discussion_r3452764551


##########
docs/fileset-catalog-with-cos.md:
##########
@@ -0,0 +1,548 @@
+---
+title: "Fileset Catalog with COS"
+slug: "/fileset-catalog-with-cos"
+date: 2026-06-17
+keyword: "Fileset catalog COS Tencent"
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Introduction
+
+This document explains how to configure a Fileset catalog with Tencent Cloud COS (Cloud Object Storage) in Gravitino.
+
+## Prerequisites

Review Comment:
   I have manually tested the code functionality, but this document was generated by AI. My apologies for not reviewing it thoroughly. I will fix these issues later and attach screenshots of the manual tests.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#discussion_r3510274684


##########
docs/fileset-catalog-with-cos.md:
##########
@@ -0,0 +1,544 @@
+---
+title: "Fileset Catalog with COS"
+slug: "/fileset-catalog-with-cos"
+date: 2026-6-17
+keyword: "Fileset catalog COS Tencent"
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Introduction
+
+This document explains how to configure a Fileset catalog with Tencent Cloud COS (Cloud Object Storage) in Gravitino.
+
+## Prerequisites
+
+To set up a Fileset catalog with COS, follow these steps:
+
+1. Download the [`gravitino-tencent-bundle-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-tencent-bundle) file.
+2. Place the downloaded file into the Gravitino Fileset catalog classpath at `${GRAVITINO_HOME}/catalogs/fileset/libs/`.
+3. Start the Gravitino server by running the following command:
+
+```bash
+$ ${GRAVITINO_HOME}/bin/gravitino-server.sh start
+```
+
+Once the server is up and running, you can proceed to configure the Fileset catalog with COS. In the rest of this document we will use `http://localhost:8090` as the Gravitino server URL, replace with your actual server URL.
+
+## COS Catalog Configuration
+
+### COS Fileset Catalog Configuration
+
+In addition to the basic configurations mentioned in [Fileset catalog properties](./fileset-catalog.md#catalog-properties), the following properties are required to configure a Fileset catalog with COS:
+
+| Configuration item            | Description                                                                                                                                                                                                                                                                                                                                                | Default value | Required | Since version |
+|-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------|---------------|

Review Comment:
   Better to align the table columns.



##########
docs/fileset-catalog-with-cos.md:
##########
@@ -0,0 +1,544 @@
+---
+title: "Fileset Catalog with COS"
+slug: "/fileset-catalog-with-cos"
+date: 2026-6-17
+keyword: "Fileset catalog COS Tencent"
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Introduction
+
+This document explains how to configure a Fileset catalog with Tencent Cloud COS (Cloud Object Storage) in Gravitino.
+
+## Prerequisites
+
+To set up a Fileset catalog with COS, follow these steps:
+
+1. Download the [`gravitino-tencent-bundle-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-tencent-bundle) file.
+2. Place the downloaded file into the Gravitino Fileset catalog classpath at `${GRAVITINO_HOME}/catalogs/fileset/libs/`.
+3. Start the Gravitino server by running the following command:
+
+```bash
+$ ${GRAVITINO_HOME}/bin/gravitino-server.sh start
+```
+
+Once the server is up and running, you can proceed to configure the Fileset catalog with COS. In the rest of this document we will use `http://localhost:8090` as the Gravitino server URL, replace with your actual server URL.
+
+## COS Catalog Configuration
+
+### COS Fileset Catalog Configuration
+
+In addition to the basic configurations mentioned in [Fileset catalog properties](./fileset-catalog.md#catalog-properties), the following properties are required to configure a Fileset catalog with COS:
+
+| Configuration item            | Description                                                                                                                                                                                                                                                                                                                                                | Default value | Required | Since version |
+|-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------|---------------|
+| `cos-region`                  | The region of the Tencent Cloud COS bucket, e.g. `ap-guangzhou`, `ap-shanghai`.                                                                                                                                                                                                                                                                            | (none)        | Yes      | 1.4.0         |
+| `cos-endpoint`                | The endpoint *suffix* of the Tencent Cloud COS service (mapped to `fs.cosn.bucket.endpoint_suffix`). It is a host suffix, not a full URL — e.g. `cos.ap-guangzhou.myqcloud.com`, **not** `https://cos.ap-guangzhou.myqcloud.com`. Optional; when not set, hadoop-cos derives it from `cos-region` (`cos.${region}.myqcloud.com`). Set this only if you need to point to a non-public endpoint (e.g. an internal/VPC endpoint).                                                                                                                | (none)        | No       | 1.4.0         |
+| `cos-access-key-id`           | The static access key ID (Tencent Cloud `SecretId`) used to access COS data.                                                                                                                                                                                                                                                                               | (none)        | Yes      | 1.4.0         |
+| `cos-secret-access-key`       | The static secret access key (Tencent Cloud `SecretKey`) used to access COS data.                                                                                                                                                                                                                                                                          | (none)        | Yes      | 1.4.0         |
+| `credential-providers`        | The credential provider types, separated by comma. The currently supported value is `cos-secret-key`. Setting this enables credential vending provided by the Gravitino server, so the GVFS client no longer needs `cos-access-key-id` / `cos-secret-access-key` locally. See [cos-credential-vending](#fileset-with-credential-vending) below for details. | (none)        | No       | 1.4.0         |
+
+:::note
+The fileset catalog automatically loads filesystem providers on the classpath. The COS provider
+is registered when the `gravitino-tencent-bundle` jar is present, so `default-filesystem-provider`
+and `filesystem-providers` do not need to be set.
+
+`cos-region` is mandatory for hadoop-cos: signing requests, building the default endpoint and
+selecting the right CAM scope all require the region. Even if you also set `cos-endpoint`, please
+keep `cos-region` set.
+:::
+
+### Schema Configuration
+
+To create a schema, refer to [Schema configurations](./fileset-catalog.md#schema-properties).
+
+### Fileset Configuration
+
+For instructions on how to create a fileset, refer to [Fileset configurations](./fileset-catalog.md#fileset-properties) for more details.
+
+## Create the Catalog, Schema, and Fileset
+
+This section will show you how to use the Fileset catalog with COS in Gravitino, including detailed examples.
+
+### Step 1: Create a Fileset Catalog with COS
+
+First, you need to create a Fileset catalog for COS. The following examples demonstrate how to create a Fileset catalog with COS:
+
+<Tabs groupId="language" queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "test_catalog",
+  "type": "FILESET",
+  "comment": "This is a COS fileset catalog",
+  "properties": {
+    "location": "cosn://my-bucket-1250000000/root",
+    "cos-region": "ap-guangzhou",
+    "cos-access-key-id": "access_key",
+    "cos-secret-access-key": "secret_key"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient gravitinoClient = GravitinoClient
+    .builder("http://localhost:8090")
+    .withMetalake("metalake")
+    .build();
+
+Map<String, String> cosProperties = ImmutableMap.<String, String>builder()
+    .put("location", "cosn://my-bucket-1250000000/root")
+    .put("cos-region", "ap-guangzhou")
+    .put("cos-access-key-id", "access_key")
+    .put("cos-secret-access-key", "secret_key")
+    .build();
+
+Catalog cosCatalog = gravitinoClient.createCatalog("test_catalog",
+    Type.FILESET,
+    "This is a COS fileset catalog",
+    cosProperties);
+// ...
+
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="metalake")
+cos_properties = {
+    "location": "cosn://my-bucket-1250000000/root",
+    "cos-region": "ap-guangzhou",
+    "cos-access-key-id": "access_key",
+    "cos-secret-access-key": "secret_key"
+}
+
+cos_catalog = gravitino_client.create_catalog(name="test_catalog",
+                                              catalog_type=Catalog.Type.FILESET,
+                                              provider=None,
+                                              comment="This is a COS fileset catalog",
+                                              properties=cos_properties)
+```
+
+</TabItem>
+</Tabs>
+
+:::note
+Tencent Cloud COS bucket names always end with the appid suffix, for example `my-bucket-1250000000`. Use that full bucket name in `location` and in any `cosn://` URI.
+:::
+
+### Step 2: Create a Schema
+
+Once the Fileset catalog with COS is created, you can create a schema inside that catalog. Below are examples of how to do this:
+
+<Tabs groupId="language" queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "test_schema",
+  "comment": "This is a COS schema",
+  "properties": {
+    "location": "cosn://my-bucket-1250000000/root/schema"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs/test_catalog/schemas
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+Catalog catalog = gravitinoClient.loadCatalog("test_catalog");
+
+SupportsSchemas supportsSchemas = catalog.asSchemas();
+
+Map<String, String> schemaProperties = ImmutableMap.<String, String>builder()
+    .put("location", "cosn://my-bucket-1250000000/root/schema")
+    .build();
+Schema schema = supportsSchemas.createSchema("test_schema",
+    "This is a COS schema",
+    schemaProperties
+);
+// ...
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="metalake")
+catalog: Catalog = gravitino_client.load_catalog(name="test_catalog")
+catalog.as_schemas().create_schema(name="test_schema",
+                                   comment="This is a COS schema",
+                                   properties={"location": "cosn://my-bucket-1250000000/root/schema"})
+```
+
+</TabItem>
+</Tabs>
+
+### Step 3: Create a Fileset
+
+Now that the schema is created, you can create a fileset inside it. Here's how:
+
+<Tabs groupId="language" queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "example_fileset",
+  "comment": "This is an example fileset",
+  "type": "MANAGED",
+  "storageLocation": "cosn://my-bucket-1250000000/root/schema/example_fileset",
+  "properties": {
+    "k1": "v1"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs/test_catalog/schemas/test_schema/filesets
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient gravitinoClient = GravitinoClient
+    .builder("http://localhost:8090")
+    .withMetalake("metalake")
+    .build();
+
+Catalog catalog = gravitinoClient.loadCatalog("test_catalog");
+FilesetCatalog filesetCatalog = catalog.asFilesetCatalog();
+
+Map<String, String> propertiesMap = ImmutableMap.<String, String>builder()
+        .put("k1", "v1")
+        .build();
+
+filesetCatalog.createFileset(
+    NameIdentifier.of("test_schema", "example_fileset"),
+    "This is an example fileset",
+    Fileset.Type.MANAGED,
+    "cosn://my-bucket-1250000000/root/schema/example_fileset",
+    propertiesMap);
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="metalake")
+
+catalog: Catalog = gravitino_client.load_catalog(name="test_catalog")
+catalog.as_fileset_catalog().create_fileset(ident=NameIdentifier.of("test_schema", "example_fileset"),
+                                            type=Fileset.Type.MANAGED,
+                                            comment="This is an example fileset",
+                                            storage_location="cosn://my-bucket-1250000000/root/schema/example_fileset",
+                                            properties={"k1": "v1"})
+```
+
+</TabItem>
+</Tabs>
+
+## Access a Fileset with COS
+
+### Access the Fileset with the GVFS Java Client
+
+To access fileset with COS using the GVFS Java client, based on the [basic GVFS configurations](./how-to-use-gvfs.md#configuration-1), you need to add the following configurations:
+
+| Configuration item      | Description                                                  | Default value | Required | Since version |
+|-------------------------|--------------------------------------------------------------|---------------|----------|---------------|
+| `cos-region`            | The region of the Tencent Cloud COS bucket.                  | (none)        | Yes      | 1.4.0         |
+| `cos-endpoint`          | The endpoint *suffix* of the Tencent Cloud COS service (e.g. `cos.ap-guangzhou.myqcloud.com`, not a full URL). Optional. | (none)        | No       | 1.4.0         |

Review Comment:
   ditto



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "whua3 (via GitHub)" <gi...@apache.org>.
whua3 commented on code in PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#discussion_r3437421528


##########
bundles/tencent/src/main/java/org/apache/gravitino/cos/fs/COSCredentialsProvider.java:
##########
@@ -0,0 +1,84 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.gravitino.cos.fs;
+
+import com.qcloud.cos.auth.BasicCOSCredentials;
+import com.qcloud.cos.auth.COSCredentials;
+import java.net.URI;
+import org.apache.gravitino.catalog.hadoop.fs.FileSystemUtils;
+import org.apache.gravitino.catalog.hadoop.fs.GravitinoFileSystemCredentialsProvider;
+import org.apache.gravitino.credential.COSSecretKeyCredential;
+import org.apache.gravitino.credential.Credential;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.auth.AbstractCOSCredentialProvider;
+
+/**
+ * Hadoop-COS credential provider that pulls vended credentials out of Gravitino and feeds them to
+ * the underlying {@code com.qcloud.cos.auth.COSCredentialsProvider} contract. PR-A only handles
+ * static secret-key credentials; STS / token credentials will be added by a follow-up PR.
+ */
+public class COSCredentialsProvider extends AbstractCOSCredentialProvider {

Review Comment:
   ok



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "whua3 (via GitHub)" <gi...@apache.org>.
whua3 commented on code in PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#discussion_r3487754462


##########
docs/fileset-catalog-with-cos.md:
##########
@@ -0,0 +1,548 @@
+---
+title: "Fileset Catalog with COS"
+slug: "/fileset-catalog-with-cos"
+date: 2026-06-17
+keyword: "Fileset catalog COS Tencent"
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Introduction
+
+This document explains how to configure a Fileset catalog with Tencent Cloud COS (Cloud Object Storage) in Gravitino.
+
+## Prerequisites
+
+To set up a Fileset catalog with COS, follow these steps:
+
+1. Download the [`gravitino-tencent-bundle-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-tencent-bundle) file.
+2. Place the downloaded file into the Gravitino Fileset catalog classpath at `${GRAVITINO_HOME}/catalogs/fileset/libs/`.
+3. Start the Gravitino server by running the following command:
+
+```bash
+$ ${GRAVITINO_HOME}/bin/gravitino-server.sh start
+```
+
+Once the server is up and running, you can proceed to configure the Fileset catalog with COS. In the rest of this document we will use `http://localhost:8090` as the Gravitino server URL, replace with your actual server URL.
+
+## COS Catalog Configuration
+
+### COS Fileset Catalog Configuration
+
+In addition to the basic configurations mentioned in [Fileset-catalog-catalog-configuration](./fileset-catalog.md#catalog-properties), the following properties are required to configure a Fileset catalog with COS:
+
+| Configuration item            | Description                                                                                                                                                                                                                                                                                                                                                | Default value | Required | Since version |
+|-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------|---------------|
+| `cos-region`                  | The region of the Tencent Cloud COS bucket, e.g. `ap-guangzhou`, `ap-shanghai`.                                                                                                                                                                                                                                                                            | (none)        | Yes      | 1.4.0         |
+| `cos-endpoint`                | The endpoint *suffix* of the Tencent Cloud COS service (mapped to `fs.cosn.bucket.endpoint_suffix`). It is a host suffix, not a full URL — e.g. `cos.ap-guangzhou.myqcloud.com`, **not** `https://cos.ap-guangzhou.myqcloud.com`. Optional; when not set, hadoop-cos derives it from `cos-region` (`cos.${region}.myqcloud.com`). Set this only if you need to point to a non-public endpoint (e.g. an internal/VPC endpoint).                                                                                                                | (none)        | No       | 1.4.0         |
+| `cos-access-key-id`           | The static access key ID (Tencent Cloud `SecretId`) used to access COS data.                                                                                                                                                                                                                                                                               | (none)        | Yes      | 1.4.0         |
+| `cos-secret-access-key`       | The static secret access key (Tencent Cloud `SecretKey`) used to access COS data.                                                                                                                                                                                                                                                                          | (none)        | Yes      | 1.4.0         |
+| `credential-providers`        | The credential provider types, separated by comma. The currently supported value is `cos-secret-key`. Setting this enables credential vending provided by the Gravitino server, so the GVFS client no longer needs `cos-access-key-id` / `cos-secret-access-key` locally. See [cos-credential-vending](#fileset-with-credential-vending) below for details. | (none)        | No       | 1.4.0         |
+
+:::note
+The fileset catalog automatically loads filesystem providers on the classpath. The COS provider is registered when the `gravitino-tencent-bundle` jar is present, so `default-filesystem-provider` and `filesystem-providers` do not need to be set.
+:::
+
+:::note
+`cos-region` is mandatory for hadoop-cos: signing requests, building the default endpoint and selecting the right CAM scope all require the region. Even if you also set `cos-endpoint`, please keep `cos-region` set.
+:::
+
+### Schema Configuration
+
+To create a schema, refer to [Schema configurations](./fileset-catalog.md#schema-properties).
+
+### Fileset Configuration
+
+For instructions on how to create a fileset, refer to [Fileset configurations](./fileset-catalog.md#fileset-properties) for more details.
+
+## Create the Catalog, Schema, and Fileset
+
+This section will show you how to use the Fileset catalog with COS in Gravitino, including detailed examples.
+
+### Step 1: Create a Fileset Catalog with COS
+
+First, you need to create a Fileset catalog for COS. The following examples demonstrate how to create a Fileset catalog with COS:
+
+<Tabs groupId="language" queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "test_catalog",
+  "type": "FILESET",
+  "comment": "This is a COS fileset catalog",
+  "properties": {
+    "location": "cosn://my-bucket-1250000000/root",
+    "cos-region": "ap-guangzhou",
+    "cos-access-key-id": "access_key",
+    "cos-secret-access-key": "secret_key"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient gravitinoClient = GravitinoClient
+    .builder("http://localhost:8090")
+    .withMetalake("metalake")
+    .build();
+
+Map<String, String> cosProperties = ImmutableMap.<String, String>builder()
+    .put("location", "cosn://my-bucket-1250000000/root")
+    .put("cos-region", "ap-guangzhou")
+    .put("cos-access-key-id", "access_key")
+    .put("cos-secret-access-key", "secret_key")
+    .build();
+
+Catalog cosCatalog = gravitinoClient.createCatalog("test_catalog",
+    Type.FILESET,
+    "This is a COS fileset catalog",
+    cosProperties);
+// ...
+
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="metalake")
+cos_properties = {
+    "location": "cosn://my-bucket-1250000000/root",
+    "cos-region": "ap-guangzhou",
+    "cos-access-key-id": "access_key",
+    "cos-secret-access-key": "secret_key"
+}
+
+cos_catalog = gravitino_client.create_catalog(name="test_catalog",
+                                              catalog_type=Catalog.Type.FILESET,
+                                              provider=None,
+                                              comment="This is a COS fileset catalog",
+                                              properties=cos_properties)
+```
+
+</TabItem>
+</Tabs>
+
+:::note
+Tencent Cloud COS bucket names always end with the appid suffix, for example `my-bucket-1250000000`. Use that full bucket name in `location` and in any `cosn://` URI.
+:::
+
+### Step 2: Create a Schema
+
+Once the Fileset catalog with COS is created, you can create a schema inside that catalog. Below are examples of how to do this:
+
+<Tabs groupId="language" queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "test_schema",
+  "comment": "This is a COS schema",
+  "properties": {
+    "location": "cosn://my-bucket-1250000000/root/schema"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs/test_catalog/schemas
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+Catalog catalog = gravitinoClient.loadCatalog("test_catalog");
+
+SupportsSchemas supportsSchemas = catalog.asSchemas();
+
+Map<String, String> schemaProperties = ImmutableMap.<String, String>builder()
+    .put("location", "cosn://my-bucket-1250000000/root/schema")
+    .build();
+Schema schema = supportsSchemas.createSchema("test_schema",
+    "This is a COS schema",
+    schemaProperties
+);
+// ...
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="metalake")
+catalog: Catalog = gravitino_client.load_catalog(name="test_catalog")
+catalog.as_schemas().create_schema(name="test_schema",
+                                   comment="This is a COS schema",
+                                   properties={"location": "cosn://my-bucket-1250000000/root/schema"})
+```
+
+</TabItem>
+</Tabs>
+
+
+### Step 3: Create a Fileset
+
+Now that the schema is created, you can create a fileset inside it. Here's how:
+
+<Tabs groupId="language" queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "example_fileset",
+  "comment": "This is an example fileset",
+  "type": "MANAGED",
+  "storageLocation": "cosn://my-bucket-1250000000/root/schema/example_fileset",
+  "properties": {
+    "k1": "v1"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs/test_catalog/schemas/test_schema/filesets
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient gravitinoClient = GravitinoClient
+    .builder("http://localhost:8090")
+    .withMetalake("metalake")
+    .build();
+
+Catalog catalog = gravitinoClient.loadCatalog("test_catalog");
+FilesetCatalog filesetCatalog = catalog.asFilesetCatalog();
+
+Map<String, String> propertiesMap = ImmutableMap.<String, String>builder()
+        .put("k1", "v1")
+        .build();
+
+filesetCatalog.createFileset(
+    NameIdentifier.of("test_schema", "example_fileset"),
+    "This is an example fileset",
+    Fileset.Type.MANAGED,
+    "cosn://my-bucket-1250000000/root/schema/example_fileset",
+    propertiesMap,
+);
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="metalake")
+
+catalog: Catalog = gravitino_client.load_catalog(name="test_catalog")
+catalog.as_fileset_catalog().create_fileset(ident=NameIdentifier.of("test_schema", "example_fileset"),
+                                            type=Fileset.Type.MANAGED,
+                                            comment="This is an example fileset",
+                                            storage_location="cosn://my-bucket-1250000000/root/schema/example_fileset",
+                                            properties={"k1": "v1"})
+```
+
+</TabItem>
+</Tabs>
+
+## Access a Fileset with COS
+
+### Access the Fileset with the GVFS Java Client
+
+To access fileset with COS using the GVFS Java client, based on the [basic GVFS configurations](./how-to-use-gvfs.md#configuration-1), you need to add the following configurations:
+
+| Configuration item      | Description                                                  | Default value | Required | Since version |
+|-------------------------|--------------------------------------------------------------|---------------|----------|---------------|
+| `cos-region`            | The region of the Tencent Cloud COS bucket.                  | (none)        | Yes      | 1.4.0         |
+| `cos-endpoint`          | The endpoint *suffix* of the Tencent Cloud COS service (e.g. `cos.ap-guangzhou.myqcloud.com`, not a full URL). Optional. | (none)        | No       | 1.4.0         |
+| `cos-access-key-id`     | The access key ID (Tencent Cloud SecretId) for COS data.     | (none)        | Yes      | 1.4.0         |
+| `cos-secret-access-key` | The secret access key (Tencent Cloud SecretKey) for COS data.| (none)        | Yes      | 1.4.0         |
+
+:::note
+If the catalog has enabled [credential vending](security/credential-vending.md), the AK/SK properties above can be omitted. More details can be found in [Fileset with credential vending](#fileset-with-credential-vending).
+:::
+
+```java
+Configuration conf = new Configuration();
+conf.set("fs.AbstractFileSystem.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.Gvfs");
+conf.set("fs.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.GravitinoVirtualFileSystem");
+conf.set("fs.gravitino.server.uri", "http://localhost:8090");
+conf.set("fs.gravitino.client.metalake", "test_metalake");
+conf.set("cos-region", "ap-guangzhou");
+conf.set("cos-access-key-id", "access_key");
+conf.set("cos-secret-access-key", "secret_key");
+Path filesetPath = new Path("gvfs://fileset/test_catalog/test_schema/test_fileset/new_dir");
+FileSystem fs = filesetPath.getFileSystem(conf);
+fs.mkdirs(filesetPath);
+...
+```
+
+Similar to Spark configurations, you need to add COS (bundle) jars to the classpath according to your environment.
+If you want to customise your hadoop version or there is already a hadoop version in your project, you can add the following dependencies to your `pom.xml`:
+
+```xml
+  <dependency>
+    <groupId>org.apache.hadoop</groupId>
+    <artifactId>hadoop-common</artifactId>
+    <version>${HADOOP_VERSION}</version>
+  </dependency>
+
+  <!-- hadoop-cos is published by Tencent Cloud, not by Apache Hadoop. -->
+  <dependency>
+    <groupId>com.qcloud.cos</groupId>
+    <artifactId>hadoop-cos</artifactId>
+    <version>3.3.0-8.3.23</version>
+  </dependency>
+
+  <dependency>
+    <groupId>org.apache.gravitino</groupId>
+    <artifactId>gravitino-filesystem-hadoop3-runtime</artifactId>
+    <version>${GRAVITINO_VERSION}</version>
+  </dependency>
+```
+
+:::note
+Unlike the S3, OSS, GCS and Azure connectors, COS does **not** ship with Apache Hadoop. The HCFS adapter for COS is published by Tencent Cloud as `com.qcloud.cos:hadoop-cos`. Make sure the version you pick is compatible with your Hadoop version (the `<hadoop>-<sdk>` form encodes both, e.g. `3.3.0-8.3.23` targets Hadoop 3.3.0).
+:::
+
+:::note
+Since version 1.4.0, the `gravitino-tencent` JAR is no longer required separately, as it is included in the `gravitino-filesystem-hadoop3-runtime` JAR.
+:::
+
+Or use the bundle jar with Hadoop environment if there is no Hadoop environment:
+
+```xml
+  <dependency>
+    <groupId>org.apache.gravitino</groupId>
+    <artifactId>gravitino-tencent-bundle</artifactId>
+    <version>${GRAVITINO_VERSION}</version>
+  </dependency>
+
+  <dependency>
+    <groupId>org.apache.gravitino</groupId>
+    <artifactId>gravitino-filesystem-hadoop3-runtime</artifactId>
+    <version>${GRAVITINO_VERSION}</version>
+  </dependency>
+```
+
+### Access the Fileset with Spark
+
+The following code snippet shows how to use **PySpark 3.5.0 with Hadoop environment(Hadoop 3.3.4)** to access the fileset:
+
+Before running the following code, you need to install required packages:
+
+```bash
+pip install pyspark==3.5.0
+pip install apache-gravitino==${GRAVITINO_VERSION}
+```
+Then you can run the following code:
+
+```python
+from pyspark.sql import SparkSession
+import os
+
+gravitino_url = "http://localhost:8090"
+metalake_name = "test"
+
+catalog_name = "your_cos_catalog"
+schema_name = "your_cos_schema"
+fileset_name = "your_cos_fileset"
+
+# JDK8 as follows. JDK17 will be slightly different, you need to add
+# '--conf "spark.driver.extraJavaOptions=--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"
+#  --conf "spark.executor.extraJavaOptions=--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"'
+# to the submit args.
+os.environ["PYSPARK_SUBMIT_ARGS"] = (
+    "--jars "
+    "/path/to/gravitino-filesystem-hadoop3-runtime-{gravitino-version}.jar,"
+    "/path/to/hadoop-cos-3.3.0-8.3.23.jar,"
+    "/path/to/cos_api-bundle-5.6.227.jar "
+    "--master local[1] pyspark-shell"
+)
+spark = SparkSession.builder \
+    .appName("cos_fileset_test") \
+    .config("spark.hadoop.fs.AbstractFileSystem.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.Gvfs") \
+    .config("spark.hadoop.fs.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.GravitinoVirtualFileSystem") \
+    .config("spark.hadoop.fs.gravitino.server.uri", gravitino_url) \
+    .config("spark.hadoop.fs.gravitino.client.metalake", "test") \
+    .config("spark.hadoop.cos-region", "ap-guangzhou") \
+    .config("spark.hadoop.cos-access-key-id", os.environ["COS_ACCESS_KEY_ID"]) \
+    .config("spark.hadoop.cos-secret-access-key", os.environ["COS_SECRET_ACCESS_KEY"]) \
+    .config("spark.driver.memory", "2g") \
+    .config("spark.driver.port", "2048") \
+    .getOrCreate()
+
+data = [("Alice", 25), ("Bob", 30), ("Cathy", 45)]
+columns = ["Name", "Age"]
+spark_df = spark.createDataFrame(data, schema=columns)
+gvfs_path = f"gvfs://fileset/{catalog_name}/{schema_name}/{fileset_name}/people"
+
+spark_df.coalesce(1).write \
+    .mode("overwrite") \
+    .option("header", "true") \
+    .csv(gvfs_path)
+```
+
+If your Spark is **without Hadoop environment**, you can use the following code snippet to access the fileset:
+
+```python
+## Replace the following code snippet with the above code snippet with the same environment variables
+
+os.environ["PYSPARK_SUBMIT_ARGS"] = "--jars /path/to/gravitino-tencent-bundle-{gravitino-version}.jar,/path/to/gravitino-filesystem-hadoop3-runtime-{gravitino-version}.jar --master local[1] pyspark-shell"
+```
+
+- [`gravitino-tencent-bundle-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-tencent-bundle): A "fat" JAR that includes `gravitino-tencent` functionality and all necessary dependencies like `hadoop-cos` and the Tencent Cloud COS Java SDK. Use this if your Spark environment doesn't have a pre-existing Hadoop setup.
+- [`gravitino-filesystem-hadoop3-runtime-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-filesystem-hadoop3-runtime): A "fat" JAR that bundles Gravitino's virtual filesystem client and includes the functionality of `gravitino-tencent`. It is required for accessing Gravitino filesets.
+- `hadoop-cos-3.3.0-8.3.23.jar` and `cos_api-bundle-5.6.227.jar`: The Tencent-Cloud-published HCFS adapter and Java SDK for COS. If you are running in an existing Hadoop environment, you need to provide these JARs yourself; they are not part of the standard Apache Hadoop distribution and must be downloaded from Maven Central or Tencent's release page.
+- [`gravitino-tencent-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-tencent): A "thin" JAR that only provides the COS integration code. Its functionality is already included in the `gravitino-tencent-bundle` and `gravitino-filesystem-hadoop3-runtime` JARs, so you do not need to add it as a direct dependency unless you want to manage all Hadoop and COS dependencies manually.

Review Comment:
   yes you are right, I have fixed it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "whua3 (via GitHub)" <gi...@apache.org>.
whua3 commented on code in PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#discussion_r3487754712


##########
catalogs/catalog-fileset/src/test/java/org/apache/gravitino/catalog/fileset/integration/test/FilesetCOSCatalogIT.java:
##########
@@ -0,0 +1,219 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.catalog.fileset.integration.test;
+
+import static org.apache.gravitino.catalog.fileset.FilesetCatalogPropertiesMetadata.FILESYSTEM_PROVIDERS;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Maps;
+import java.io.IOException;
+import java.net.URI;
+import java.util.Map;
+import org.apache.gravitino.Catalog;
+import org.apache.gravitino.NameIdentifier;
+import org.apache.gravitino.Schema;
+import org.apache.gravitino.file.Fileset;
+import org.apache.gravitino.integration.test.util.GravitinoITUtils;
+import org.apache.gravitino.storage.COSProperties;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIf;
+import org.junit.platform.commons.util.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Integration test for the fileset catalog backed by Tencent Cloud COS. It is disabled unless the
+ * required environment variables (COS_*) are present, mirroring the OSS / AWS counterparts.
+ */
+@EnabledIf(value = "cosIsConfigured", disabledReason = "Tencent Cloud COS is not configured.")
+public class FilesetCOSCatalogIT extends FilesetCatalogIT {

Review Comment:
   done



##########
docs/fileset-catalog.md:
##########
@@ -12,9 +12,10 @@ Fileset catalog is a fileset catalog that using Hadoop Compatible File System (H
 the storage location of the fileset. It supports the local filesystem and HDFS. Since
 0.7.0-incubating, Gravitino supports [S3](fileset-catalog-with-s3.md), [GCS](fileset-catalog-with-gcs.md),
 [OSS](fileset-catalog-with-oss.md) and [Azure Blob Storage](fileset-catalog-with-adls.md) through Fileset catalog.
+Since 1.3.0, Gravitino also supports [Tencent Cloud COS](fileset-catalog-with-cos.md).

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#11748] feat(catalog-hadoop): support Tencent Cloud COS as fileset storage backend (Java side) [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 merged PR #11713:
URL: https://github.com/apache/gravitino/pull/11713


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#discussion_r3432767204


##########
catalogs/catalog-common/src/main/java/org/apache/gravitino/credential/config/COSCredentialConfig.java:
##########
@@ -0,0 +1,79 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.gravitino.credential.config;
+
+import java.util.Map;
+import javax.validation.constraints.NotNull;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.gravitino.Config;
+import org.apache.gravitino.config.ConfigBuilder;
+import org.apache.gravitino.config.ConfigConstants;
+import org.apache.gravitino.config.ConfigEntry;
+import org.apache.gravitino.storage.COSProperties;
+
+/**
+ * Slim credential config for Tencent Cloud COS, covering only the static secret-key path. STS /
+ * token-related entries (role arn, token expire) will be added by a follow-up PR that introduces
+ * the dynamic credential vending support.
+ */
+public class COSCredentialConfig extends Config {
+
+  public static final ConfigEntry<String> COS_REGION =
+      new ConfigBuilder(COSProperties.GRAVITINO_COS_REGION)
+          .doc("The region of the Tencent Cloud COS service")
+          .version(ConfigConstants.VERSION_1_3_0)
+          .stringConf()
+          .create();
+
+  public static final ConfigEntry<String> COS_ACCESS_KEY_ID =
+      new ConfigBuilder(COSProperties.GRAVITINO_COS_ACCESS_KEY_ID)
+          .doc("The static access key ID (Tencent Cloud SecretId) used to access COS data")
+          .version(ConfigConstants.VERSION_1_3_0)
+          .stringConf()
+          .checkValue(StringUtils::isNotBlank, ConfigConstants.NOT_BLANK_ERROR_MSG)
+          .create();
+
+  public static final ConfigEntry<String> COS_SECRET_ACCESS_KEY =
+      new ConfigBuilder(COSProperties.GRAVITINO_COS_ACCESS_KEY_SECRET)
+          .doc("The static secret access key (Tencent Cloud SecretKey) used to access COS data")
+          .version(ConfigConstants.VERSION_1_3_0)
+          .stringConf()
+          .checkValue(StringUtils::isNotBlank, ConfigConstants.NOT_BLANK_ERROR_MSG)
+          .create();
+
+  public COSCredentialConfig(Map<String, String> properties) {
+    super(false);
+    loadFromMap(properties, k -> true);
+  }
+
+  public String region() {

Review Comment:
   `region()` isn't used anywhere in this PR (the provider only reads AK/SK), and `COS_REGION` has no `checkValue`/default. Fine as forward-looking code for the STS PR, just noting it's currently unused.



##########
bundles/tencent/src/main/java/org/apache/gravitino/cos/fs/COSCredentialsProvider.java:
##########
@@ -0,0 +1,84 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.gravitino.cos.fs;
+
+import com.qcloud.cos.auth.BasicCOSCredentials;
+import com.qcloud.cos.auth.COSCredentials;
+import java.net.URI;
+import org.apache.gravitino.catalog.hadoop.fs.FileSystemUtils;
+import org.apache.gravitino.catalog.hadoop.fs.GravitinoFileSystemCredentialsProvider;
+import org.apache.gravitino.credential.COSSecretKeyCredential;
+import org.apache.gravitino.credential.Credential;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.auth.AbstractCOSCredentialProvider;
+
+/**
+ * Hadoop-COS credential provider that pulls vended credentials out of Gravitino and feeds them to
+ * the underlying {@code com.qcloud.cos.auth.COSCredentialsProvider} contract. PR-A only handles
+ * static secret-key credentials; STS / token credentials will be added by a follow-up PR.
+ */
+public class COSCredentialsProvider extends AbstractCOSCredentialProvider {
+
+  private final GravitinoFileSystemCredentialsProvider gravitinoFileSystemCredentialsProvider;
+  private volatile COSCredentials basicCredentials;
+  private volatile long expirationTime = Long.MAX_VALUE;
+  private static final double EXPIRATION_TIME_FACTOR = 0.5D;
+
+  public COSCredentialsProvider(URI uri, Configuration conf) {
+    super(uri, conf);
+    this.gravitinoFileSystemCredentialsProvider = FileSystemUtils.getGvfsCredentialProvider(conf);
+  }
+
+  @Override
+  public COSCredentials getCredentials() {
+    if (basicCredentials == null || System.currentTimeMillis() >= expirationTime) {
+      synchronized (this) {
+        if (basicCredentials == null || System.currentTimeMillis() >= expirationTime) {
+          refresh();
+        }
+      }
+    }
+    return basicCredentials;
+  }
+
+  @Override
+  public void refresh() {
+    Credential[] gravitinoCredentials = gravitinoFileSystemCredentialsProvider.getCredentials();
+    Credential credential = COSUtils.getSuitableCredential(gravitinoCredentials);
+    if (credential == null) {
+      throw new RuntimeException("No suitable credential for COS found...");
+    }
+
+    if (credential instanceof COSSecretKeyCredential) {

Review Comment:
   If `getSuitableCredential` ever returns a credential that is not a `COSSecretKeyCredential`, `basicCredentials` stays `null` and no error is raised — `getCredentials()` then returns `null`, which will NPE deep inside the COS SDK. Safe today (the helper only returns secret-key or null), but once STS/token credentials are added in PR-B this becomes a trap. Consider an `else { throw ... }`.



##########
catalogs/catalog-common/src/main/java/org/apache/gravitino/credential/config/COSCredentialConfig.java:
##########
@@ -0,0 +1,79 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.gravitino.credential.config;
+
+import java.util.Map;
+import javax.validation.constraints.NotNull;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.gravitino.Config;
+import org.apache.gravitino.config.ConfigBuilder;
+import org.apache.gravitino.config.ConfigConstants;
+import org.apache.gravitino.config.ConfigEntry;
+import org.apache.gravitino.storage.COSProperties;
+
+/**
+ * Slim credential config for Tencent Cloud COS, covering only the static secret-key path. STS /
+ * token-related entries (role arn, token expire) will be added by a follow-up PR that introduces
+ * the dynamic credential vending support.
+ */
+public class COSCredentialConfig extends Config {
+
+  public static final ConfigEntry<String> COS_REGION =
+      new ConfigBuilder(COSProperties.GRAVITINO_COS_REGION)
+          .doc("The region of the Tencent Cloud COS service")
+          .version(ConfigConstants.VERSION_1_3_0)

Review Comment:
   Version markers say `1.3.0`, but `main` is currently `1.4.0-SNAPSHOT` and `ConfigConstants` has no `VERSION_1_4_0` (the latest is `VERSION_1_3_0`, and `CURRENT_SCRIPT_VERSION = VERSION_1_3_0`). Could you confirm the target release? If this lands in 1.4.0, these `.version(...)` markers (lines 41/48/56) and all the "Since version 1.3.0" entries in the docs should be bumped to 1.4.0, with a `VERSION_1_4_0` constant added.



##########
bundles/tencent/src/main/java/org/apache/gravitino/cos/credential/COSSecretKeyProvider.java:
##########
@@ -0,0 +1,60 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.gravitino.cos.credential;
+
+import java.util.Map;
+import org.apache.gravitino.credential.COSSecretKeyCredential;
+import org.apache.gravitino.credential.Credential;
+import org.apache.gravitino.credential.CredentialContext;
+import org.apache.gravitino.credential.CredentialProvider;
+import org.apache.gravitino.credential.config.COSCredentialConfig;
+
+/** Generate COS access key and secret key to access Tencent Cloud COS data. */
+public class COSSecretKeyProvider implements CredentialProvider {
+
+  private String accessKey;
+  private String secretKey;
+
+  @Override
+  public void initialize(Map<String, String> properties) {
+    COSCredentialConfig cosCredentialConfig = new COSCredentialConfig(properties);
+    this.accessKey = cosCredentialConfig.accessKeyID();
+    this.secretKey = cosCredentialConfig.secretAccessKey();
+  }
+
+  @Override
+  public void close() {}
+
+  @Override
+  public boolean supportsScheme(String scheme) {
+    // hadoop-cos exposes the `cosn://` scheme; we accept both spellings to be lenient.
+    return "cosn".equalsIgnoreCase(scheme) || "cos".equalsIgnoreCase(scheme);

Review Comment:
   Minor: `supportsScheme` accepts both `cos` and `cosn`, but `COSFileSystemProvider.scheme()` only advertises `cosn`. Harmless, just flagging the inconsistency (the comment already explains the leniency).



##########
catalogs/hadoop-common/src/main/java/org/apache/gravitino/catalog/hadoop/fs/Constants.java:
##########
@@ -67,6 +67,10 @@ public class Constants {
   public static final String OSS_ESTABLISH_TIMEOUT_KEY = "fs.oss.connection.establish.timeout";
   public static final String OSS_MAX_ERROR_RETRIES_KEY = "fs.oss.attempts.maximum";
 
+  // Tencent Cloud COS (hadoop-cos / CosNFileSystem) specific configuration keys
+  public static final String COS_CONNECTION_TIMEOUT_KEY = "fs.cosn.connection.timeout";

Review Comment:
   `fs.cosn.maxRetries` on the next line is a real hadoop-cos key (`CosNConfigKeys.COSN_MAX_RETRIES_KEY`), but I can't find `fs.cosn.connection.timeout` anywhere in `CosNConfigKeys` — hadoop-cos doesn't appear to expose a connection-timeout key at all. If the name is wrong, the default injected in `COSFileSystemProvider.additionalCOSConfig` is silently ignored. Please verify against hadoop-cos `3.3.0-8.3.23`, and prefer referencing `CosNConfigKeys.*` constants (as the credential key mapping already does) over hardcoded literals.



##########
bundles/tencent/src/main/java/org/apache/gravitino/cos/fs/COSCredentialsProvider.java:
##########
@@ -0,0 +1,84 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.gravitino.cos.fs;
+
+import com.qcloud.cos.auth.BasicCOSCredentials;
+import com.qcloud.cos.auth.COSCredentials;
+import java.net.URI;
+import org.apache.gravitino.catalog.hadoop.fs.FileSystemUtils;
+import org.apache.gravitino.catalog.hadoop.fs.GravitinoFileSystemCredentialsProvider;
+import org.apache.gravitino.credential.COSSecretKeyCredential;
+import org.apache.gravitino.credential.Credential;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.auth.AbstractCOSCredentialProvider;
+
+/**
+ * Hadoop-COS credential provider that pulls vended credentials out of Gravitino and feeds them to
+ * the underlying {@code com.qcloud.cos.auth.COSCredentialsProvider} contract. PR-A only handles
+ * static secret-key credentials; STS / token credentials will be added by a follow-up PR.
+ */
+public class COSCredentialsProvider extends AbstractCOSCredentialProvider {

Review Comment:
   This Hadoop-side bridge (the `refresh()`/`getCredentials()` caching + expiration logic) has no unit test, while the other COS classes do. Worth adding a small test that feeds a `COSSecretKeyCredential` through a stub `GravitinoFileSystemCredentialsProvider` and asserts the resulting `BasicCOSCredentials`.



##########
docs/fileset-catalog-with-cos.md:
##########
@@ -0,0 +1,548 @@
+---
+title: "Fileset Catalog with COS"
+slug: "/fileset-catalog-with-cos"
+date: 2026-06-17
+keyword: "Fileset catalog COS Tencent"
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Introduction
+
+This document explains how to configure a Fileset catalog with Tencent Cloud COS (Cloud Object Storage) in Gravitino.
+
+## Prerequisites
+
+To set up a Fileset catalog with COS, follow these steps:
+
+1. Download the [`gravitino-tencent-bundle-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-tencent-bundle) file.
+2. Place the downloaded file into the Gravitino Fileset catalog classpath at `${GRAVITINO_HOME}/catalogs/fileset/libs/`.
+3. Start the Gravitino server by running the following command:
+
+```bash
+$ ${GRAVITINO_HOME}/bin/gravitino-server.sh start
+```
+
+Once the server is up and running, you can proceed to configure the Fileset catalog with COS. In the rest of this document we will use `http://localhost:8090` as the Gravitino server URL, replace with your actual server URL.
+
+## COS Catalog Configuration
+
+### COS Fileset Catalog Configuration
+
+In addition to the basic configurations mentioned in [Fileset-catalog-catalog-configuration](./fileset-catalog.md#catalog-properties), the following properties are required to configure a Fileset catalog with COS:
+
+| Configuration item            | Description                                                                                                                                                                                                                                                                                                                                                | Default value | Required | Since version |
+|-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------|---------------|
+| `cos-region`                  | The region of the Tencent Cloud COS bucket, e.g. `ap-guangzhou`, `ap-shanghai`.                                                                                                                                                                                                                                                                            | (none)        | Yes      | 1.3.0         |
+| `cos-endpoint`                | The endpoint of the Tencent Cloud COS service. Optional; when not set, hadoop-cos derives it from `cos-region` (`cos.${region}.myqcloud.com`). Set this only if you need to point to a non-public endpoint (e.g. an internal/VPC endpoint).                                                                                                                | (none)        | No       | 1.3.0         |

Review Comment:
   `cos-endpoint` actually maps to `fs.cosn.bucket.endpoint_suffix`, i.e. it is an endpoint *suffix* (e.g. `cos.ap-guangzhou.myqcloud.com`), not a full URL. Worth clarifying here so users don't pass `https://...`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#discussion_r3432685922


##########
docs/fileset-catalog.md:
##########
@@ -43,7 +44,7 @@ the Fileset catalog has the following properties:
 | `fs.path.config.<name>`              | Defines a logical location entry. Set `fs.path.config.<name>` to the real base URI (for example, `hdfs://cluster1/`). Any key that starts with the same prefix (such as `fs.path.config.<name>.config.resource`) is treated as a location-scoped property and will be forwarded to the underlying filesystem client.            | (none)          | No       | 1.2.0            |
 
 :::note
-`default-filesystem-provider` and `filesystem-providers` are deprecated since 1.2.0. The fileset catalog automatically loads filesystem providers on the classpath, including buildin filesystem provider and cloud providers when the corresponding bundle jar is present (for example, `gravitino-aws-bundle`, `gravitino-azure-bundle`, `gravitino-aliyun-bundle`, or `gravitino-gcp-bundle`).
+`default-filesystem-provider` and `filesystem-providers` are deprecated since 1.2.0. The fileset catalog automatically loads filesystem providers on the classpath, including buildin filesystem provider and cloud providers when the corresponding bundle jar is present (for example, `gravitino-aws-bundle`, `gravitino-azure-bundle`, `gravitino-aliyun-bundle`, `gravitino-gcp-bundle`, or `gravitino-tencent-bundle`).

Review Comment:
   Typo in documentation: "buildin" should be "built-in".



##########
docs/fileset-catalog-with-cos.md:
##########
@@ -0,0 +1,548 @@
+---
+title: "Fileset Catalog with COS"
+slug: "/fileset-catalog-with-cos"
+date: 2026-06-17
+keyword: "Fileset catalog COS Tencent"
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Introduction
+
+This document explains how to configure a Fileset catalog with Tencent Cloud COS (Cloud Object Storage) in Gravitino.
+
+## Prerequisites
+
+To set up a Fileset catalog with COS, follow these steps:
+
+1. Download the [`gravitino-tencent-bundle-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-tencent-bundle) file.
+2. Place the downloaded file into the Gravitino Fileset catalog classpath at `${GRAVITINO_HOME}/catalogs/fileset/libs/`.
+3. Start the Gravitino server by running the following command:
+
+```bash
+$ ${GRAVITINO_HOME}/bin/gravitino-server.sh start
+```
+
+Once the server is up and running, you can proceed to configure the Fileset catalog with COS. In the rest of this document we will use `http://localhost:8090` as the Gravitino server URL, replace with your actual server URL.
+
+## COS Catalog Configuration
+
+### COS Fileset Catalog Configuration
+
+In addition to the basic configurations mentioned in [Fileset-catalog-catalog-configuration](./fileset-catalog.md#catalog-properties), the following properties are required to configure a Fileset catalog with COS:
+
+| Configuration item            | Description                                                                                                                                                                                                                                                                                                                                                | Default value | Required | Since version |
+|-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------|---------------|
+| `cos-region`                  | The region of the Tencent Cloud COS bucket, e.g. `ap-guangzhou`, `ap-shanghai`.                                                                                                                                                                                                                                                                            | (none)        | Yes      | 1.3.0         |
+| `cos-endpoint`                | The endpoint of the Tencent Cloud COS service. Optional; when not set, hadoop-cos derives it from `cos-region` (`cos.${region}.myqcloud.com`). Set this only if you need to point to a non-public endpoint (e.g. an internal/VPC endpoint).                                                                                                                | (none)        | No       | 1.3.0         |
+| `cos-access-key-id`           | The static access key ID (Tencent Cloud `SecretId`) used to access COS data.                                                                                                                                                                                                                                                                               | (none)        | Yes      | 1.3.0         |
+| `cos-secret-access-key`       | The static secret access key (Tencent Cloud `SecretKey`) used to access COS data.                                                                                                                                                                                                                                                                          | (none)        | Yes      | 1.3.0         |
+| `credential-providers`        | The credential provider types, separated by comma. The currently supported value is `cos-secret-key`. Setting this enables credential vending provided by the Gravitino server, so the GVFS client no longer needs `cos-access-key-id` / `cos-secret-access-key` locally. See [cos-credential-vending](#fileset-with-credential-vending) below for details. | (none)        | No       | 1.3.0         |
+
+:::note
+The fileset catalog automatically loads filesystem providers on the classpath. The COS provider is registered when the `gravitino-tencent-bundle` jar is present, so `default-filesystem-provider` and `filesystem-providers` do not need to be set.
+:::
+
+:::note
+`cos-region` is mandatory for hadoop-cos: signing requests, building the default endpoint and selecting the right CAM scope all require the region. Even if you also set `cos-endpoint`, please keep `cos-region` set.
+:::
+
+### Schema Configuration
+
+To create a schema, refer to [Schema configurations](./fileset-catalog.md#schema-properties).
+
+### Fileset Configuration
+
+For instructions on how to create a fileset, refer to [Fileset configurations](./fileset-catalog.md#fileset-properties) for more details.
+
+## Create the Catalog, Schema, and Fileset
+
+This section will show you how to use the Fileset catalog with COS in Gravitino, including detailed examples.
+
+### Step 1: Create a Fileset Catalog with COS
+
+First, you need to create a Fileset catalog for COS. The following examples demonstrate how to create a Fileset catalog with COS:
+
+<Tabs groupId="language" queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "test_catalog",
+  "type": "FILESET",
+  "comment": "This is a COS fileset catalog",
+  "properties": {
+    "location": "cosn://my-bucket-1250000000/root",
+    "cos-region": "ap-guangzhou",
+    "cos-access-key-id": "access_key",
+    "cos-secret-access-key": "secret_key"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient gravitinoClient = GravitinoClient
+    .builder("http://localhost:8090")
+    .withMetalake("metalake")
+    .build();
+
+Map<String, String> cosProperties = ImmutableMap.<String, String>builder()
+    .put("location", "cosn://my-bucket-1250000000/root")
+    .put("cos-region", "ap-guangzhou")
+    .put("cos-access-key-id", "access_key")
+    .put("cos-secret-access-key", "secret_key")
+    .build();
+
+Catalog cosCatalog = gravitinoClient.createCatalog("test_catalog",
+    Type.FILESET,
+    "This is a COS fileset catalog",
+    cosProperties);
+// ...
+
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="metalake")
+cos_properties = {
+    "location": "cosn://my-bucket-1250000000/root",
+    "cos-region": "ap-guangzhou",
+    "cos-access-key-id": "access_key",
+    "cos-secret-access-key": "secret_key"
+}
+
+cos_catalog = gravitino_client.create_catalog(name="test_catalog",
+                                              catalog_type=Catalog.Type.FILESET,
+                                              provider=None,
+                                              comment="This is a COS fileset catalog",
+                                              properties=cos_properties)
+```
+
+</TabItem>
+</Tabs>
+
+:::note
+Tencent Cloud COS bucket names always end with the appid suffix, for example `my-bucket-1250000000`. Use that full bucket name in `location` and in any `cosn://` URI.
+:::
+
+### Step 2: Create a Schema
+
+Once the Fileset catalog with COS is created, you can create a schema inside that catalog. Below are examples of how to do this:
+
+<Tabs groupId="language" queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "test_schema",
+  "comment": "This is a COS schema",
+  "properties": {
+    "location": "cosn://my-bucket-1250000000/root/schema"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs/test_catalog/schemas
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+Catalog catalog = gravitinoClient.loadCatalog("test_catalog");
+
+SupportsSchemas supportsSchemas = catalog.asSchemas();
+
+Map<String, String> schemaProperties = ImmutableMap.<String, String>builder()
+    .put("location", "cosn://my-bucket-1250000000/root/schema")
+    .build();
+Schema schema = supportsSchemas.createSchema("test_schema",
+    "This is a COS schema",
+    schemaProperties
+);
+// ...
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="metalake")
+catalog: Catalog = gravitino_client.load_catalog(name="test_catalog")
+catalog.as_schemas().create_schema(name="test_schema",
+                                   comment="This is a COS schema",
+                                   properties={"location": "cosn://my-bucket-1250000000/root/schema"})
+```
+
+</TabItem>
+</Tabs>
+
+
+### Step 3: Create a Fileset
+
+Now that the schema is created, you can create a fileset inside it. Here's how:
+
+<Tabs groupId="language" queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "example_fileset",
+  "comment": "This is an example fileset",
+  "type": "MANAGED",
+  "storageLocation": "cosn://my-bucket-1250000000/root/schema/example_fileset",
+  "properties": {
+    "k1": "v1"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs/test_catalog/schemas/test_schema/filesets
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient gravitinoClient = GravitinoClient
+    .builder("http://localhost:8090")
+    .withMetalake("metalake")
+    .build();
+
+Catalog catalog = gravitinoClient.loadCatalog("test_catalog");
+FilesetCatalog filesetCatalog = catalog.asFilesetCatalog();
+
+Map<String, String> propertiesMap = ImmutableMap.<String, String>builder()
+        .put("k1", "v1")
+        .build();
+
+filesetCatalog.createFileset(
+    NameIdentifier.of("test_schema", "example_fileset"),
+    "This is an example fileset",
+    Fileset.Type.MANAGED,
+    "cosn://my-bucket-1250000000/root/schema/example_fileset",
+    propertiesMap,
+);
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="metalake")
+
+catalog: Catalog = gravitino_client.load_catalog(name="test_catalog")
+catalog.as_fileset_catalog().create_fileset(ident=NameIdentifier.of("test_schema", "example_fileset"),
+                                            type=Fileset.Type.MANAGED,
+                                            comment="This is an example fileset",
+                                            storage_location="cosn://my-bucket-1250000000/root/schema/example_fileset",
+                                            properties={"k1": "v1"})
+```
+
+</TabItem>
+</Tabs>
+
+## Access a Fileset with COS
+
+### Access the Fileset with the GVFS Java Client
+
+To access fileset with COS using the GVFS Java client, based on the [basic GVFS configurations](./how-to-use-gvfs.md#configuration-1), you need to add the following configurations:
+
+| Configuration item      | Description                                                  | Default value | Required | Since version |
+|-------------------------|--------------------------------------------------------------|---------------|----------|---------------|
+| `cos-region`            | The region of the Tencent Cloud COS bucket.                  | (none)        | Yes      | 1.3.0         |
+| `cos-endpoint`          | The endpoint of the Tencent Cloud COS service (optional).    | (none)        | No       | 1.3.0         |
+| `cos-access-key-id`     | The access key ID (Tencent Cloud SecretId) for COS data.     | (none)        | Yes      | 1.3.0         |
+| `cos-secret-access-key` | The secret access key (Tencent Cloud SecretKey) for COS data.| (none)        | Yes      | 1.3.0         |
+
+:::note
+If the catalog has enabled [credential vending](security/credential-vending.md), the AK/SK properties above can be omitted. More details can be found in [Fileset with credential vending](#fileset-with-credential-vending).
+:::
+
+```java
+Configuration conf = new Configuration();
+conf.set("fs.AbstractFileSystem.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.Gvfs");
+conf.set("fs.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.GravitinoVirtualFileSystem");
+conf.set("fs.gravitino.server.uri", "http://localhost:8090");
+conf.set("fs.gravitino.client.metalake", "test_metalake");
+conf.set("cos-region", "ap-guangzhou");
+conf.set("cos-access-key-id", "access_key");
+conf.set("cos-secret-access-key", "secret_key");
+Path filesetPath = new Path("gvfs://fileset/test_catalog/test_schema/test_fileset/new_dir");
+FileSystem fs = filesetPath.getFileSystem(conf);
+fs.mkdirs(filesetPath);
+...
+```
+
+Similar to Spark configurations, you need to add COS (bundle) jars to the classpath according to your environment.
+If you want to customise your hadoop version or there is already a hadoop version in your project, you can add the following dependencies to your `pom.xml`:
+
+```xml
+  <dependency>
+    <groupId>org.apache.hadoop</groupId>
+    <artifactId>hadoop-common</artifactId>
+    <version>${HADOOP_VERSION}</version>
+  </dependency>
+
+  <!-- hadoop-cos is published by Tencent Cloud, not by Apache Hadoop. -->
+  <dependency>
+    <groupId>com.qcloud.cos</groupId>
+    <artifactId>hadoop-cos</artifactId>
+    <version>3.3.0-8.3.23</version>
+  </dependency>
+
+  <dependency>
+    <groupId>org.apache.gravitino</groupId>
+    <artifactId>gravitino-filesystem-hadoop3-runtime</artifactId>
+    <version>${GRAVITINO_VERSION}</version>
+  </dependency>
+```
+
+:::note
+Unlike the S3, OSS, GCS and Azure connectors, COS does **not** ship with Apache Hadoop. The HCFS adapter for COS is published by Tencent Cloud as `com.qcloud.cos:hadoop-cos`. Make sure the version you pick is compatible with your Hadoop version (the `<hadoop>-<sdk>` form encodes both, e.g. `3.3.0-8.3.23` targets Hadoop 3.3.0).
+:::
+
+:::note
+Since version 1.3.0, the `gravitino-tencent` JAR is no longer required separately, as it is included in the `gravitino-filesystem-hadoop3-runtime` JAR.
+:::
+
+Or use the bundle jar with Hadoop environment if there is no Hadoop environment:
+
+```xml
+  <dependency>
+    <groupId>org.apache.gravitino</groupId>
+    <artifactId>gravitino-tencent-bundle</artifactId>
+    <version>${GRAVITINO_VERSION}</version>
+  </dependency>
+
+  <dependency>
+    <groupId>org.apache.gravitino</groupId>
+    <artifactId>gravitino-filesystem-hadoop3-runtime</artifactId>
+    <version>${GRAVITINO_VERSION}</version>
+  </dependency>
+```
+
+### Access the Fileset with Spark
+
+The following code snippet shows how to use **PySpark 3.5.0 with Hadoop environment(Hadoop 3.3.4)** to access the fileset:
+
+Before running the following code, you need to install required packages:
+
+```bash
+pip install pyspark==3.5.0
+pip install apache-gravitino==${GRAVITINO_VERSION}
+```
+Then you can run the following code:
+
+```python
+from pyspark.sql import SparkSession
+import os
+
+gravitino_url = "http://localhost:8090"
+metalake_name = "test"
+
+catalog_name = "your_cos_catalog"
+schema_name = "your_cos_schema"
+fileset_name = "your_cos_fileset"
+
+# JDK8 as follows. JDK17 will be slightly different, you need to add
+# '--conf "spark.driver.extraJavaOptions=--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"
+#  --conf "spark.executor.extraJavaOptions=--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"'
+# to the submit args.
+os.environ["PYSPARK_SUBMIT_ARGS"] = (
+    "--jars "
+    "/path/to/gravitino-filesystem-hadoop3-runtime-{gravitino-version}.jar,"
+    "/path/to/hadoop-cos-3.3.0-8.3.23.jar,"
+    "/path/to/cos_api-bundle-5.6.227.jar "
+    "--master local[1] pyspark-shell"
+)
+spark = SparkSession.builder \
+    .appName("cos_fileset_test") \
+    .config("spark.hadoop.fs.AbstractFileSystem.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.Gvfs") \
+    .config("spark.hadoop.fs.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.GravitinoVirtualFileSystem") \
+    .config("spark.hadoop.fs.gravitino.server.uri", gravitino_url) \
+    .config("spark.hadoop.fs.gravitino.client.metalake", "test") \
+    .config("spark.hadoop.cos-region", "ap-guangzhou") \
+    .config("spark.hadoop.cos-access-key-id", os.environ["COS_ACCESS_KEY_ID"]) \
+    .config("spark.hadoop.cos-secret-access-key", os.environ["COS_SECRET_ACCESS_KEY"]) \
+    .config("spark.driver.memory", "2g") \
+    .config("spark.driver.port", "2048") \
+    .getOrCreate()
+
+data = [("Alice", 25), ("Bob", 30), ("Cathy", 45)]
+columns = ["Name", "Age"]
+spark_df = spark.createDataFrame(data, schema=columns)
+gvfs_path = f"gvfs://fileset/{catalog_name}/{schema_name}/{fileset_name}/people"
+
+spark_df.coalesce(1).write \
+    .mode("overwrite") \
+    .option("header", "true") \
+    .csv(gvfs_path)
+```
+
+If your Spark is **without Hadoop environment**, you can use the following code snippet to access the fileset:
+
+```python
+## Replace the following code snippet with the above code snippet with the same environment variables
+
+os.environ["PYSPARK_SUBMIT_ARGS"] = "--jars /path/to/gravitino-tencent-bundle-{gravitino-version}.jar,/path/to/gravitino-filesystem-hadoop3-runtime-{gravitino-version}.jar --master local[1] pyspark-shell"
+```
+
+- [`gravitino-tencent-bundle-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-tencent-bundle): A "fat" JAR that includes `gravitino-tencent` functionality and all necessary dependencies like `hadoop-cos` and the Tencent Cloud COS Java SDK. Use this if your Spark environment doesn't have a pre-existing Hadoop setup.
+- [`gravitino-filesystem-hadoop3-runtime-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-filesystem-hadoop3-runtime): A "fat" JAR that bundles Gravitino's virtual filesystem client and includes the functionality of `gravitino-tencent`. It is required for accessing Gravitino filesets.
+- `hadoop-cos-3.3.0-8.3.23.jar` and `cos_api-bundle-5.6.227.jar`: The Tencent-Cloud-published HCFS adapter and Java SDK for COS. If you are running in an existing Hadoop environment, you need to provide these JARs yourself; they are not part of the standard Apache Hadoop distribution and must be downloaded from Maven Central or Tencent's release page.
+- [`gravitino-tencent-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-tencent): A "thin" JAR that only provides the COS integration code. Its functionality is already included in the `gravitino-tencent-bundle` and `gravitino-filesystem-hadoop3-runtime` JARs, so you do not need to add it as a direct dependency unless you want to manage all Hadoop and COS dependencies manually.
+
+Please choose the correct jar according to your environment.
+
+:::note
+In some Spark versions, a Hadoop environment is needed by the driver, adding the bundle jars with `--jars` may not work. If this is the case, you should add the jars to the spark CLASSPATH directly.
+:::
+
+### Access a Fileset Using the Hadoop Fs Command
+
+The following are examples of how to use the `hadoop fs` command to access the fileset in Hadoop 3.1.3:
+
+1. Add the following contents to the `${HADOOP_HOME}/etc/hadoop/core-site.xml` file:
+
+```xml
+  <property>
+    <name>fs.AbstractFileSystem.gvfs.impl</name>
+    <value>org.apache.gravitino.filesystem.hadoop.Gvfs</value>
+  </property>
+
+  <property>
+    <name>fs.gvfs.impl</name>
+    <value>org.apache.gravitino.filesystem.hadoop.GravitinoVirtualFileSystem</value>
+  </property>
+
+  <property>
+    <name>fs.gravitino.server.uri</name>
+    <value>http://localhost:8090</value>
+  </property>
+
+  <property>
+    <name>fs.gravitino.client.metalake</name>
+    <value>test</value>
+  </property>
+
+  <property>
+    <name>cos-region</name>
+    <value>ap-guangzhou</value>
+  </property>
+
+  <property>
+    <name>cos-access-key-id</name>
+    <value>access-key</value>
+  </property>
+
+  <property>
+    <name>cos-secret-access-key</name>
+    <value>secret-key</value>
+  </property>
+```
+
+2. Add the necessary jars to the Hadoop classpath.
+
+For COS, you need to add `gravitino-filesystem-hadoop3-runtime-${gravitino-version}.jar`, `hadoop-cos-3.3.0-8.3.23.jar` and `cos_api-bundle-5.6.227.jar` to the Hadoop classpath. Unlike `hadoop-aws` or `hadoop-aliyun`, these jars are *not* part of the Apache Hadoop distribution; download them from Maven Central and place them under `${HADOOP_HOME}/share/hadoop/tools/lib/`.
+
+3. Run the following command to access the fileset:
+
+```shell
+./${HADOOP_HOME}/bin/hadoop dfs -ls gvfs://fileset/cos_catalog/cos_schema/cos_fileset
+./${HADOOP_HOME}/bin/hadoop dfs -put /path/to/local/file gvfs://fileset/cos_catalog/cos_schema/cos_fileset
+```
+
+### Access the Fileset with the GVFS Python Client / Pandas
+
+:::note
+The GVFS **Python** client does not yet ship a COS storage handler, so reading
+and writing COS-backed filesets via the Python `gvfs.GravitinoVirtualFileSystem`
+or pandas `read_csv("gvfs://...")` is **not supported in this release**. Only
+the GVFS **Java** client (and Spark / `hadoop fs` on top of it) can do fileset
+I/O against COS today.
+
+The Python `GravitinoClient` itself is not affected: you can still create,
+inspect, update and delete COS catalogs, schemas and filesets through the
+metadata API exactly as shown in the [Step 1 / 2 / 3 examples above](#step-1-create-a-fileset-catalog-with-cos).
+What is missing is purely the *data plane* (`gvfs.ls`, `gvfs.open`,
+pandas `read_csv("gvfs://...")`, etc.) for COS, which will be added in a
+follow-up release together with a `COSStorageHandler` and the corresponding
+fsspec adapter.
+:::
+
+For other use cases of the Java GVFS client, refer to the [Gravitino Virtual File System](./how-to-use-gvfs.md) document.
+
+## Fileset with Credential Vending
+
+Since 1.3.0, Gravitino supports credential vending for COS fileset. If the catalog has been [configured with credential](./security/credential-vending.md), you can access COS fileset without providing authentication information like `cos-access-key-id` and `cos-secret-access-key` in the GVFS client configuration.
+
+The currently supported credential providers are listed below:
+
+| Credential provider | Description                                                                                                                                                                | Vended credential type |
+|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------|
+| `cos-secret-key`    | The Gravitino server hands out the static `cos-access-key-id` / `cos-secret-access-key` configured on the catalog. Useful for centralising credentials on the server side. | Static AK/SK           |
+
+:::note
+STS-token-based credential vending (`cos-token`) for COS, including role-arn / assume-role configuration, will be added in a follow-up release. Until then, only the static `cos-secret-key` provider is available.
+:::
+
+### Create a COS Fileset Catalog with Credential Vending
+
+In addition to the configuration described in [COS fileset catalog configuration](#cos-fileset-catalog-configuration), you only need to set `credential-providers` to `cos-secret-key` to enable credential vending:
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "cos-catalog-with-credential-vending",
+  "type": "FILESET",
+  "comment": "This is a COS fileset catalog with credential vending",
+  "properties": {
+    "location": "cosn://my-bucket-1250000000/root",
+    "cos-region": "ap-guangzhou",
+    "cos-access-key-id": "access_key",
+    "cos-secret-access-key": "secret_key",
+    "credential-providers": "cos-secret-key"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs
+```
+
+### Access a COS Fileset with Credential Vending
+
+When the catalog is configured with credentials and client-side credential vending is enabled,
+you can access COS filesets directly using the GVFS Java/Python client or Spark without providing AK/SK in the client.
+

Review Comment:
   This section says COS filesets can be accessed via the GVFS Python client, but earlier the doc explicitly notes that the Python data-plane handler is not yet supported. To avoid conflicting guidance, remove the Python mention here.



##########
docs/fileset-catalog-with-cos.md:
##########
@@ -0,0 +1,548 @@
+---
+title: "Fileset Catalog with COS"
+slug: "/fileset-catalog-with-cos"
+date: 2026-06-17
+keyword: "Fileset catalog COS Tencent"
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Introduction
+
+This document explains how to configure a Fileset catalog with Tencent Cloud COS (Cloud Object Storage) in Gravitino.
+
+## Prerequisites
+
+To set up a Fileset catalog with COS, follow these steps:
+
+1. Download the [`gravitino-tencent-bundle-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-tencent-bundle) file.
+2. Place the downloaded file into the Gravitino Fileset catalog classpath at `${GRAVITINO_HOME}/catalogs/fileset/libs/`.
+3. Start the Gravitino server by running the following command:
+
+```bash
+$ ${GRAVITINO_HOME}/bin/gravitino-server.sh start
+```
+
+Once the server is up and running, you can proceed to configure the Fileset catalog with COS. In the rest of this document we will use `http://localhost:8090` as the Gravitino server URL, replace with your actual server URL.
+
+## COS Catalog Configuration
+
+### COS Fileset Catalog Configuration
+
+In addition to the basic configurations mentioned in [Fileset-catalog-catalog-configuration](./fileset-catalog.md#catalog-properties), the following properties are required to configure a Fileset catalog with COS:
+
+| Configuration item            | Description                                                                                                                                                                                                                                                                                                                                                | Default value | Required | Since version |
+|-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------|---------------|
+| `cos-region`                  | The region of the Tencent Cloud COS bucket, e.g. `ap-guangzhou`, `ap-shanghai`.                                                                                                                                                                                                                                                                            | (none)        | Yes      | 1.3.0         |
+| `cos-endpoint`                | The endpoint of the Tencent Cloud COS service. Optional; when not set, hadoop-cos derives it from `cos-region` (`cos.${region}.myqcloud.com`). Set this only if you need to point to a non-public endpoint (e.g. an internal/VPC endpoint).                                                                                                                | (none)        | No       | 1.3.0         |
+| `cos-access-key-id`           | The static access key ID (Tencent Cloud `SecretId`) used to access COS data.                                                                                                                                                                                                                                                                               | (none)        | Yes      | 1.3.0         |
+| `cos-secret-access-key`       | The static secret access key (Tencent Cloud `SecretKey`) used to access COS data.                                                                                                                                                                                                                                                                          | (none)        | Yes      | 1.3.0         |
+| `credential-providers`        | The credential provider types, separated by comma. The currently supported value is `cos-secret-key`. Setting this enables credential vending provided by the Gravitino server, so the GVFS client no longer needs `cos-access-key-id` / `cos-secret-access-key` locally. See [cos-credential-vending](#fileset-with-credential-vending) below for details. | (none)        | No       | 1.3.0         |
+
+:::note
+The fileset catalog automatically loads filesystem providers on the classpath. The COS provider is registered when the `gravitino-tencent-bundle` jar is present, so `default-filesystem-provider` and `filesystem-providers` do not need to be set.
+:::
+
+:::note
+`cos-region` is mandatory for hadoop-cos: signing requests, building the default endpoint and selecting the right CAM scope all require the region. Even if you also set `cos-endpoint`, please keep `cos-region` set.
+:::
+
+### Schema Configuration
+
+To create a schema, refer to [Schema configurations](./fileset-catalog.md#schema-properties).
+
+### Fileset Configuration
+
+For instructions on how to create a fileset, refer to [Fileset configurations](./fileset-catalog.md#fileset-properties) for more details.
+
+## Create the Catalog, Schema, and Fileset
+
+This section will show you how to use the Fileset catalog with COS in Gravitino, including detailed examples.
+
+### Step 1: Create a Fileset Catalog with COS
+
+First, you need to create a Fileset catalog for COS. The following examples demonstrate how to create a Fileset catalog with COS:
+
+<Tabs groupId="language" queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "test_catalog",
+  "type": "FILESET",
+  "comment": "This is a COS fileset catalog",
+  "properties": {
+    "location": "cosn://my-bucket-1250000000/root",
+    "cos-region": "ap-guangzhou",
+    "cos-access-key-id": "access_key",
+    "cos-secret-access-key": "secret_key"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient gravitinoClient = GravitinoClient
+    .builder("http://localhost:8090")
+    .withMetalake("metalake")
+    .build();
+
+Map<String, String> cosProperties = ImmutableMap.<String, String>builder()
+    .put("location", "cosn://my-bucket-1250000000/root")
+    .put("cos-region", "ap-guangzhou")
+    .put("cos-access-key-id", "access_key")
+    .put("cos-secret-access-key", "secret_key")
+    .build();
+
+Catalog cosCatalog = gravitinoClient.createCatalog("test_catalog",
+    Type.FILESET,
+    "This is a COS fileset catalog",
+    cosProperties);
+// ...
+
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="metalake")
+cos_properties = {
+    "location": "cosn://my-bucket-1250000000/root",
+    "cos-region": "ap-guangzhou",
+    "cos-access-key-id": "access_key",
+    "cos-secret-access-key": "secret_key"
+}
+
+cos_catalog = gravitino_client.create_catalog(name="test_catalog",
+                                              catalog_type=Catalog.Type.FILESET,
+                                              provider=None,
+                                              comment="This is a COS fileset catalog",
+                                              properties=cos_properties)
+```
+
+</TabItem>
+</Tabs>
+
+:::note
+Tencent Cloud COS bucket names always end with the appid suffix, for example `my-bucket-1250000000`. Use that full bucket name in `location` and in any `cosn://` URI.
+:::
+
+### Step 2: Create a Schema
+
+Once the Fileset catalog with COS is created, you can create a schema inside that catalog. Below are examples of how to do this:
+
+<Tabs groupId="language" queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "test_schema",
+  "comment": "This is a COS schema",
+  "properties": {
+    "location": "cosn://my-bucket-1250000000/root/schema"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs/test_catalog/schemas
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+Catalog catalog = gravitinoClient.loadCatalog("test_catalog");
+
+SupportsSchemas supportsSchemas = catalog.asSchemas();
+
+Map<String, String> schemaProperties = ImmutableMap.<String, String>builder()
+    .put("location", "cosn://my-bucket-1250000000/root/schema")
+    .build();
+Schema schema = supportsSchemas.createSchema("test_schema",
+    "This is a COS schema",
+    schemaProperties
+);
+// ...
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="metalake")
+catalog: Catalog = gravitino_client.load_catalog(name="test_catalog")
+catalog.as_schemas().create_schema(name="test_schema",
+                                   comment="This is a COS schema",
+                                   properties={"location": "cosn://my-bucket-1250000000/root/schema"})
+```
+
+</TabItem>
+</Tabs>
+
+
+### Step 3: Create a Fileset
+
+Now that the schema is created, you can create a fileset inside it. Here's how:
+
+<Tabs groupId="language" queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "example_fileset",
+  "comment": "This is an example fileset",
+  "type": "MANAGED",
+  "storageLocation": "cosn://my-bucket-1250000000/root/schema/example_fileset",
+  "properties": {
+    "k1": "v1"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs/test_catalog/schemas/test_schema/filesets
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient gravitinoClient = GravitinoClient
+    .builder("http://localhost:8090")
+    .withMetalake("metalake")
+    .build();
+
+Catalog catalog = gravitinoClient.loadCatalog("test_catalog");
+FilesetCatalog filesetCatalog = catalog.asFilesetCatalog();
+
+Map<String, String> propertiesMap = ImmutableMap.<String, String>builder()
+        .put("k1", "v1")
+        .build();
+
+filesetCatalog.createFileset(
+    NameIdentifier.of("test_schema", "example_fileset"),
+    "This is an example fileset",
+    Fileset.Type.MANAGED,
+    "cosn://my-bucket-1250000000/root/schema/example_fileset",
+    propertiesMap,
+);
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="metalake")
+
+catalog: Catalog = gravitino_client.load_catalog(name="test_catalog")
+catalog.as_fileset_catalog().create_fileset(ident=NameIdentifier.of("test_schema", "example_fileset"),
+                                            type=Fileset.Type.MANAGED,
+                                            comment="This is an example fileset",
+                                            storage_location="cosn://my-bucket-1250000000/root/schema/example_fileset",
+                                            properties={"k1": "v1"})
+```
+
+</TabItem>
+</Tabs>
+
+## Access a Fileset with COS
+
+### Access the Fileset with the GVFS Java Client
+
+To access fileset with COS using the GVFS Java client, based on the [basic GVFS configurations](./how-to-use-gvfs.md#configuration-1), you need to add the following configurations:
+
+| Configuration item      | Description                                                  | Default value | Required | Since version |
+|-------------------------|--------------------------------------------------------------|---------------|----------|---------------|
+| `cos-region`            | The region of the Tencent Cloud COS bucket.                  | (none)        | Yes      | 1.3.0         |
+| `cos-endpoint`          | The endpoint of the Tencent Cloud COS service (optional).    | (none)        | No       | 1.3.0         |
+| `cos-access-key-id`     | The access key ID (Tencent Cloud SecretId) for COS data.     | (none)        | Yes      | 1.3.0         |
+| `cos-secret-access-key` | The secret access key (Tencent Cloud SecretKey) for COS data.| (none)        | Yes      | 1.3.0         |
+
+:::note
+If the catalog has enabled [credential vending](security/credential-vending.md), the AK/SK properties above can be omitted. More details can be found in [Fileset with credential vending](#fileset-with-credential-vending).
+:::
+
+```java
+Configuration conf = new Configuration();
+conf.set("fs.AbstractFileSystem.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.Gvfs");
+conf.set("fs.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.GravitinoVirtualFileSystem");
+conf.set("fs.gravitino.server.uri", "http://localhost:8090");
+conf.set("fs.gravitino.client.metalake", "test_metalake");
+conf.set("cos-region", "ap-guangzhou");
+conf.set("cos-access-key-id", "access_key");
+conf.set("cos-secret-access-key", "secret_key");
+Path filesetPath = new Path("gvfs://fileset/test_catalog/test_schema/test_fileset/new_dir");
+FileSystem fs = filesetPath.getFileSystem(conf);
+fs.mkdirs(filesetPath);
+...
+```
+
+Similar to Spark configurations, you need to add COS (bundle) jars to the classpath according to your environment.
+If you want to customise your hadoop version or there is already a hadoop version in your project, you can add the following dependencies to your `pom.xml`:
+
+```xml
+  <dependency>
+    <groupId>org.apache.hadoop</groupId>
+    <artifactId>hadoop-common</artifactId>
+    <version>${HADOOP_VERSION}</version>
+  </dependency>
+
+  <!-- hadoop-cos is published by Tencent Cloud, not by Apache Hadoop. -->
+  <dependency>
+    <groupId>com.qcloud.cos</groupId>
+    <artifactId>hadoop-cos</artifactId>
+    <version>3.3.0-8.3.23</version>
+  </dependency>
+
+  <dependency>
+    <groupId>org.apache.gravitino</groupId>
+    <artifactId>gravitino-filesystem-hadoop3-runtime</artifactId>
+    <version>${GRAVITINO_VERSION}</version>
+  </dependency>
+```
+
+:::note
+Unlike the S3, OSS, GCS and Azure connectors, COS does **not** ship with Apache Hadoop. The HCFS adapter for COS is published by Tencent Cloud as `com.qcloud.cos:hadoop-cos`. Make sure the version you pick is compatible with your Hadoop version (the `<hadoop>-<sdk>` form encodes both, e.g. `3.3.0-8.3.23` targets Hadoop 3.3.0).
+:::
+
+:::note
+Since version 1.3.0, the `gravitino-tencent` JAR is no longer required separately, as it is included in the `gravitino-filesystem-hadoop3-runtime` JAR.
+:::
+
+Or use the bundle jar with Hadoop environment if there is no Hadoop environment:
+
+```xml
+  <dependency>
+    <groupId>org.apache.gravitino</groupId>
+    <artifactId>gravitino-tencent-bundle</artifactId>
+    <version>${GRAVITINO_VERSION}</version>
+  </dependency>
+
+  <dependency>
+    <groupId>org.apache.gravitino</groupId>
+    <artifactId>gravitino-filesystem-hadoop3-runtime</artifactId>
+    <version>${GRAVITINO_VERSION}</version>
+  </dependency>
+```
+
+### Access the Fileset with Spark
+
+The following code snippet shows how to use **PySpark 3.5.0 with Hadoop environment(Hadoop 3.3.4)** to access the fileset:
+
+Before running the following code, you need to install required packages:
+
+```bash
+pip install pyspark==3.5.0
+pip install apache-gravitino==${GRAVITINO_VERSION}
+```
+Then you can run the following code:
+
+```python
+from pyspark.sql import SparkSession
+import os
+
+gravitino_url = "http://localhost:8090"
+metalake_name = "test"
+
+catalog_name = "your_cos_catalog"
+schema_name = "your_cos_schema"
+fileset_name = "your_cos_fileset"
+
+# JDK8 as follows. JDK17 will be slightly different, you need to add
+# '--conf "spark.driver.extraJavaOptions=--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"
+#  --conf "spark.executor.extraJavaOptions=--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"'
+# to the submit args.
+os.environ["PYSPARK_SUBMIT_ARGS"] = (
+    "--jars "
+    "/path/to/gravitino-filesystem-hadoop3-runtime-{gravitino-version}.jar,"
+    "/path/to/hadoop-cos-3.3.0-8.3.23.jar,"
+    "/path/to/cos_api-bundle-5.6.227.jar "
+    "--master local[1] pyspark-shell"
+)
+spark = SparkSession.builder \
+    .appName("cos_fileset_test") \
+    .config("spark.hadoop.fs.AbstractFileSystem.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.Gvfs") \
+    .config("spark.hadoop.fs.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.GravitinoVirtualFileSystem") \
+    .config("spark.hadoop.fs.gravitino.server.uri", gravitino_url) \
+    .config("spark.hadoop.fs.gravitino.client.metalake", "test") \
+    .config("spark.hadoop.cos-region", "ap-guangzhou") \
+    .config("spark.hadoop.cos-access-key-id", os.environ["COS_ACCESS_KEY_ID"]) \
+    .config("spark.hadoop.cos-secret-access-key", os.environ["COS_SECRET_ACCESS_KEY"]) \
+    .config("spark.driver.memory", "2g") \
+    .config("spark.driver.port", "2048") \
+    .getOrCreate()
+
+data = [("Alice", 25), ("Bob", 30), ("Cathy", 45)]
+columns = ["Name", "Age"]
+spark_df = spark.createDataFrame(data, schema=columns)
+gvfs_path = f"gvfs://fileset/{catalog_name}/{schema_name}/{fileset_name}/people"
+
+spark_df.coalesce(1).write \
+    .mode("overwrite") \
+    .option("header", "true") \
+    .csv(gvfs_path)
+```
+
+If your Spark is **without Hadoop environment**, you can use the following code snippet to access the fileset:
+
+```python
+## Replace the following code snippet with the above code snippet with the same environment variables
+
+os.environ["PYSPARK_SUBMIT_ARGS"] = "--jars /path/to/gravitino-tencent-bundle-{gravitino-version}.jar,/path/to/gravitino-filesystem-hadoop3-runtime-{gravitino-version}.jar --master local[1] pyspark-shell"
+```
+
+- [`gravitino-tencent-bundle-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-tencent-bundle): A "fat" JAR that includes `gravitino-tencent` functionality and all necessary dependencies like `hadoop-cos` and the Tencent Cloud COS Java SDK. Use this if your Spark environment doesn't have a pre-existing Hadoop setup.
+- [`gravitino-filesystem-hadoop3-runtime-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-filesystem-hadoop3-runtime): A "fat" JAR that bundles Gravitino's virtual filesystem client and includes the functionality of `gravitino-tencent`. It is required for accessing Gravitino filesets.
+- `hadoop-cos-3.3.0-8.3.23.jar` and `cos_api-bundle-5.6.227.jar`: The Tencent-Cloud-published HCFS adapter and Java SDK for COS. If you are running in an existing Hadoop environment, you need to provide these JARs yourself; they are not part of the standard Apache Hadoop distribution and must be downloaded from Maven Central or Tencent's release page.
+- [`gravitino-tencent-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-tencent): A "thin" JAR that only provides the COS integration code. Its functionality is already included in the `gravitino-tencent-bundle` and `gravitino-filesystem-hadoop3-runtime` JARs, so you do not need to add it as a direct dependency unless you want to manage all Hadoop and COS dependencies manually.
+
+Please choose the correct jar according to your environment.
+
+:::note
+In some Spark versions, a Hadoop environment is needed by the driver, adding the bundle jars with `--jars` may not work. If this is the case, you should add the jars to the spark CLASSPATH directly.
+:::
+
+### Access a Fileset Using the Hadoop Fs Command
+
+The following are examples of how to use the `hadoop fs` command to access the fileset in Hadoop 3.1.3:
+
+1. Add the following contents to the `${HADOOP_HOME}/etc/hadoop/core-site.xml` file:
+
+```xml
+  <property>
+    <name>fs.AbstractFileSystem.gvfs.impl</name>
+    <value>org.apache.gravitino.filesystem.hadoop.Gvfs</value>
+  </property>
+
+  <property>
+    <name>fs.gvfs.impl</name>
+    <value>org.apache.gravitino.filesystem.hadoop.GravitinoVirtualFileSystem</value>
+  </property>
+
+  <property>
+    <name>fs.gravitino.server.uri</name>
+    <value>http://localhost:8090</value>
+  </property>
+
+  <property>
+    <name>fs.gravitino.client.metalake</name>
+    <value>test</value>
+  </property>
+
+  <property>
+    <name>cos-region</name>
+    <value>ap-guangzhou</value>
+  </property>
+
+  <property>
+    <name>cos-access-key-id</name>
+    <value>access-key</value>
+  </property>
+
+  <property>
+    <name>cos-secret-access-key</name>
+    <value>secret-key</value>
+  </property>
+```
+
+2. Add the necessary jars to the Hadoop classpath.
+
+For COS, you need to add `gravitino-filesystem-hadoop3-runtime-${gravitino-version}.jar`, `hadoop-cos-3.3.0-8.3.23.jar` and `cos_api-bundle-5.6.227.jar` to the Hadoop classpath. Unlike `hadoop-aws` or `hadoop-aliyun`, these jars are *not* part of the Apache Hadoop distribution; download them from Maven Central and place them under `${HADOOP_HOME}/share/hadoop/tools/lib/`.
+
+3. Run the following command to access the fileset:
+
+```shell
+./${HADOOP_HOME}/bin/hadoop dfs -ls gvfs://fileset/cos_catalog/cos_schema/cos_fileset
+./${HADOOP_HOME}/bin/hadoop dfs -put /path/to/local/file gvfs://fileset/cos_catalog/cos_schema/cos_fileset
+```
+
+### Access the Fileset with the GVFS Python Client / Pandas
+
+:::note
+The GVFS **Python** client does not yet ship a COS storage handler, so reading
+and writing COS-backed filesets via the Python `gvfs.GravitinoVirtualFileSystem`
+or pandas `read_csv("gvfs://...")` is **not supported in this release**. Only
+the GVFS **Java** client (and Spark / `hadoop fs` on top of it) can do fileset
+I/O against COS today.
+
+The Python `GravitinoClient` itself is not affected: you can still create,
+inspect, update and delete COS catalogs, schemas and filesets through the
+metadata API exactly as shown in the [Step 1 / 2 / 3 examples above](#step-1-create-a-fileset-catalog-with-cos).
+What is missing is purely the *data plane* (`gvfs.ls`, `gvfs.open`,
+pandas `read_csv("gvfs://...")`, etc.) for COS, which will be added in a
+follow-up release together with a `COSStorageHandler` and the corresponding
+fsspec adapter.
+:::
+
+For other use cases of the Java GVFS client, refer to the [Gravitino Virtual File System](./how-to-use-gvfs.md) document.
+
+## Fileset with Credential Vending
+
+Since 1.3.0, Gravitino supports credential vending for COS fileset. If the catalog has been [configured with credential](./security/credential-vending.md), you can access COS fileset without providing authentication information like `cos-access-key-id` and `cos-secret-access-key` in the GVFS client configuration.
+
+The currently supported credential providers are listed below:
+
+| Credential provider | Description                                                                                                                                                                | Vended credential type |
+|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------|
+| `cos-secret-key`    | The Gravitino server hands out the static `cos-access-key-id` / `cos-secret-access-key` configured on the catalog. Useful for centralising credentials on the server side. | Static AK/SK           |
+
+:::note
+STS-token-based credential vending (`cos-token`) for COS, including role-arn / assume-role configuration, will be added in a follow-up release. Until then, only the static `cos-secret-key` provider is available.
+:::
+
+### Create a COS Fileset Catalog with Credential Vending
+
+In addition to the configuration described in [COS fileset catalog configuration](#cos-fileset-catalog-configuration), you only need to set `credential-providers` to `cos-secret-key` to enable credential vending:
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "cos-catalog-with-credential-vending",
+  "type": "FILESET",
+  "comment": "This is a COS fileset catalog with credential vending",
+  "properties": {
+    "location": "cosn://my-bucket-1250000000/root",
+    "cos-region": "ap-guangzhou",
+    "cos-access-key-id": "access_key",
+    "cos-secret-access-key": "secret_key",
+    "credential-providers": "cos-secret-key"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs
+```
+
+### Access a COS Fileset with Credential Vending
+
+When the catalog is configured with credentials and client-side credential vending is enabled,
+you can access COS filesets directly using the GVFS Java/Python client or Spark without providing AK/SK in the client.
+
+GVFS Java client:
+
+```java
+Configuration conf = new Configuration();
+conf.setBoolean("fs.gravitino.enableCredentialVending", true);
+conf.set("fs.AbstractFileSystem.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.Gvfs");
+conf.set("fs.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.GravitinoVirtualFileSystem");
+conf.set("fs.gravitino.server.uri", "http://localhost:8090");
+conf.set("fs.gravitino.client.metalake", "test_metalake");
+// No need to set cos-access-key-id and cos-secret-access-key
+Path filesetPath = new Path("gvfs://fileset/cos_test_catalog/test_schema/test_fileset/new_dir");
+FileSystem fs = filesetPath.getFileSystem(conf);
+fs.mkdirs(filesetPath);
+...
+```
+
+Spark:
+
+```python
+spark = SparkSession.builder \
+    .appName("cos_fileset_test") \
+    .config("spark.hadoop.fs.gravitino.enableCredentialVending", "true") \
+    .config("spark.hadoop.fs.AbstractFileSystem.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.Gvfs") \
+    .config("spark.hadoop.fs.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.GravitinoVirtualFileSystem") \
+    .config("spark.hadoop.fs.gravitino.server.uri", "http://localhost:8090") \
+    .config("spark.hadoop.fs.gravitino.client.metalake", "test") \
+    # No need to set cos-access-key-id and cos-secret-access-key
+    .config("spark.driver.memory", "2g") \
+    .config("spark.driver.port", "2048") \
+    .getOrCreate()
+```
+
+Python client and Hadoop command are similar to the above examples.

Review Comment:
   The closing sentence implies the Python GVFS client can access COS-backed filesets, which contradicts the earlier note that Python I/O is not supported yet. Consider limiting this to Hadoop/Spark/Java GVFS only.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#11748] feat(catalog-hadoop): support Tencent Cloud COS as fileset storage backend (Java side) [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#issuecomment-4873102496

   I'm going to merge this PR, @whua3. Thanks for your hard work. I'm looking forward to more PRs


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "whua3 (via GitHub)" <gi...@apache.org>.
whua3 commented on PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#issuecomment-4862069891

   > A minor one, others LGTM
   
   done~


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#issuecomment-4826254157

   > Additionally, I encountered a problem in the testing phase, so I created an independent PR(#11814) to fix it.
   
   Good catch, thanks for your hard work!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "whua3 (via GitHub)" <gi...@apache.org>.
whua3 commented on code in PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#discussion_r3487753231


##########
docs/fileset-catalog-with-cos.md:
##########
@@ -0,0 +1,548 @@
+---
+title: "Fileset Catalog with COS"
+slug: "/fileset-catalog-with-cos"
+date: 2026-06-17
+keyword: "Fileset catalog COS Tencent"
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Introduction
+
+This document explains how to configure a Fileset catalog with Tencent Cloud COS (Cloud Object Storage) in Gravitino.
+
+## Prerequisites
+
+To set up a Fileset catalog with COS, follow these steps:
+
+1. Download the [`gravitino-tencent-bundle-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-tencent-bundle) file.
+2. Place the downloaded file into the Gravitino Fileset catalog classpath at `${GRAVITINO_HOME}/catalogs/fileset/libs/`.
+3. Start the Gravitino server by running the following command:
+
+```bash
+$ ${GRAVITINO_HOME}/bin/gravitino-server.sh start
+```
+
+Once the server is up and running, you can proceed to configure the Fileset catalog with COS. In the rest of this document we will use `http://localhost:8090` as the Gravitino server URL, replace with your actual server URL.
+
+## COS Catalog Configuration
+
+### COS Fileset Catalog Configuration
+
+In addition to the basic configurations mentioned in [Fileset-catalog-catalog-configuration](./fileset-catalog.md#catalog-properties), the following properties are required to configure a Fileset catalog with COS:
+
+| Configuration item            | Description                                                                                                                                                                                                                                                                                                                                                | Default value | Required | Since version |
+|-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------|---------------|
+| `cos-region`                  | The region of the Tencent Cloud COS bucket, e.g. `ap-guangzhou`, `ap-shanghai`.                                                                                                                                                                                                                                                                            | (none)        | Yes      | 1.4.0         |
+| `cos-endpoint`                | The endpoint *suffix* of the Tencent Cloud COS service (mapped to `fs.cosn.bucket.endpoint_suffix`). It is a host suffix, not a full URL — e.g. `cos.ap-guangzhou.myqcloud.com`, **not** `https://cos.ap-guangzhou.myqcloud.com`. Optional; when not set, hadoop-cos derives it from `cos-region` (`cos.${region}.myqcloud.com`). Set this only if you need to point to a non-public endpoint (e.g. an internal/VPC endpoint).                                                                                                                | (none)        | No       | 1.4.0         |
+| `cos-access-key-id`           | The static access key ID (Tencent Cloud `SecretId`) used to access COS data.                                                                                                                                                                                                                                                                               | (none)        | Yes      | 1.4.0         |
+| `cos-secret-access-key`       | The static secret access key (Tencent Cloud `SecretKey`) used to access COS data.                                                                                                                                                                                                                                                                          | (none)        | Yes      | 1.4.0         |
+| `credential-providers`        | The credential provider types, separated by comma. The currently supported value is `cos-secret-key`. Setting this enables credential vending provided by the Gravitino server, so the GVFS client no longer needs `cos-access-key-id` / `cos-secret-access-key` locally. See [cos-credential-vending](#fileset-with-credential-vending) below for details. | (none)        | No       | 1.4.0         |
+
+:::note
+The fileset catalog automatically loads filesystem providers on the classpath. The COS provider is registered when the `gravitino-tencent-bundle` jar is present, so `default-filesystem-provider` and `filesystem-providers` do not need to be set.
+:::
+
+:::note
+`cos-region` is mandatory for hadoop-cos: signing requests, building the default endpoint and selecting the right CAM scope all require the region. Even if you also set `cos-endpoint`, please keep `cos-region` set.
+:::
+
+### Schema Configuration
+
+To create a schema, refer to [Schema configurations](./fileset-catalog.md#schema-properties).
+
+### Fileset Configuration
+
+For instructions on how to create a fileset, refer to [Fileset configurations](./fileset-catalog.md#fileset-properties) for more details.
+
+## Create the Catalog, Schema, and Fileset
+
+This section will show you how to use the Fileset catalog with COS in Gravitino, including detailed examples.
+
+### Step 1: Create a Fileset Catalog with COS
+
+First, you need to create a Fileset catalog for COS. The following examples demonstrate how to create a Fileset catalog with COS:
+
+<Tabs groupId="language" queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "test_catalog",
+  "type": "FILESET",
+  "comment": "This is a COS fileset catalog",
+  "properties": {
+    "location": "cosn://my-bucket-1250000000/root",
+    "cos-region": "ap-guangzhou",
+    "cos-access-key-id": "access_key",
+    "cos-secret-access-key": "secret_key"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient gravitinoClient = GravitinoClient
+    .builder("http://localhost:8090")
+    .withMetalake("metalake")
+    .build();
+
+Map<String, String> cosProperties = ImmutableMap.<String, String>builder()
+    .put("location", "cosn://my-bucket-1250000000/root")
+    .put("cos-region", "ap-guangzhou")
+    .put("cos-access-key-id", "access_key")
+    .put("cos-secret-access-key", "secret_key")
+    .build();
+
+Catalog cosCatalog = gravitinoClient.createCatalog("test_catalog",
+    Type.FILESET,
+    "This is a COS fileset catalog",
+    cosProperties);
+// ...
+
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="metalake")
+cos_properties = {
+    "location": "cosn://my-bucket-1250000000/root",
+    "cos-region": "ap-guangzhou",
+    "cos-access-key-id": "access_key",
+    "cos-secret-access-key": "secret_key"
+}
+
+cos_catalog = gravitino_client.create_catalog(name="test_catalog",
+                                              catalog_type=Catalog.Type.FILESET,
+                                              provider=None,
+                                              comment="This is a COS fileset catalog",
+                                              properties=cos_properties)
+```
+
+</TabItem>
+</Tabs>
+
+:::note
+Tencent Cloud COS bucket names always end with the appid suffix, for example `my-bucket-1250000000`. Use that full bucket name in `location` and in any `cosn://` URI.
+:::
+
+### Step 2: Create a Schema
+
+Once the Fileset catalog with COS is created, you can create a schema inside that catalog. Below are examples of how to do this:
+
+<Tabs groupId="language" queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "test_schema",
+  "comment": "This is a COS schema",
+  "properties": {
+    "location": "cosn://my-bucket-1250000000/root/schema"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs/test_catalog/schemas
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+Catalog catalog = gravitinoClient.loadCatalog("test_catalog");
+
+SupportsSchemas supportsSchemas = catalog.asSchemas();
+
+Map<String, String> schemaProperties = ImmutableMap.<String, String>builder()
+    .put("location", "cosn://my-bucket-1250000000/root/schema")
+    .build();
+Schema schema = supportsSchemas.createSchema("test_schema",
+    "This is a COS schema",
+    schemaProperties
+);
+// ...
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="metalake")
+catalog: Catalog = gravitino_client.load_catalog(name="test_catalog")
+catalog.as_schemas().create_schema(name="test_schema",
+                                   comment="This is a COS schema",
+                                   properties={"location": "cosn://my-bucket-1250000000/root/schema"})
+```
+
+</TabItem>
+</Tabs>
+
+
+### Step 3: Create a Fileset
+
+Now that the schema is created, you can create a fileset inside it. Here's how:
+
+<Tabs groupId="language" queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "name": "example_fileset",
+  "comment": "This is an example fileset",
+  "type": "MANAGED",
+  "storageLocation": "cosn://my-bucket-1250000000/root/schema/example_fileset",
+  "properties": {
+    "k1": "v1"
+  }
+}' http://localhost:8090/api/metalakes/metalake/catalogs/test_catalog/schemas/test_schema/filesets
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+GravitinoClient gravitinoClient = GravitinoClient
+    .builder("http://localhost:8090")
+    .withMetalake("metalake")
+    .build();
+
+Catalog catalog = gravitinoClient.loadCatalog("test_catalog");
+FilesetCatalog filesetCatalog = catalog.asFilesetCatalog();
+
+Map<String, String> propertiesMap = ImmutableMap.<String, String>builder()
+        .put("k1", "v1")
+        .build();
+
+filesetCatalog.createFileset(
+    NameIdentifier.of("test_schema", "example_fileset"),
+    "This is an example fileset",
+    Fileset.Type.MANAGED,
+    "cosn://my-bucket-1250000000/root/schema/example_fileset",
+    propertiesMap,
+);
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+gravitino_client: GravitinoClient = GravitinoClient(uri="http://localhost:8090", metalake_name="metalake")
+
+catalog: Catalog = gravitino_client.load_catalog(name="test_catalog")
+catalog.as_fileset_catalog().create_fileset(ident=NameIdentifier.of("test_schema", "example_fileset"),
+                                            type=Fileset.Type.MANAGED,
+                                            comment="This is an example fileset",
+                                            storage_location="cosn://my-bucket-1250000000/root/schema/example_fileset",
+                                            properties={"k1": "v1"})
+```
+
+</TabItem>
+</Tabs>
+
+## Access a Fileset with COS
+
+### Access the Fileset with the GVFS Java Client
+
+To access fileset with COS using the GVFS Java client, based on the [basic GVFS configurations](./how-to-use-gvfs.md#configuration-1), you need to add the following configurations:
+
+| Configuration item      | Description                                                  | Default value | Required | Since version |
+|-------------------------|--------------------------------------------------------------|---------------|----------|---------------|
+| `cos-region`            | The region of the Tencent Cloud COS bucket.                  | (none)        | Yes      | 1.4.0         |
+| `cos-endpoint`          | The endpoint *suffix* of the Tencent Cloud COS service (e.g. `cos.ap-guangzhou.myqcloud.com`, not a full URL). Optional. | (none)        | No       | 1.4.0         |
+| `cos-access-key-id`     | The access key ID (Tencent Cloud SecretId) for COS data.     | (none)        | Yes      | 1.4.0         |
+| `cos-secret-access-key` | The secret access key (Tencent Cloud SecretKey) for COS data.| (none)        | Yes      | 1.4.0         |
+
+:::note
+If the catalog has enabled [credential vending](security/credential-vending.md), the AK/SK properties above can be omitted. More details can be found in [Fileset with credential vending](#fileset-with-credential-vending).
+:::
+
+```java
+Configuration conf = new Configuration();
+conf.set("fs.AbstractFileSystem.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.Gvfs");
+conf.set("fs.gvfs.impl", "org.apache.gravitino.filesystem.hadoop.GravitinoVirtualFileSystem");
+conf.set("fs.gravitino.server.uri", "http://localhost:8090");
+conf.set("fs.gravitino.client.metalake", "test_metalake");
+conf.set("cos-region", "ap-guangzhou");
+conf.set("cos-access-key-id", "access_key");
+conf.set("cos-secret-access-key", "secret_key");
+Path filesetPath = new Path("gvfs://fileset/test_catalog/test_schema/test_fileset/new_dir");
+FileSystem fs = filesetPath.getFileSystem(conf);
+fs.mkdirs(filesetPath);
+...
+```
+
+Similar to Spark configurations, you need to add COS (bundle) jars to the classpath according to your environment.
+If you want to customise your hadoop version or there is already a hadoop version in your project, you can add the following dependencies to your `pom.xml`:
+
+```xml
+  <dependency>
+    <groupId>org.apache.hadoop</groupId>
+    <artifactId>hadoop-common</artifactId>
+    <version>${HADOOP_VERSION}</version>
+  </dependency>
+
+  <!-- hadoop-cos is published by Tencent Cloud, not by Apache Hadoop. -->
+  <dependency>
+    <groupId>com.qcloud.cos</groupId>
+    <artifactId>hadoop-cos</artifactId>
+    <version>3.3.0-8.3.23</version>
+  </dependency>
+
+  <dependency>
+    <groupId>org.apache.gravitino</groupId>
+    <artifactId>gravitino-filesystem-hadoop3-runtime</artifactId>
+    <version>${GRAVITINO_VERSION}</version>
+  </dependency>
+```
+
+:::note
+Unlike the S3, OSS, GCS and Azure connectors, COS does **not** ship with Apache Hadoop. The HCFS adapter for COS is published by Tencent Cloud as `com.qcloud.cos:hadoop-cos`. Make sure the version you pick is compatible with your Hadoop version (the `<hadoop>-<sdk>` form encodes both, e.g. `3.3.0-8.3.23` targets Hadoop 3.3.0).
+:::
+
+:::note
+Since version 1.4.0, the `gravitino-tencent` JAR is no longer required separately, as it is included in the `gravitino-filesystem-hadoop3-runtime` JAR.
+:::

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "whua3 (via GitHub)" <gi...@apache.org>.
whua3 commented on code in PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#discussion_r3487752990


##########
docs/fileset-catalog-with-cos.md:
##########
@@ -0,0 +1,548 @@
+---
+title: "Fileset Catalog with COS"
+slug: "/fileset-catalog-with-cos"
+date: 2026-06-17
+keyword: "Fileset catalog COS Tencent"
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Introduction
+
+This document explains how to configure a Fileset catalog with Tencent Cloud COS (Cloud Object Storage) in Gravitino.
+
+## Prerequisites
+
+To set up a Fileset catalog with COS, follow these steps:
+
+1. Download the [`gravitino-tencent-bundle-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-tencent-bundle) file.
+2. Place the downloaded file into the Gravitino Fileset catalog classpath at `${GRAVITINO_HOME}/catalogs/fileset/libs/`.
+3. Start the Gravitino server by running the following command:
+
+```bash
+$ ${GRAVITINO_HOME}/bin/gravitino-server.sh start
+```
+
+Once the server is up and running, you can proceed to configure the Fileset catalog with COS. In the rest of this document we will use `http://localhost:8090` as the Gravitino server URL, replace with your actual server URL.
+
+## COS Catalog Configuration
+
+### COS Fileset Catalog Configuration
+
+In addition to the basic configurations mentioned in [Fileset-catalog-catalog-configuration](./fileset-catalog.md#catalog-properties), the following properties are required to configure a Fileset catalog with COS:
+
+| Configuration item            | Description                                                                                                                                                                                                                                                                                                                                                | Default value | Required | Since version |
+|-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------|---------------|
+| `cos-region`                  | The region of the Tencent Cloud COS bucket, e.g. `ap-guangzhou`, `ap-shanghai`.                                                                                                                                                                                                                                                                            | (none)        | Yes      | 1.4.0         |
+| `cos-endpoint`                | The endpoint *suffix* of the Tencent Cloud COS service (mapped to `fs.cosn.bucket.endpoint_suffix`). It is a host suffix, not a full URL — e.g. `cos.ap-guangzhou.myqcloud.com`, **not** `https://cos.ap-guangzhou.myqcloud.com`. Optional; when not set, hadoop-cos derives it from `cos-region` (`cos.${region}.myqcloud.com`). Set this only if you need to point to a non-public endpoint (e.g. an internal/VPC endpoint).                                                                                                                | (none)        | No       | 1.4.0         |
+| `cos-access-key-id`           | The static access key ID (Tencent Cloud `SecretId`) used to access COS data.                                                                                                                                                                                                                                                                               | (none)        | Yes      | 1.4.0         |
+| `cos-secret-access-key`       | The static secret access key (Tencent Cloud `SecretKey`) used to access COS data.                                                                                                                                                                                                                                                                          | (none)        | Yes      | 1.4.0         |
+| `credential-providers`        | The credential provider types, separated by comma. The currently supported value is `cos-secret-key`. Setting this enables credential vending provided by the Gravitino server, so the GVFS client no longer needs `cos-access-key-id` / `cos-secret-access-key` locally. See [cos-credential-vending](#fileset-with-credential-vending) below for details. | (none)        | No       | 1.4.0         |
+
+:::note
+The fileset catalog automatically loads filesystem providers on the classpath. The COS provider is registered when the `gravitino-tencent-bundle` jar is present, so `default-filesystem-provider` and `filesystem-providers` do not need to be set.
+:::
+
+:::note
+`cos-region` is mandatory for hadoop-cos: signing requests, building the default endpoint and selecting the right CAM scope all require the region. Even if you also set `cos-endpoint`, please keep `cos-region` set.

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "whua3 (via GitHub)" <gi...@apache.org>.
whua3 commented on code in PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#discussion_r3437231001


##########
catalogs/hadoop-common/src/main/java/org/apache/gravitino/catalog/hadoop/fs/Constants.java:
##########
@@ -67,6 +67,10 @@ public class Constants {
   public static final String OSS_ESTABLISH_TIMEOUT_KEY = "fs.oss.connection.establish.timeout";
   public static final String OSS_MAX_ERROR_RETRIES_KEY = "fs.oss.attempts.maximum";
 
+  // Tencent Cloud COS (hadoop-cos / CosNFileSystem) specific configuration keys
+  public static final String COS_CONNECTION_TIMEOUT_KEY = "fs.cosn.connection.timeout";

Review Comment:
   
   Thanks for the careful review. I just verified against `hadoop-cos:3.3.0-8.3.23` by decompiling `CosNConfigKeys.class` from the published Maven Central artifact. Both keys are real:
   
   - `fs.cosn.connection.timeout` → `CosNConfigKeys.COSN_CONNECTION_TIMEOUT`. Upstream default is `10000` ms.
   - `fs.cosn.maxRetries` → `CosNConfigKeys.COSN_MAX_RETRIES_KEY`. Upstream default is `200`.
   
   So the defaults injected by `additionalCOSConfig` are **not** silently ignored.
   
   Regarding *"prefer referencing `CosNConfigKeys.*` constants over hardcoded literals"* — I followed the existing convention used by `S3FileSystemProvider`, `OSSFileSystemProvider` and `GCSFileSystemProvider`: each defines its cloud-specific keys as **string literals** in `hadoop-common/Constants.java`, so `hadoop-common` does not depend on any cloud-vendor SDK. Switching just COS to use `CosNConfigKeys.*` would break that consistency.
   
   I added Javadoc to the COS keys in `Constants.java` cross-referencing the corresponding `CosNConfigKeys` constants and their upstream defaults, to make the mapping easy to verify going forward.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "whua3 (via GitHub)" <gi...@apache.org>.
whua3 commented on PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#issuecomment-4744279556

   Pushed an updated commit addressing all review comments.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "whua3 (via GitHub)" <gi...@apache.org>.
whua3 commented on code in PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#discussion_r3437380173


##########
bundles/tencent/src/main/java/org/apache/gravitino/cos/fs/COSCredentialsProvider.java:
##########
@@ -0,0 +1,84 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.gravitino.cos.fs;
+
+import com.qcloud.cos.auth.BasicCOSCredentials;
+import com.qcloud.cos.auth.COSCredentials;
+import java.net.URI;
+import org.apache.gravitino.catalog.hadoop.fs.FileSystemUtils;
+import org.apache.gravitino.catalog.hadoop.fs.GravitinoFileSystemCredentialsProvider;
+import org.apache.gravitino.credential.COSSecretKeyCredential;
+import org.apache.gravitino.credential.Credential;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.auth.AbstractCOSCredentialProvider;
+
+/**
+ * Hadoop-COS credential provider that pulls vended credentials out of Gravitino and feeds them to
+ * the underlying {@code com.qcloud.cos.auth.COSCredentialsProvider} contract. PR-A only handles
+ * static secret-key credentials; STS / token credentials will be added by a follow-up PR.
+ */
+public class COSCredentialsProvider extends AbstractCOSCredentialProvider {
+
+  private final GravitinoFileSystemCredentialsProvider gravitinoFileSystemCredentialsProvider;
+  private volatile COSCredentials basicCredentials;
+  private volatile long expirationTime = Long.MAX_VALUE;
+  private static final double EXPIRATION_TIME_FACTOR = 0.5D;
+
+  public COSCredentialsProvider(URI uri, Configuration conf) {
+    super(uri, conf);
+    this.gravitinoFileSystemCredentialsProvider = FileSystemUtils.getGvfsCredentialProvider(conf);
+  }
+
+  @Override
+  public COSCredentials getCredentials() {
+    if (basicCredentials == null || System.currentTimeMillis() >= expirationTime) {
+      synchronized (this) {
+        if (basicCredentials == null || System.currentTimeMillis() >= expirationTime) {
+          refresh();
+        }
+      }
+    }
+    return basicCredentials;
+  }
+
+  @Override
+  public void refresh() {
+    Credential[] gravitinoCredentials = gravitinoFileSystemCredentialsProvider.getCredentials();
+    Credential credential = COSUtils.getSuitableCredential(gravitinoCredentials);
+    if (credential == null) {
+      throw new RuntimeException("No suitable credential for COS found...");
+    }
+
+    if (credential instanceof COSSecretKeyCredential) {

Review Comment:
   ok



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#6490] feat(fileset): Add Tencent COS support for fileset catalog [gravitino]

Posted by "whua3 (via GitHub)" <gi...@apache.org>.
whua3 commented on code in PR #11713:
URL: https://github.com/apache/gravitino/pull/11713#discussion_r3437458104


##########
docs/fileset-catalog-with-cos.md:
##########
@@ -0,0 +1,548 @@
+---
+title: "Fileset Catalog with COS"
+slug: "/fileset-catalog-with-cos"
+date: 2026-06-17
+keyword: "Fileset catalog COS Tencent"
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Introduction
+
+This document explains how to configure a Fileset catalog with Tencent Cloud COS (Cloud Object Storage) in Gravitino.
+
+## Prerequisites
+
+To set up a Fileset catalog with COS, follow these steps:
+
+1. Download the [`gravitino-tencent-bundle-${gravitino-version}.jar`](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-tencent-bundle) file.
+2. Place the downloaded file into the Gravitino Fileset catalog classpath at `${GRAVITINO_HOME}/catalogs/fileset/libs/`.
+3. Start the Gravitino server by running the following command:
+
+```bash
+$ ${GRAVITINO_HOME}/bin/gravitino-server.sh start
+```
+
+Once the server is up and running, you can proceed to configure the Fileset catalog with COS. In the rest of this document we will use `http://localhost:8090` as the Gravitino server URL, replace with your actual server URL.
+
+## COS Catalog Configuration
+
+### COS Fileset Catalog Configuration
+
+In addition to the basic configurations mentioned in [Fileset-catalog-catalog-configuration](./fileset-catalog.md#catalog-properties), the following properties are required to configure a Fileset catalog with COS:
+
+| Configuration item            | Description                                                                                                                                                                                                                                                                                                                                                | Default value | Required | Since version |
+|-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------|---------------|
+| `cos-region`                  | The region of the Tencent Cloud COS bucket, e.g. `ap-guangzhou`, `ap-shanghai`.                                                                                                                                                                                                                                                                            | (none)        | Yes      | 1.3.0         |
+| `cos-endpoint`                | The endpoint of the Tencent Cloud COS service. Optional; when not set, hadoop-cos derives it from `cos-region` (`cos.${region}.myqcloud.com`). Set this only if you need to point to a non-public endpoint (e.g. an internal/VPC endpoint).                                                                                                                | (none)        | No       | 1.3.0         |

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org