johnjcasey commented on code in PR #25824:
URL: https://github.com/apache/beam/pull/25824#discussion_r1180580483
##########
sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java:
##########
@@ -583,17 +589,36 @@ public DataSourceConfiguration
withDriverClassLoader(ClassLoader driverClassLoad
return builder().setDriverClassLoader(driverClassLoader).build();
}
+ /**
+ * Comma separated paths for JDBC drivers. This method is filesystem
agnostic and can be used
+ * for all FileSystems supported by Beam If not specified, the default
classloader is used to
+ * load the jars.
+ *
+ * <p>For example,
gs://your-bucket/driver_jar1.jar,gs://your-bucket/driver_jar2.jar.
+ */
+ public DataSourceConfiguration withDriverJars(String driverJars) {
+ checkArgument(driverJars != null, "driverJars can not be null");
+ return withDriverJars(ValueProvider.StaticValueProvider.of(driverJars));
+ }
+
+ /** Same as {@link #withDriverJars(String)} but accepting a ValueProvider.
*/
+ public DataSourceConfiguration withDriverJars(ValueProvider<String>
driverJars) {
+ checkArgument(driverJars != null, "driverJars can not be null");
+ return builder().setDriverJars(driverJars).build();
+ }
+
void populateDisplayData(DisplayData.Builder builder) {
if (getDataSource() != null) {
builder.addIfNotNull(DisplayData.item("dataSource",
getDataSource().getClass().getName()));
} else {
builder.addIfNotNull(DisplayData.item("jdbcDriverClassName",
getDriverClassName()));
builder.addIfNotNull(DisplayData.item("jdbcUrl", getUrl()));
builder.addIfNotNull(DisplayData.item("username", getUsername()));
+ builder.addIfNotNull(DisplayData.item("driverJars", getDriverJars()));
}
}
- DataSource buildDatasource() {
+ public DataSource buildDatasource() {
Review Comment:
Nit: should this be public?
--
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]