yuqi1129 commented on code in PR #9735:
URL: https://github.com/apache/gravitino/pull/9735#discussion_r2735123707


##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/GravitinoConnectorFactory.java:
##########
@@ -117,13 +137,75 @@ public Connector create(
       }
       GravitinoStoredProcedureFactory gravitinoStoredProcedureFactory =
           new GravitinoStoredProcedureFactory(catalogConnectorManager, 
metalake);
-      return new GravitinoSystemConnector(gravitinoStoredProcedureFactory);
+      return createSystemConnector(gravitinoStoredProcedureFactory);
     }
   }
 
-  @VisibleForTesting
-  Supplier<GravitinoAdminClient> clientProvider() {
-    return () -> null;
+  protected GravitinoConnector createConnector(CatalogConnectorContext 
connectorContext) {
+    throw new RuntimeException("Should be overridden in subclass");
+  }
+
+  protected GravitinoSystemConnector createSystemConnector(
+      GravitinoStoredProcedureFactory storedProcedureFactory) {
+    return new GravitinoSystemConnector(storedProcedureFactory);
+  }
+
+  protected String getTrinoCatalogName(String metalakeName, String 
catalogName) {
+    return "\"" + metalakeName + "." + catalogName + "\"";
+  }
+
+  private void checkTrinoSpiVersion(ConnectorContext context, GravitinoConfig 
config) {
+    String spiVersion = context.getSpiVersion();
+    trinoVersion = Integer.parseInt(spiVersion);
+
+    // check catalog name with metalake are supported in this trino version
+    if (!config.singleMetalakeMode() && !supportCatalogNameWithMetalake()) {
+      String errmsg =
+          String.format(
+              "The trino-connector-%s-%s does not support catalog name with 
metalake.",
+              getMinSupportTrinoSpiVersion(), getMaxSupportTrinoSpiVersion());
+      throw new 
TrinoException(GravitinoErrorCode.GRAVITINO_UNSUPPORTED_TRINO_VERSION, errmsg);
+    }
+
+    // skip version validation
+    boolean spiVersionCheck = config.isSkipTrinoVersionValidation();
+    if (spiVersionCheck) {
+      if (trinoVersion < getMinSupportTrinoSpiVersion()

Review Comment:
   So, even if I skip the version check, will there still be a warning if the 
running version is outside the supported range?



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