och5351 commented on code in PR #183:
URL: 
https://github.com/apache/flink-connector-jdbc/pull/183#discussion_r2878338506


##########
flink-connector-jdbc-core/src/main/java/org/apache/flink/connector/jdbc/core/database/catalog/AbstractJdbcCatalog.java:
##########
@@ -579,14 +586,61 @@ protected String getSchemaTableName(ObjectPath tablePath) 
{
         throw new UnsupportedOperationException();
     }
 
+    private Function<String, String> calculateUrlFunction(String url) {
+        final String[] parts;
+        final int questionMarkIndex = url.indexOf('?');
+        if (questionMarkIndex == -1) {
+            parts = url.split("/+", 3);
+            return dbName -> parts.length == 3 ? url.trim() : url.trim() + "/" 
+ dbName;
+        } else {
+            String withoutParams = url.substring(0, questionMarkIndex);
+            String prefix = withoutParams.substring(0, 
withoutParams.lastIndexOf('/') + 1);
+            String params = url.substring(questionMarkIndex + 1);

Review Comment:
   @RocMarshal
   
   I realized I made a mistake. URLs with database options already contain a 
question mark, but the pre-commit code was adding another one. I've fixed and 
committed the code. Could you please run the CI again?



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