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

fanng 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 6969bb4210 [#5514] feat (trino-connector) Support rest backend  for 
Iceberg catalog (#8045)
6969bb4210 is described below

commit 6969bb42100340a8afc2c23c48d3d543e9f8ba7e
Author: Yuhui <[email protected]>
AuthorDate: Fri Aug 15 17:17:33 2025 +0800

    [#5514] feat (trino-connector) Support rest backend  for Iceberg catalog 
(#8045)
    
    ### What changes were proposed in this pull request?
    
    Trino connector support rest backend  for Iceberg catalog
    
    ### Why are the changes needed?
    
    Fix: #5514
    
    ### Does this PR introduce _any_ user-facing change?
    
    Yes
    
    ### How was this patch tested?
    
    Manually test
---
 .../iceberg/IcebergCatalogPropertyConverter.java     | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git 
a/trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/iceberg/IcebergCatalogPropertyConverter.java
 
b/trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/iceberg/IcebergCatalogPropertyConverter.java
index 02b15cb40c..06d45aa84b 100644
--- 
a/trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/iceberg/IcebergCatalogPropertyConverter.java
+++ 
b/trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/iceberg/IcebergCatalogPropertyConverter.java
@@ -41,6 +41,8 @@ public class IcebergCatalogPropertyConverter extends 
CatalogPropertyConverter {
 
   private static final Set<String> HIVE_BACKEND_REQUIRED_PROPERTIES = 
Set.of("uri");
 
+  private static final Set<String> REST_BACKEND_REQUIRED_PROPERTIES = 
Set.of("uri");
+
   @Override
   public Map<String, String> gravitinoToEngineProperties(Map<String, String> 
properties) {
     Map<String, String> stringStringMap;
@@ -52,6 +54,9 @@ public class IcebergCatalogPropertyConverter extends 
CatalogPropertyConverter {
       case "jdbc":
         stringStringMap = buildJDBCBackendProperties(properties);
         break;
+      case "rest":
+        stringStringMap = buildRestBackendProperties(properties);
+        break;
       default:
         throw new UnsupportedOperationException("Unsupported backend type: " + 
backend);
     }
@@ -107,4 +112,19 @@ public class IcebergCatalogPropertyConverter extends 
CatalogPropertyConverter {
 
     return jdbcProperties;
   }
+
+  private Map<String, String> buildRestBackendProperties(Map<String, String> 
properties) {
+    Set<String> missingProperty =
+        Sets.difference(REST_BACKEND_REQUIRED_PROPERTIES, properties.keySet());
+    if (!missingProperty.isEmpty()) {
+      throw new TrinoException(
+          GravitinoErrorCode.GRAVITINO_MISSING_REQUIRED_PROPERTY,
+          "Missing required property for Rest backend: " + missingProperty);
+    }
+
+    Map<String, String> jdbcProperties = new HashMap<>();
+    jdbcProperties.put("iceberg.catalog.type", "rest");
+    jdbcProperties.put("iceberg.rest-catalog.uri", 
properties.get(IcebergConstants.URI));
+    return jdbcProperties;
+  }
 }

Reply via email to