robertwb commented on code in PR #30024:
URL: https://github.com/apache/beam/pull/30024#discussion_r1468257406


##########
sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcReadSchemaTransformProvider.java:
##########
@@ -164,12 +194,17 @@ public abstract static class 
JdbcReadSchemaTransformConfiguration implements Ser
     public abstract String getDriverJars();
 
     public void validate() throws IllegalArgumentException {
-      if (Strings.isNullOrEmpty(getDriverClassName())) {
-        throw new IllegalArgumentException("JDBC Driver class name cannot be 
blank.");
+      if (Strings.isNullOrEmpty(getDriverClassName()) && 
Strings.isNullOrEmpty(getJdbcType())) {

Review Comment:
   Is it an error to specify both?



##########
sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcWriteSchemaTransformProvider.java:
##########
@@ -73,8 +78,29 @@ public 
JdbcWriteSchemaTransform(JdbcWriteSchemaTransformConfiguration config) {
     }
 
     protected JdbcIO.DataSourceConfiguration dataSourceConfiguration() {
+      String driverClassName = config.getDriverClassName();
+
+      if (Strings.isNullOrEmpty(driverClassName)) {

Review Comment:
   Same as above, put these in a map. (Seems like it's the same map. Refactor 
to a common location?)



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