diff --git a/clients/cli/src/main/java/org/apache/gravitino/cli/Providers.java b/clients/cli/src/main/java/org/apache/gravitino/cli/Providers.java index 78b57ff61b7..46f875c11b9 100644 --- a/clients/cli/src/main/java/org/apache/gravitino/cli/Providers.java +++ b/clients/cli/src/main/java/org/apache/gravitino/cli/Providers.java @@ -33,6 +33,10 @@ public class Providers { public static final String MYSQL = "mysql"; public static final String POSTGRES = "postgres"; public static final String KAFKA = "kafka"; + public static final String DORIS = "doris"; + public static final String PAIMON = "paimon"; + public static final String HUDI = "hudi"; + public static final String OCEANBASE = "oceanbase"; private static final HashSet VALID_PROVIDERS = new HashSet<>(); @@ -43,6 +47,10 @@ public class Providers { VALID_PROVIDERS.add(MYSQL); VALID_PROVIDERS.add(POSTGRES); VALID_PROVIDERS.add(KAFKA); + VALID_PROVIDERS.add(DORIS); + VALID_PROVIDERS.add(PAIMON); + VALID_PROVIDERS.add(HUDI); + VALID_PROVIDERS.add(OCEANBASE); } /** @@ -69,6 +77,14 @@ public static String internal(String provider) { return "lakehouse-iceberg"; case KAFKA: return "kafka"; + case DORIS: + return "jdbc-doris"; + case PAIMON: + return "lakehouse-paimon"; + case HUDI: + return "lakehouse-hudi"; + case OCEANBASE: + return "jdbc-oceanbase"; default: throw new IllegalArgumentException("Unsupported provider: " + provider); } @@ -82,6 +98,10 @@ public static Catalog.Type catalogType(String provider) { case MYSQL: case POSTGRES: case ICEBERG: + case DORIS: + case PAIMON: + case HUDI: + case OCEANBASE: return Catalog.Type.RELATIONAL; case KAFKA: return Catalog.Type.MESSAGING; diff --git a/clients/cli/src/test/java/org/apache/gravitino/cli/TestProviders.java b/clients/cli/src/test/java/org/apache/gravitino/cli/TestProviders.java index 403e45883b6..c7302e28843 100644 --- a/clients/cli/src/test/java/org/apache/gravitino/cli/TestProviders.java +++ b/clients/cli/src/test/java/org/apache/gravitino/cli/TestProviders.java @@ -36,6 +36,11 @@ public void validProviders() { assertTrue(Providers.isValidProvider(Providers.MYSQL), "MYSQL should be a valid entity"); assertTrue(Providers.isValidProvider(Providers.POSTGRES), "POSTGRES should be a valid entity"); assertTrue(Providers.isValidProvider(Providers.KAFKA), "KAFKA should be a valid entity"); + assertTrue(Providers.isValidProvider(Providers.DORIS), "DORIS should be a valid entity"); + assertTrue(Providers.isValidProvider(Providers.PAIMON), "PAIMON should be a valid entity"); + assertTrue(Providers.isValidProvider(Providers.HUDI), "HUDI should be a valid entity"); + assertTrue( + Providers.isValidProvider(Providers.OCEANBASE), "OCEANBASE should be a valid entity"); } @Test @@ -70,6 +75,10 @@ public void internalNotNull() { assertNotNull(Providers.internal(Providers.MYSQL), "Internal string should not be null"); assertNotNull(Providers.internal(Providers.POSTGRES), "Internal string should not be null"); assertNotNull(Providers.internal(Providers.KAFKA), "Internal string should not be null"); + assertNotNull(Providers.internal(Providers.DORIS), "Internal string should not be null"); + assertNotNull(Providers.internal(Providers.PAIMON), "Internal string should not be null"); + assertNotNull(Providers.internal(Providers.HUDI), "Internal string should not be null"); + assertNotNull(Providers.internal(Providers.OCEANBASE), "Internal string should not be null"); } @Test @@ -88,6 +97,10 @@ public void catalogTypeNotNull() { assertNotNull(Providers.catalogType(Providers.MYSQL), "Catalog type should not be null"); assertNotNull(Providers.catalogType(Providers.POSTGRES), "Catalog type should not be null"); assertNotNull(Providers.catalogType(Providers.KAFKA), "Catalog type should not be null"); + assertNotNull(Providers.catalogType(Providers.DORIS), "Catalog type should not be null"); + assertNotNull(Providers.catalogType(Providers.PAIMON), "Catalog type should not be null"); + assertNotNull(Providers.catalogType(Providers.HUDI), "Catalog type should not be null"); + assertNotNull(Providers.catalogType(Providers.OCEANBASE), "Catalog type should not be null"); } @Test diff --git a/docs/cli.md b/docs/cli.md index c0e86886960..825267b50a1 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -296,6 +296,30 @@ gcli catalog create -name postgres --provider postgres --properties jdbc-url=jd gcli catalog create --name kafka --provider kafka --properties bootstrap.servers=127.0.0.1:9092,127.0.0.2:9092 ``` +##### Create a Doris catalog + +```bash +gcli catalog create --name doris --provider doris --properties jdbc-url=jdbc:mysql://localhost:9030,jdbc-driver=com.mysql.jdbc.Driver,jdbc-user=admin,jdbc-password=password +``` + +##### Create a Paimon catalog + +```bash +gcli catalog create --name paimon --provider paimon --properties catalog-backend=jdbc,uri=jdbc:mysql://127.0.0.1:3306/metastore_db,authentication.type=simple +``` + +#### Create a Hudi catalog + +```bash +gcli catalog create --name hudi --provider hudi --properties catalog-backend=hms,uri=thrift://127.0.0.1:9083 +``` + +#### Create an Oceanbase catalog + +```bash +gcli catalog create --name oceanbase --provider oceanbase --properties jdbc-url=jdbc:mysql://localhost:2881,jdbc-driver=com.mysql.jdbc.Driver,jdbc-user=admin,jdbc-password=password +``` + #### Delete a catalog ```bash