You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "diqiu50 (via GitHub)" <gi...@apache.org> on 2025/08/12 13:49:10 UTC

[PR] [#5514] feat (trino-connector) Support rest backend for Iceberg catalog [gravitino]

diqiu50 opened a new pull request, #8045:
URL: https://github.com/apache/gravitino/pull/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
   


-- 
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] [#5514] feat (trino-connector) Support rest backend for Iceberg catalog [gravitino]

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


##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/iceberg/IcebergCatalogPropertyConverter.java:
##########
@@ -107,4 +113,19 @@ private Map<String, String> buildJDBCBackendProperties(Map<String, String> prope
 
     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");

Review Comment:
   Does trino support other rest properties like warehouse?



-- 
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] [#5514] feat (trino-connector) Support rest backend for Iceberg catalog [gravitino]

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


##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/iceberg/IcebergCatalogPropertyConverter.java:
##########
@@ -41,6 +41,9 @@ 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 =
+      HIVE_BACKEND_REQUIRED_PROPERTIES;

Review Comment:
   REST backend uses the same properies as Hive? Didn't see any place to modify this variable.



-- 
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] [#5514] feat (trino-connector) Support rest backend for Iceberg catalog [gravitino]

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


##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/iceberg/IcebergCatalogPropertyConverter.java:
##########
@@ -107,4 +113,19 @@ private Map<String, String> buildJDBCBackendProperties(Map<String, String> prope
 
     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");

Review Comment:
   Trino  doest not support set `warehouse` in the  connector configuration



-- 
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] [#5514] feat (trino-connector) Support rest backend for Iceberg catalog [gravitino]

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


##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/iceberg/IcebergCatalogPropertyConverter.java:
##########
@@ -41,6 +41,9 @@ 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 =
+      HIVE_BACKEND_REQUIRED_PROPERTIES;

Review Comment:
   This property is defined by Gravitino and is returned by the catalog. It will not be modified here.
   



-- 
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] [#5514] feat (trino-connector) Support rest backend for Iceberg catalog [gravitino]

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


-- 
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] [#5514] feat (trino-connector) Support rest backend for Iceberg catalog [gravitino]

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


##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/iceberg/IcebergCatalogPropertyConverter.java:
##########
@@ -41,6 +41,9 @@ 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 =
+      HIVE_BACKEND_REQUIRED_PROPERTIES;

Review Comment:
   seems a little odd, suggest not reusing the `HIVE_BACKEND_REQUIRED_PROPERTIES`



-- 
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] [#5514] feat (trino-connector) Support rest backend for Iceberg catalog [gravitino]

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

   LGTM, @shaofengshi  do you have other 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] [#5514] feat (trino-connector) Support rest backend for Iceberg catalog [gravitino]

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


##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/iceberg/IcebergCatalogPropertyConverter.java:
##########
@@ -107,4 +113,19 @@ private Map<String, String> buildJDBCBackendProperties(Map<String, String> prope
 
     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");

Review Comment:
   It cannot be reused because the key names are different. If users need to pass additional Iceberg parameters, they can do so by using the `trino.bypass.` prefix, following the configuration of the Trino Iceberg connector.



-- 
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] [#5514] feat (trino-connector) Support rest backend for Iceberg catalog [gravitino]

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

   > Do we need to update the Gravitino Trino document?
   
   No, the doc is refer to the Trino Iceberg connector。


-- 
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] [#5514] feat (trino-connector) Support rest backend for Iceberg catalog [gravitino]

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

   Do we need to update the Gravitino Trino document?


-- 
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