diqiu50 commented on code in PR #13584:
URL: https://github.com/apache/gravitino/pull/13584#discussion_r4131448919


##########
spark-connector/spark-common/src/main/java/org/apache/gravitino/spark/connector/iceberg/GravitinoIcebergCatalog.java:
##########
@@ -74,6 +74,34 @@ public class GravitinoIcebergCatalog extends BaseCatalog
   @Override
   protected TableCatalog createAndInitSparkCatalog(
       String name, CaseInsensitiveStringMap options, Map<String, String> 
properties) {
+    String catalogBackendName = 
IcebergPropertiesUtils.getCatalogBackendName(properties);
+    Map<String, String> all =
+        buildSparkCatalogProperties(
+            name,
+            options,
+            properties,
+            SparkSession.active().sparkContext().conf(),
+            () -> GravitinoCatalogManager.get().getIcebergRestUri());
+    TableCatalog icebergCatalog = new SparkCatalog();
+    icebergCatalog.initialize(catalogBackendName, new 
CaseInsensitiveStringMap(all));
+    return icebergCatalog;
+  }
+
+  Map<String, String> buildSparkCatalogProperties(
+      String name,
+      CaseInsensitiveStringMap options,
+      Map<String, String> properties,
+      SparkConf sparkConf,
+      Supplier<Optional<String>> endpointDiscovery) {
+    Optional<String> icebergRestUri =
+        resolveIcebergRestUri(properties, key -> sparkConf.get(key, null), 
endpointDiscovery);
+    if (icebergRestUri.isPresent()) {

Review Comment:
   Yes, this is intended: for a routed catalog the routing error names the real 
misconfiguration, while the driver error pointed at a class the routed client 
never uses. 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to