mustajibmk commented on code in PR #15408:
URL: https://github.com/apache/druid/pull/15408#discussion_r1429804760


##########
processing/src/main/java/org/apache/druid/utils/ConnectionUriUtils.java:
##########
@@ -177,21 +182,75 @@ public static Set<String> 
tryParsePostgresConnectionUri(String connectionUri)
   }
 
   public static Set<String> tryParseMySqlConnectionUri(String connectionUri)
-      throws ClassNotFoundException, NoSuchMethodException, 
InstantiationException, IllegalAccessException,
+      throws ClassNotFoundException, NoSuchMethodException, 
IllegalAccessException,
              InvocationTargetException
   {
-    Class<?> driverClass = Class.forName(MYSQL_NON_REGISTERING_DRIVER);
-    Method parseUrl = driverClass.getMethod("parseURL", String.class, 
Properties.class);
-    // almost the same as postgres, but is an instance level method
-    Properties properties = (Properties) parseUrl.invoke(
-        driverClass.getConstructor().newInstance(),
-        connectionUri,
-        null
-    );
+    Class<?> connectionUrlClass = Class.forName(MYSQL_CONNECTION_URL);
+    Class<?> hostInfoClass = Class.forName(MYSQL_HOST_INFO);
+    Class<?> urlParserClass = Class.forName(MYSQL_CONNECTION_URL_PARSER);
+    Method isConnectionStringSupported = 
urlParserClass.getMethod("isConnectionStringSupported", String.class);
+    boolean isConnectionUrlSupported = (boolean) 
isConnectionStringSupported.invoke(urlParserClass, connectionUri);

Review Comment:
   Given that `isConnectionStringSupported` only checks the schema which to a 
certain extends already happens 
[here](https://github.com/apache/druid/blob/13e16e36206fb26c0f32c954cfd641375f94e9f1/processing/src/main/java/org/apache/druid/utils/ConnectionUriUtils.java#L97).
 Should we have this check in place?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to