AydarZaynutdinov commented on a change in pull request #14856: URL: https://github.com/apache/beam/pull/14856#discussion_r699191972
########## File path: sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java ########## @@ -262,10 +262,10 @@ public static ReadRows readRows() { * @param <T> Type of the data to be written. */ public static <T> Write<T> write() { - return new Write(); + return new Write<>(); } - public static <T> WriteVoid<T> writeVoid() { + private static <T> WriteVoid<T> writeVoid() { Review comment: Changed it back. ########## File path: sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java ########## @@ -1070,15 +1070,32 @@ public static RetryConfiguration create( * * <pre>{@code * PCollection<Void> firstWriteResults = data.apply(JdbcIO.write() - * .withDataSourceConfiguration(CONF_DB_1).withResults()); + * .withDataSourceConfiguration(CONF_DB_1).withVoidResults()); * data.apply(Wait.on(firstWriteResults)) * .apply(JdbcIO.write().withDataSourceConfiguration(CONF_DB_2)); * }</pre> */ - public WriteVoid<T> withResults() { + public WriteVoid<T> withVoidResults() { Review comment: Changed it back. ########## File path: sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java ########## @@ -1222,7 +1239,244 @@ void set( throws SQLException; } - /** A {@link PTransform} to write to a JDBC datasource. */ + /** + * A {@link PTransform} to write to a JDBC datasource. Executes statements one by one. + * + * <p>The INSERT, UPDATE, and DELETE commands sometimes have an optional RETURNING clause that + * supports obtaining data from modified rows while they are being manipulated. Output {@link + * PCollection} of this transform is a collection of such returning results mapped by {@link + * RowMapper}. + */ + @AutoValue + public abstract static class WriteWithResults<T, V> + extends PTransform<PCollection<T>, PCollection<V>> { Review comment: Add abstract class `JdbcWriteResult` and now `WriteWithResult` class uses `<T, V extends JdbcWriteResult>`. -- 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: github-unsubscr...@beam.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org