Abacn commented on code in PR #33062:
URL: https://github.com/apache/beam/pull/33062#discussion_r1839352552


##########
sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcUtil.java:
##########
@@ -563,4 +577,232 @@ public KV<Long, KV<DateTime, DateTime>> mapRow(ResultSet 
resultSet) throws Excep
               }
             }
           });
+
+  @AutoValue
+  abstract static class JdbcUrl {
+    abstract String getScheme();
+
+    abstract @Nullable String getHostAndPort();
+
+    abstract String getDatabase();
+
+    static @Nullable JdbcUrl of(String url) {
+      if (Strings.isNullOrEmpty(url) || !url.startsWith("jdbc:")) {

Review Comment:
   yes from test. For HikariDataSouce, checked that the whitespace in the front 
does not affect the result of getJdbcUrl() call; For DataSource setup by field, 
it fails when host contains trailing space



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