hqbhoho commented on code in PR #7629:
URL: https://github.com/apache/gravitino/pull/7629#discussion_r2197025131


##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/CatalogRegister.java:
##########
@@ -64,12 +64,20 @@ private void checkTrinoSpiVersion(ConnectorContext context) 
{
     this.trinoVersion = context.getSpiVersion();
 
     int version = Integer.parseInt(context.getSpiVersion());
-    if (version < MIN_SUPPORT_TRINO_SPI_VERSION || version > 
MAX_SUPPORT_TRINO_SPI_VERSION) {
-      String errmsg =
-          String.format(
-              "Unsupported Trino-%s version. The Supported version for the 
Gravitino-Trino-connector from Trino-%d to Trino-%d",
-              trinoVersion, MIN_SUPPORT_TRINO_SPI_VERSION, 
MAX_SUPPORT_TRINO_SPI_VERSION);
-      throw new 
TrinoException(GravitinoErrorCode.GRAVITINO_UNSUPPORTED_TRINO_VERSION, errmsg);
+
+    Boolean skipTrinoVersionValidation = config.isSkipTrinoVersionValidation();
+    if (!skipTrinoVersionValidation) {
+      if (version < MIN_SUPPORT_TRINO_SPI_VERSION || version > 
MAX_SUPPORT_TRINO_SPI_VERSION) {
+        String errmsg =
+            String.format(
+                "Unsupported Trino-%s version. The Supported version for the 
Gravitino-Trino-connector from Trino-%d to Trino-%d",
+                trinoVersion, MIN_SUPPORT_TRINO_SPI_VERSION, 
MAX_SUPPORT_TRINO_SPI_VERSION);
+        throw new 
TrinoException(GravitinoErrorCode.GRAVITINO_UNSUPPORTED_TRINO_VERSION, errmsg);
+      }
+    } else {
+      LOG.warn(

Review Comment:
   > The message is incorrect. How do you know the version is not between 435 
and 439 here?
   
   The version depends on Trino runtime environment.  `this.trinoVersion = 
context.getSpiVersion()` wiil return current  Trino version which is running. 



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