This is an automated email from the ASF dual-hosted git repository.

jshao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/main by this push:
     new 315cb214a [#4679] feat(hudi-catalog): Add code skeleton for hudi 
catalog (#4746)
315cb214a is described below

commit 315cb214aa3384faf1d03ee85c6a59ef151cc05a
Author: mchades <[email protected]>
AuthorDate: Thu Sep 5 05:08:42 2024 +0800

    [#4679] feat(hudi-catalog): Add code skeleton for hudi catalog (#4746)
    
    ### What changes were proposed in this pull request?
    
     - add lakehouse-hudi-catalog module
     - add code skeleton for hudi catalog
    
    ### Why are the changes needed?
    
    Fix: #4679
    
    ### Does this PR introduce _any_ user-facing change?
    
    no
    
    ### How was this patch tested?
    
    build pass. tests will be added in implementation PRs
---
 catalogs/catalog-lakehouse-hudi/build.gradle.kts   |  41 ++++
 .../catalog/lakehouse/hudi/HudiCatalog.java        |  69 ++++++
 .../lakehouse/hudi/HudiCatalogOperations.java      | 258 +++++++++++++++++++++
 .../hudi/HudiCatalogPropertiesMetadata.java        |  31 +++
 .../catalog/lakehouse/hudi/HudiSchema.java         |  85 +++++++
 .../hudi/HudiSchemaPropertiesMetadata.java         |  31 +++
 .../catalog/lakehouse/hudi/HudiTable.java          |  72 ++++++
 .../hudi/HudiTablePropertiesMetadata.java          |  31 +++
 .../lakehouse/hudi/backend/BackendType.java        |  23 ++
 .../lakehouse/hudi/backend/HudiCatalogBackend.java |  45 ++++
 .../lakehouse/hudi/backend/hms/HudiHMSBackend.java |  43 ++++
 .../hudi/backend/hms/HudiHMSBackendOps.java        | 113 +++++++++
 .../lakehouse/hudi/backend/hms/HudiHMSSchema.java  |  57 +++++
 .../lakehouse/hudi/backend/hms/HudiHMSTable.java   |  59 +++++
 .../lakehouse/hudi/ops/HudiCatalogBackendOps.java  |  97 ++++++++
 .../catalog/lakehouse/hudi/utils/CatalogUtils.java |  34 +++
 .../services/org.apache.gravitino.CatalogProvider  |  19 ++
 gradle/libs.versions.toml                          |   2 +
 settings.gradle.kts                                |   1 +
 19 files changed, 1111 insertions(+)

diff --git a/catalogs/catalog-lakehouse-hudi/build.gradle.kts 
b/catalogs/catalog-lakehouse-hudi/build.gradle.kts
new file mode 100644
index 000000000..78ff2f8b1
--- /dev/null
+++ b/catalogs/catalog-lakehouse-hudi/build.gradle.kts
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+description = "catalog-lakehouse-iceberg"
+
+plugins {
+  `maven-publish`
+  id("java")
+  id("idea")
+}
+
+dependencies {
+  implementation(project(":api")) {
+    exclude(group = "*")
+  }
+  implementation(project(":core")) {
+    exclude(group = "*")
+  }
+
+  implementation(libs.guava)
+  implementation(libs.hive2.metastore) {
+    exclude("*")
+  }
+  implementation(libs.slf4j.api)
+  implementation(libs.thrift)
+}
diff --git 
a/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiCatalog.java
 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiCatalog.java
new file mode 100644
index 000000000..f2146f36d
--- /dev/null
+++ 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiCatalog.java
@@ -0,0 +1,69 @@
+/*
+ * 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.lakehouse.hudi;
+
+import java.util.Map;
+import org.apache.gravitino.connector.BaseCatalog;
+import org.apache.gravitino.connector.CatalogOperations;
+import org.apache.gravitino.connector.PropertiesMetadata;
+
+/** Implementation of an Apache Hudi catalog in Apache Gravitino. */
+public class HudiCatalog extends BaseCatalog<HudiCatalog> {
+
+  static final HudiCatalogPropertiesMetadata CATALOG_PROPERTIES_METADATA =
+      new HudiCatalogPropertiesMetadata();
+
+  static final HudiSchemaPropertiesMetadata SCHEMA_PROPERTIES_METADATA =
+      new HudiSchemaPropertiesMetadata();
+
+  static final HudiTablePropertiesMetadata TABLE_PROPERTIES_METADATA =
+      new HudiTablePropertiesMetadata();
+
+  /** @return The short name of the catalog. */
+  @Override
+  public String shortName() {
+    return "lakehouse-hudi";
+  }
+
+  /**
+   * Creates a new instance of {@link HudiCatalogOperations} with the provided 
configuration.
+   *
+   * @param config The configuration parameters for creating CatalogOperations.
+   * @return A new instance of {@link HudiCatalogOperations}.
+   */
+  @Override
+  protected CatalogOperations newOps(Map<String, String> config) {
+    return new HudiCatalogOperations();
+  }
+
+  @Override
+  public PropertiesMetadata catalogPropertiesMetadata() throws 
UnsupportedOperationException {
+    return CATALOG_PROPERTIES_METADATA;
+  }
+
+  @Override
+  public PropertiesMetadata schemaPropertiesMetadata() throws 
UnsupportedOperationException {
+    return SCHEMA_PROPERTIES_METADATA;
+  }
+
+  @Override
+  public PropertiesMetadata tablePropertiesMetadata() throws 
UnsupportedOperationException {
+    return TABLE_PROPERTIES_METADATA;
+  }
+}
diff --git 
a/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiCatalogOperations.java
 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiCatalogOperations.java
new file mode 100644
index 000000000..d242cfeef
--- /dev/null
+++ 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiCatalogOperations.java
@@ -0,0 +1,258 @@
+/*
+ * 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.lakehouse.hudi;
+
+import java.util.Map;
+import org.apache.gravitino.Catalog;
+import org.apache.gravitino.NameIdentifier;
+import org.apache.gravitino.Namespace;
+import org.apache.gravitino.Schema;
+import org.apache.gravitino.SchemaChange;
+import org.apache.gravitino.catalog.lakehouse.hudi.backend.HudiCatalogBackend;
+import org.apache.gravitino.catalog.lakehouse.hudi.ops.HudiCatalogBackendOps;
+import org.apache.gravitino.catalog.lakehouse.hudi.utils.CatalogUtils;
+import org.apache.gravitino.connector.CatalogInfo;
+import org.apache.gravitino.connector.CatalogOperations;
+import org.apache.gravitino.connector.HasPropertyMetadata;
+import org.apache.gravitino.connector.SupportsSchemas;
+import org.apache.gravitino.exceptions.ConnectionFailedException;
+import org.apache.gravitino.exceptions.NoSuchCatalogException;
+import org.apache.gravitino.exceptions.NoSuchSchemaException;
+import org.apache.gravitino.exceptions.NoSuchTableException;
+import org.apache.gravitino.exceptions.NonEmptySchemaException;
+import org.apache.gravitino.exceptions.SchemaAlreadyExistsException;
+import org.apache.gravitino.exceptions.TableAlreadyExistsException;
+import org.apache.gravitino.rel.Column;
+import org.apache.gravitino.rel.Table;
+import org.apache.gravitino.rel.TableCatalog;
+import org.apache.gravitino.rel.TableChange;
+import org.apache.gravitino.rel.expressions.distributions.Distribution;
+import org.apache.gravitino.rel.expressions.sorts.SortOrder;
+import org.apache.gravitino.rel.expressions.transforms.Transform;
+import org.apache.gravitino.rel.indexes.Index;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/** Operations for Interacting with Hudi Catalog. */
+public class HudiCatalogOperations implements CatalogOperations, 
SupportsSchemas, TableCatalog {
+
+  private static final Logger LOG = 
LoggerFactory.getLogger(HudiCatalogOperations.class);
+
+  private HudiCatalogBackendOps hudiCatalogBackendOps;
+
+  /**
+   * Load the Hudi Catalog Backend and initialize the Hudi Catalog Operations.
+   *
+   * @param config The configuration of this Catalog.
+   * @param info The information of this Catalog.
+   * @param propertiesMetadata The properties metadata of this Catalog.
+   * @throws RuntimeException if failed to initialize the Hudi Catalog 
Operations.
+   */
+  @Override
+  public void initialize(
+      Map<String, String> config, CatalogInfo info, HasPropertyMetadata 
propertiesMetadata)
+      throws RuntimeException {
+    HudiCatalogBackend hudiCatalogBackend = 
CatalogUtils.loadHudiCatalogBackend(config);
+    hudiCatalogBackendOps = hudiCatalogBackend.catalogOps();
+  }
+
+  /**
+   * Performs `listSchemas` operation on the Hudi Catalog to test the catalog 
connection.
+   *
+   * @param catalogIdent the name of the catalog.
+   * @param type the type of the catalog.
+   * @param provider the provider of the catalog.
+   * @param comment the comment of the catalog.
+   * @param properties the properties of the catalog.
+   * @throws Exception if failed to run `listSchemas` operation on the Hudi 
Catalog.
+   */
+  @Override
+  public void testConnection(
+      NameIdentifier catalogIdent,
+      Catalog.Type type,
+      String provider,
+      String comment,
+      Map<String, String> properties)
+      throws Exception {
+    try {
+      hudiCatalogBackendOps.listSchemas(null);
+    } catch (Exception e) {
+      throw new ConnectionFailedException(
+          e, "Failed to run listSchemas on Hudi catalog: %s", e.getMessage());
+    }
+  }
+
+  @Override
+  public void close() {
+    if (hudiCatalogBackendOps != null) {
+      try {
+        hudiCatalogBackendOps.close();
+      } catch (Exception e) {
+        LOG.warn("Failed to close Hudi catalog", e);
+      }
+    }
+  }
+
+  /**
+   * List the schemas in the Hudi Catalog.
+   *
+   * @param namespace The namespace to list.
+   * @return The list of schemas in the Hudi Catalog.
+   * @throws NoSuchCatalogException if the catalog does not exist.
+   */
+  @Override
+  public NameIdentifier[] listSchemas(Namespace namespace) throws 
NoSuchCatalogException {
+    return hudiCatalogBackendOps.listSchemas(namespace);
+  }
+
+  /**
+   * Create a schema in the Hudi Catalog.
+   *
+   * @param ident The name identifier of the schema.
+   * @param comment The comment of the schema.
+   * @param properties The properties of the schema.
+   * @return The created schema.
+   * @throws NoSuchCatalogException if the catalog does not exist.
+   * @throws SchemaAlreadyExistsException if the schema already exists.
+   */
+  @Override
+  public Schema createSchema(NameIdentifier ident, String comment, Map<String, 
String> properties)
+      throws NoSuchCatalogException, SchemaAlreadyExistsException {
+    return hudiCatalogBackendOps.createSchema(ident, comment, properties);
+  }
+
+  /**
+   * Load a schema from the Hudi Catalog.
+   *
+   * @param ident The name identifier of the schema.
+   * @return The loaded schema.
+   * @throws NoSuchSchemaException if the schema does not exist.
+   */
+  @Override
+  public Schema loadSchema(NameIdentifier ident) throws NoSuchSchemaException {
+    return hudiCatalogBackendOps.loadSchema(ident);
+  }
+
+  /**
+   * Alter a schema in the Hudi Catalog.
+   *
+   * @param ident The name identifier of the schema.
+   * @param changes The metadata changes to apply.
+   * @return The altered schema.
+   * @throws NoSuchSchemaException if the schema does not exist.
+   */
+  @Override
+  public Schema alterSchema(NameIdentifier ident, SchemaChange... changes)
+      throws NoSuchSchemaException {
+    return hudiCatalogBackendOps.alterSchema(ident, changes);
+  }
+
+  /**
+   * Drop a schema in the Hudi Catalog.
+   *
+   * @param ident The name identifier of the schema.
+   * @param cascade If true, recursively drop all objects within the schema.
+   * @return True if the schema is dropped successfully, false if the schema 
does not exist.
+   * @throws NonEmptySchemaException if the schema is not empty and cascade is 
false.
+   */
+  @Override
+  public boolean dropSchema(NameIdentifier ident, boolean cascade) throws 
NonEmptySchemaException {
+    return hudiCatalogBackendOps.dropSchema(ident, cascade);
+  }
+
+  /**
+   * List tables in the Hudi Catalog.
+   *
+   * @param namespace A namespace.
+   * @return The list of tables in the Hudi Catalog.
+   * @throws NoSuchSchemaException if the schema does not exist.
+   */
+  @Override
+  public NameIdentifier[] listTables(Namespace namespace) throws 
NoSuchSchemaException {
+    return hudiCatalogBackendOps.listTables(namespace);
+  }
+
+  /**
+   * Load a table from the Hudi Catalog.
+   *
+   * @param ident A table identifier.
+   * @return The loaded table.
+   * @throws NoSuchTableException if the table does not exist.
+   */
+  @Override
+  public Table loadTable(NameIdentifier ident) throws NoSuchTableException {
+    return hudiCatalogBackendOps.loadTable(ident);
+  }
+
+  /**
+   * Create a table in the Hudi Catalog.
+   *
+   * @param ident A table identifier.
+   * @param columns The columns of the new table.
+   * @param comment The table comment.
+   * @param properties The table properties.
+   * @param partitions The table partitioning.
+   * @param distribution The distribution of the table
+   * @param sortOrders The sort orders of the table
+   * @param indexes The table indexes.
+   * @return The created table.
+   * @throws NoSuchSchemaException if the schema does not exist.
+   * @throws TableAlreadyExistsException if the table already exists.
+   */
+  @Override
+  public Table createTable(
+      NameIdentifier ident,
+      Column[] columns,
+      String comment,
+      Map<String, String> properties,
+      Transform[] partitions,
+      Distribution distribution,
+      SortOrder[] sortOrders,
+      Index[] indexes)
+      throws NoSuchSchemaException, TableAlreadyExistsException {
+    return hudiCatalogBackendOps.createTable(
+        ident, columns, comment, properties, partitions, distribution, 
sortOrders, indexes);
+  }
+
+  /**
+   * Alter a table in the Hudi Catalog.
+   *
+   * @param ident A table identifier.
+   * @param changes Table changes to apply to the table.
+   * @return The altered table.
+   * @throws NoSuchTableException if the table does not exist.
+   * @throws IllegalArgumentException if the table changes are invalid.
+   */
+  @Override
+  public Table alterTable(NameIdentifier ident, TableChange... changes)
+      throws NoSuchTableException, IllegalArgumentException {
+    return hudiCatalogBackendOps.alterTable(ident, changes);
+  }
+
+  /**
+   * Drop a table in the Hudi Catalog.
+   *
+   * @param ident A table identifier.
+   * @return True if the table is dropped successfully, false if the table 
does not exist.
+   */
+  @Override
+  public boolean dropTable(NameIdentifier ident) {
+    return hudiCatalogBackendOps.dropTable(ident);
+  }
+}
diff --git 
a/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiCatalogPropertiesMetadata.java
 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiCatalogPropertiesMetadata.java
new file mode 100644
index 000000000..8325dcc0d
--- /dev/null
+++ 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiCatalogPropertiesMetadata.java
@@ -0,0 +1,31 @@
+/*
+ * 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.lakehouse.hudi;
+
+import java.util.Collections;
+import java.util.Map;
+import org.apache.gravitino.connector.BaseCatalogPropertiesMetadata;
+import org.apache.gravitino.connector.PropertyEntry;
+
+public class HudiCatalogPropertiesMetadata extends 
BaseCatalogPropertiesMetadata {
+  @Override
+  protected Map<String, PropertyEntry<?>> specificPropertyEntries() {
+    return Collections.emptyMap();
+  }
+}
diff --git 
a/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiSchema.java
 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiSchema.java
new file mode 100644
index 000000000..391ab3579
--- /dev/null
+++ 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiSchema.java
@@ -0,0 +1,85 @@
+/*
+ * 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.lakehouse.hudi;
+
+import org.apache.gravitino.connector.BaseSchema;
+
+/**
+ * Represents a schema (database) from a Hudi catalog. Different Hudi catalog 
backends should extend
+ * this abstract class and the inner Builder class to provide the conversion 
between the backend
+ * schema and the HudiSchema.
+ *
+ * @param <DATABASE> the schema (database) type from the backend
+ */
+public abstract class HudiSchema<DATABASE> extends BaseSchema {
+  /**
+   * Converts the HudiSchema to the backend schema (database).
+   *
+   * @return the backend schema (database)
+   */
+  public abstract DATABASE fromHudiSchema();
+
+  /**
+   * Builder class for HudiSchema. The builder should be extended by the 
backend schema builder to
+   * provide the conversion between the backend schema and the HudiSchema.
+   *
+   * @param <T> the schema (database) type from the backend
+   */
+  public abstract static class Builder<T> extends 
BaseSchemaBuilder<Builder<T>, HudiSchema> {
+
+    /** The backend schema (database) to be converted to HudiSchema. */
+    T backendSchema;
+
+    /**
+     * Sets the backend schema (database) to be converted to HudiSchema.
+     *
+     * @param backendSchema the backend schema (database)
+     * @return this builder
+     */
+    public Builder<T> withBackendSchema(T backendSchema) {
+      this.backendSchema = backendSchema;
+      return this;
+    }
+
+    /**
+     * Builds the HudiSchema from the backend schema (database).
+     *
+     * @return the HudiSchema
+     */
+    @Override
+    protected HudiSchema<T> internalBuild() {
+      return backendSchema == null ? simpleBuild() : 
buildFromSchema(backendSchema);
+    }
+
+    /**
+     * Builds a simple HudiSchema without the backend schema (database).
+     *
+     * @return the HudiSchema
+     */
+    protected abstract HudiSchema<T> simpleBuild();
+
+    /**
+     * Builds the HudiSchema from the backend schema (database).
+     *
+     * @param schema the backend schema (database)
+     * @return the HudiSchema
+     */
+    protected abstract HudiSchema<T> buildFromSchema(T schema);
+  }
+}
diff --git 
a/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiSchemaPropertiesMetadata.java
 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiSchemaPropertiesMetadata.java
new file mode 100644
index 000000000..c51fad43a
--- /dev/null
+++ 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiSchemaPropertiesMetadata.java
@@ -0,0 +1,31 @@
+/*
+ * 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.lakehouse.hudi;
+
+import java.util.Collections;
+import java.util.Map;
+import org.apache.gravitino.connector.BasePropertiesMetadata;
+import org.apache.gravitino.connector.PropertyEntry;
+
+public class HudiSchemaPropertiesMetadata extends BasePropertiesMetadata {
+  @Override
+  protected Map<String, PropertyEntry<?>> specificPropertyEntries() {
+    return Collections.emptyMap();
+  }
+}
diff --git 
a/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiTable.java
 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiTable.java
new file mode 100644
index 000000000..9f28a516a
--- /dev/null
+++ 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiTable.java
@@ -0,0 +1,72 @@
+/*
+ * 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.lakehouse.hudi;
+
+import org.apache.gravitino.connector.BaseTable;
+import org.apache.gravitino.connector.TableOperations;
+
+/**
+ * Represents a table from a Hudi catalog. Different Hudi catalog backends 
should extend this
+ * abstract class and the inner Builder class to provide the conversion 
between the backend table
+ * and the HudiTable.
+ *
+ * @param <TABLE> the table type from the backend
+ */
+public abstract class HudiTable<TABLE> extends BaseTable {
+  /**
+   * Converts the HudiTable to the backend table.
+   *
+   * @return the backend table
+   */
+  public abstract TABLE fromHudiTable();
+
+  @Override
+  public TableOperations newOps() throws UnsupportedOperationException {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public abstract static class Builder<T> extends BaseTableBuilder<Builder<T>, 
HudiTable> {
+    T backendTable;
+
+    public Builder<T> withBackendTable(T backendTable) {
+      this.backendTable = backendTable;
+      return this;
+    }
+
+    @Override
+    protected HudiTable<T> internalBuild() {
+      return backendTable == null ? simpleBuild() : 
buildFromTable(backendTable);
+    }
+
+    /**
+     * Builds a simple HudiTable without a backend table.
+     *
+     * @return the HudiTable
+     */
+    protected abstract HudiTable<T> simpleBuild();
+
+    /**
+     * Builds a HudiTable from the backend table.
+     *
+     * @param backendTable the backend table
+     * @return the HudiTable
+     */
+    protected abstract HudiTable<T> buildFromTable(T backendTable);
+  }
+}
diff --git 
a/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiTablePropertiesMetadata.java
 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiTablePropertiesMetadata.java
new file mode 100644
index 000000000..3b87867c0
--- /dev/null
+++ 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/HudiTablePropertiesMetadata.java
@@ -0,0 +1,31 @@
+/*
+ * 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.lakehouse.hudi;
+
+import java.util.Collections;
+import java.util.Map;
+import org.apache.gravitino.connector.BasePropertiesMetadata;
+import org.apache.gravitino.connector.PropertyEntry;
+
+public class HudiTablePropertiesMetadata extends BasePropertiesMetadata {
+  @Override
+  protected Map<String, PropertyEntry<?>> specificPropertyEntries() {
+    return Collections.emptyMap();
+  }
+}
diff --git 
a/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/backend/BackendType.java
 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/backend/BackendType.java
new file mode 100644
index 000000000..1d3efc243
--- /dev/null
+++ 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/backend/BackendType.java
@@ -0,0 +1,23 @@
+/*
+ * 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.lakehouse.hudi.backend;
+
+public enum BackendType {
+  HMS, // Hive Metastore backend
+}
diff --git 
a/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/backend/HudiCatalogBackend.java
 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/backend/HudiCatalogBackend.java
new file mode 100644
index 000000000..e257e6019
--- /dev/null
+++ 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/backend/HudiCatalogBackend.java
@@ -0,0 +1,45 @@
+/*
+ * 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.lakehouse.hudi.backend;
+
+import java.util.Map;
+import org.apache.gravitino.catalog.lakehouse.hudi.ops.HudiCatalogBackendOps;
+
+/** Base class for Hudi catalog backends. */
+public abstract class HudiCatalogBackend {
+
+  private final BackendType backendType;
+
+  private final HudiCatalogBackendOps catalogOps;
+
+  public abstract void initialize(Map<String, String> properties);
+
+  protected HudiCatalogBackend(BackendType backendType, HudiCatalogBackendOps 
catalogOps) {
+    this.backendType = backendType;
+    this.catalogOps = catalogOps;
+  }
+
+  public BackendType type() {
+    return backendType;
+  }
+
+  public HudiCatalogBackendOps catalogOps() {
+    return catalogOps;
+  }
+}
diff --git 
a/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/backend/hms/HudiHMSBackend.java
 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/backend/hms/HudiHMSBackend.java
new file mode 100644
index 000000000..dfc6228f2
--- /dev/null
+++ 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/backend/hms/HudiHMSBackend.java
@@ -0,0 +1,43 @@
+/*
+ * 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.lakehouse.hudi.backend.hms;
+
+import static 
org.apache.gravitino.catalog.lakehouse.hudi.backend.BackendType.HMS;
+
+import java.util.Map;
+import org.apache.gravitino.catalog.lakehouse.hudi.backend.BackendType;
+import org.apache.gravitino.catalog.lakehouse.hudi.backend.HudiCatalogBackend;
+import org.apache.gravitino.catalog.lakehouse.hudi.ops.HudiCatalogBackendOps;
+
+public class HudiHMSBackend extends HudiCatalogBackend {
+
+  public HudiHMSBackend() {
+    this(HMS, new HudiHMSBackendOps());
+  }
+
+  private HudiHMSBackend(BackendType backendType, HudiCatalogBackendOps 
catalogOps) {
+    super(backendType, catalogOps);
+  }
+
+  @Override
+  public void initialize(Map<String, String> properties) {
+    // todo: initialize the catalogOps
+    catalogOps().initialize(properties);
+  }
+}
diff --git 
a/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/backend/hms/HudiHMSBackendOps.java
 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/backend/hms/HudiHMSBackendOps.java
new file mode 100644
index 000000000..3f21148b1
--- /dev/null
+++ 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/backend/hms/HudiHMSBackendOps.java
@@ -0,0 +1,113 @@
+/*
+ * 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.lakehouse.hudi.backend.hms;
+
+import java.util.Map;
+import org.apache.gravitino.NameIdentifier;
+import org.apache.gravitino.Namespace;
+import org.apache.gravitino.SchemaChange;
+import org.apache.gravitino.catalog.lakehouse.hudi.ops.HudiCatalogBackendOps;
+import org.apache.gravitino.exceptions.NoSuchCatalogException;
+import org.apache.gravitino.exceptions.NoSuchSchemaException;
+import org.apache.gravitino.exceptions.NoSuchTableException;
+import org.apache.gravitino.exceptions.NonEmptySchemaException;
+import org.apache.gravitino.exceptions.SchemaAlreadyExistsException;
+import org.apache.gravitino.exceptions.TableAlreadyExistsException;
+import org.apache.gravitino.rel.Column;
+import org.apache.gravitino.rel.TableChange;
+import org.apache.gravitino.rel.expressions.distributions.Distribution;
+import org.apache.gravitino.rel.expressions.sorts.SortOrder;
+import org.apache.gravitino.rel.expressions.transforms.Transform;
+import org.apache.gravitino.rel.indexes.Index;
+
+public class HudiHMSBackendOps implements HudiCatalogBackendOps {
+
+  @Override
+  public void initialize(Map<String, String> properties) {
+    // todo: initialize the catalogOps
+  }
+
+  @Override
+  public HudiHMSSchema loadSchema(NameIdentifier schemaIdent) throws 
NoSuchSchemaException {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  @Override
+  public NameIdentifier[] listSchemas(Namespace namespace) throws 
NoSuchCatalogException {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  @Override
+  public HudiHMSSchema createSchema(
+      NameIdentifier ident, String comment, Map<String, String> properties)
+      throws NoSuchCatalogException, SchemaAlreadyExistsException {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  @Override
+  public HudiHMSSchema alterSchema(NameIdentifier ident, SchemaChange... 
changes)
+      throws NoSuchSchemaException {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  @Override
+  public boolean dropSchema(NameIdentifier ident, boolean cascade) throws 
NonEmptySchemaException {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  @Override
+  public NameIdentifier[] listTables(Namespace namespace) throws 
NoSuchSchemaException {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  @Override
+  public HudiHMSTable loadTable(NameIdentifier ident) throws 
NoSuchTableException {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  @Override
+  public HudiHMSTable createTable(
+      NameIdentifier ident,
+      Column[] columns,
+      String comment,
+      Map<String, String> properties,
+      Transform[] partitions,
+      Distribution distribution,
+      SortOrder[] sortOrders,
+      Index[] indexes)
+      throws NoSuchSchemaException, TableAlreadyExistsException {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  @Override
+  public HudiHMSTable alterTable(NameIdentifier ident, TableChange... changes)
+      throws NoSuchTableException, IllegalArgumentException {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  @Override
+  public boolean dropTable(NameIdentifier ident) {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  @Override
+  public void close() {
+    // todo: close the HMS connection
+  }
+}
diff --git 
a/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/backend/hms/HudiHMSSchema.java
 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/backend/hms/HudiHMSSchema.java
new file mode 100644
index 000000000..636d76ba2
--- /dev/null
+++ 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/backend/hms/HudiHMSSchema.java
@@ -0,0 +1,57 @@
+/*
+ * 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.lakehouse.hudi.backend.hms;
+
+import org.apache.gravitino.catalog.lakehouse.hudi.HudiSchema;
+import org.apache.hadoop.hive.metastore.api.Database;
+
+public class HudiHMSSchema extends HudiSchema<Database> {
+
+  public static Builder builder() {
+    return new Builder();
+  }
+
+  private HudiHMSSchema() {
+    super();
+  }
+
+  @Override
+  public Database fromHudiSchema() {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public static class Builder extends HudiSchema.Builder<Database> {
+
+    @Override
+    protected HudiSchema simpleBuild() {
+      HudiHMSSchema schema = new HudiHMSSchema();
+      schema.name = name;
+      schema.comment = comment;
+      schema.properties = properties;
+      schema.auditInfo = auditInfo;
+      return schema;
+    }
+
+    @Override
+    protected HudiSchema buildFromSchema(Database schema) {
+      // todo: convert HMS database to HudiSchema
+      return simpleBuild();
+    }
+  }
+}
diff --git 
a/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/backend/hms/HudiHMSTable.java
 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/backend/hms/HudiHMSTable.java
new file mode 100644
index 000000000..4bd65b54d
--- /dev/null
+++ 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/backend/hms/HudiHMSTable.java
@@ -0,0 +1,59 @@
+/*
+ * 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.lakehouse.hudi.backend.hms;
+
+import org.apache.gravitino.catalog.lakehouse.hudi.HudiTable;
+import org.apache.hadoop.hive.metastore.api.Table;
+
+public class HudiHMSTable extends HudiTable<Table> {
+  public static Builder builder() {
+    return new Builder();
+  }
+
+  private HudiHMSTable() {
+    super();
+  }
+
+  @Override
+  public Table fromHudiTable() {
+    throw new UnsupportedOperationException("Not implemented yet");
+  }
+
+  public static class Builder extends HudiTable.Builder<Table> {
+    @Override
+    protected HudiHMSTable simpleBuild() {
+      HudiHMSTable table = new HudiHMSTable();
+      table.name = name;
+      table.comment = comment;
+      table.columns = columns;
+      table.indexes = indexes;
+      table.partitioning = partitioning;
+      table.distribution = distribution;
+      table.properties = properties;
+      table.auditInfo = auditInfo;
+      return table;
+    }
+
+    @Override
+    protected HudiTable buildFromTable(Table backendTable) {
+      // todo: convert HMS table to HudiTable
+      return simpleBuild();
+    }
+  }
+}
diff --git 
a/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/ops/HudiCatalogBackendOps.java
 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/ops/HudiCatalogBackendOps.java
new file mode 100644
index 000000000..c3441c3de
--- /dev/null
+++ 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/ops/HudiCatalogBackendOps.java
@@ -0,0 +1,97 @@
+/*
+ * 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.lakehouse.hudi.ops;
+
+import java.util.Map;
+import org.apache.gravitino.NameIdentifier;
+import org.apache.gravitino.Namespace;
+import org.apache.gravitino.SchemaChange;
+import org.apache.gravitino.catalog.lakehouse.hudi.HudiSchema;
+import org.apache.gravitino.exceptions.NoSuchCatalogException;
+import org.apache.gravitino.exceptions.NoSuchSchemaException;
+import org.apache.gravitino.exceptions.NoSuchTableException;
+import org.apache.gravitino.exceptions.NonEmptySchemaException;
+import org.apache.gravitino.exceptions.SchemaAlreadyExistsException;
+import org.apache.gravitino.exceptions.TableAlreadyExistsException;
+import org.apache.gravitino.rel.Column;
+import org.apache.gravitino.rel.Table;
+import org.apache.gravitino.rel.TableChange;
+import org.apache.gravitino.rel.expressions.distributions.Distribution;
+import org.apache.gravitino.rel.expressions.sorts.SortOrder;
+import org.apache.gravitino.rel.expressions.transforms.Transform;
+import org.apache.gravitino.rel.indexes.Index;
+
+/** Operations for Interacting with Hudi Catalog. */
+public interface HudiCatalogBackendOps extends AutoCloseable {
+
+  void initialize(Map<String, String> properties);
+
+  HudiSchema loadSchema(NameIdentifier schemaIdent) throws 
NoSuchSchemaException;
+
+  NameIdentifier[] listSchemas(Namespace namespace) throws 
NoSuchCatalogException;
+
+  default boolean schemaExists(NameIdentifier ident) {
+    try {
+      loadSchema(ident);
+      return true;
+    } catch (NoSuchSchemaException e) {
+      return false;
+    }
+  }
+
+  HudiSchema createSchema(NameIdentifier ident, String comment, Map<String, 
String> properties)
+      throws NoSuchCatalogException, SchemaAlreadyExistsException;
+
+  HudiSchema alterSchema(NameIdentifier ident, SchemaChange... changes)
+      throws NoSuchSchemaException;
+
+  boolean dropSchema(NameIdentifier ident, boolean cascade) throws 
NonEmptySchemaException;
+
+  NameIdentifier[] listTables(Namespace namespace) throws 
NoSuchSchemaException;
+
+  Table loadTable(NameIdentifier ident) throws NoSuchTableException;
+
+  default boolean tableExists(NameIdentifier ident) {
+    try {
+      return loadTable(ident) != null;
+    } catch (NoSuchTableException e) {
+      return false;
+    }
+  }
+
+  Table createTable(
+      NameIdentifier ident,
+      Column[] columns,
+      String comment,
+      Map<String, String> properties,
+      Transform[] partitions,
+      Distribution distribution,
+      SortOrder[] sortOrders,
+      Index[] indexes)
+      throws NoSuchSchemaException, TableAlreadyExistsException;
+
+  Table alterTable(NameIdentifier ident, TableChange... changes)
+      throws NoSuchTableException, IllegalArgumentException;
+
+  boolean dropTable(NameIdentifier ident);
+
+  default boolean purgeTable(NameIdentifier ident) throws 
UnsupportedOperationException {
+    throw new UnsupportedOperationException("purgeTable not supported.");
+  }
+}
diff --git 
a/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/utils/CatalogUtils.java
 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/utils/CatalogUtils.java
new file mode 100644
index 000000000..853d71159
--- /dev/null
+++ 
b/catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/utils/CatalogUtils.java
@@ -0,0 +1,34 @@
+/*
+ * 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.lakehouse.hudi.utils;
+
+import java.util.Map;
+import org.apache.gravitino.catalog.lakehouse.hudi.backend.HudiCatalogBackend;
+import org.apache.gravitino.catalog.lakehouse.hudi.backend.hms.HudiHMSBackend;
+
+public class CatalogUtils {
+  private CatalogUtils() {}
+
+  public static HudiCatalogBackend loadHudiCatalogBackend(Map<String, String> 
properties) {
+    // todo: load and initialize the backend based on the properties
+    HudiCatalogBackend hudiHMSBackend = new HudiHMSBackend();
+    hudiHMSBackend.initialize(properties);
+    return hudiHMSBackend;
+  }
+}
diff --git 
a/catalogs/catalog-lakehouse-hudi/src/main/resources/META-INF/services/org.apache.gravitino.CatalogProvider
 
b/catalogs/catalog-lakehouse-hudi/src/main/resources/META-INF/services/org.apache.gravitino.CatalogProvider
new file mode 100644
index 000000000..c862a3499
--- /dev/null
+++ 
b/catalogs/catalog-lakehouse-hudi/src/main/resources/META-INF/services/org.apache.gravitino.CatalogProvider
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+org.apache.gravitino.catalog.lakehouse.hudi.HudiCatalog
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index a25ddfcae..968190c48 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -95,6 +95,7 @@ woodstox-core = "5.3.0"
 mail = "1.4.1"
 rome = "1.0"
 jettison = "1.1"
+thrift = "0.12.0"
 
 [libraries]
 protobuf-java = { group = "com.google.protobuf", name = "protobuf-java", 
version.ref = "protoc" }
@@ -199,6 +200,7 @@ kafka = { group = "org.apache.kafka", name = "kafka_2.12", 
version.ref = "kafka"
 curator-test = { group = "org.apache.curator", name = "curator-test", 
version.ref = "curator"}
 cglib = { group = "cglib", name = "cglib", version.ref = "cglib"}
 woodstox-core = { group = "com.fasterxml.woodstox", name = "woodstox-core", 
version.ref = "woodstox-core"}
+thrift = { group = "org.apache.thrift", name = "libthrift", version.ref = 
"thrift"}
 
 ranger-intg = { group = "org.apache.ranger", name = "ranger-intg", version.ref 
= "ranger" }
 javax-jaxb-api = { group = "javax.xml.bind", name = "jaxb-api", version.ref = 
"javax-jaxb-api" }
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 1bf0d5083..a8efa85bc 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -30,6 +30,7 @@ include("catalogs:catalog-common")
 include("catalogs:catalog-hive")
 include("catalogs:catalog-lakehouse-iceberg")
 include("catalogs:catalog-lakehouse-paimon")
+include("catalogs:catalog-lakehouse-hudi")
 include(
   "catalogs:catalog-jdbc-common",
   "catalogs:catalog-jdbc-doris",

Reply via email to